Skip to content

Commit

Permalink
Rollup merge of rust-lang#99185 - krasimirgg:llvm-wrapper-inlineasm, …
Browse files Browse the repository at this point in the history
…r=nikic

llvm-wrapper: adapt for LLVM API change

This adapts RustWrapper's ` LLVMRustInlineAsmVerify` for LLVM commit llvm/llvm-project@00797b8.
  • Loading branch information
GuillaumeGomez authored Jul 13, 2022
2 parents 3eb8198 + a89d014 commit f290811
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,14 @@ LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,

extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
size_t ConstraintsLen) {
#if LLVM_VERSION_LT(15, 0)
return InlineAsm::Verify(unwrap<FunctionType>(Ty),
StringRef(Constraints, ConstraintsLen));
#else
// llvm::Error converts to true if it is an error.
return !llvm::errorToBool(InlineAsm::verify(
unwrap<FunctionType>(Ty), StringRef(Constraints, ConstraintsLen)));
#endif
}

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

0 comments on commit f290811

Please sign in to comment.