rustc_trans: Update LLVMBuildLandingPad signature
The C API of this function changed so it no longer takes a personality function. A shim was introduced to call the right LLVM function (depending on which version we're compiled against) to set the personality function on the outer function. The compiler only ever sets one personality function for all generated functions, so this should be equivalent.
This commit is contained in:
parent
c55d3f1ba1
commit
7f0e733f1d
4 changed files with 28 additions and 10 deletions
|
@ -942,3 +942,18 @@ extern "C" void LLVMWriteSMDiagnosticToString(LLVMSMDiagnosticRef d, RustStringR
|
|||
raw_rust_string_ostream os(str);
|
||||
unwrap(d)->print("", os);
|
||||
}
|
||||
|
||||
extern "C" LLVMValueRef
|
||||
LLVMRustBuildLandingPad(LLVMBuilderRef Builder,
|
||||
LLVMTypeRef Ty,
|
||||
LLVMValueRef PersFn,
|
||||
unsigned NumClauses,
|
||||
const char* Name,
|
||||
LLVMValueRef F) {
|
||||
#if LLVM_VERSION_MINOR >= 7
|
||||
unwrap<Function>(F)->setPersonalityFn(unwrap<Constant>(PersFn));
|
||||
return LLVMBuildLandingPad(Builder, Ty, NumClauses, Name);
|
||||
#else
|
||||
return LLVMBuildLandingPad(Builder, Ty, PersFn, NumClauses, Name);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue