Skip to content

Commit a89d014

Browse files
committed
llvm-wrapper: adapt for LLVM API change
1 parent 1c7b36d commit a89d014

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,14 @@ LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,
411411

412412
extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
413413
size_t ConstraintsLen) {
414+
#if LLVM_VERSION_LT(15, 0)
414415
return InlineAsm::Verify(unwrap<FunctionType>(Ty),
415416
StringRef(Constraints, ConstraintsLen));
417+
#else
418+
// llvm::Error converts to true if it is an error.
419+
return !llvm::errorToBool(InlineAsm::verify(
420+
unwrap<FunctionType>(Ty), StringRef(Constraints, ConstraintsLen)));
421+
#endif
416422
}
417423

418424
extern "C" void LLVMRustAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm,

0 commit comments

Comments
 (0)