Skip to content

Commit d5a58a8

Browse files
authored
Rollup merge of #99185 - krasimirgg:llvm-wrapper-inlineasm, r=nikic
llvm-wrapper: adapt for LLVM API change This adapts RustWrapper's ` LLVMRustInlineAsmVerify` for LLVM commit llvm/llvm-project@00797b8.
2 parents cd22818 + a89d014 commit d5a58a8

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)