Set personality with LLVMSetPersonalityFn
This commit is contained in:
@@ -937,8 +937,12 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
|
||||
pers_fn: &'ll Value,
|
||||
num_clauses: usize,
|
||||
) -> &'ll Value {
|
||||
// Use LLVMSetPersonalityFn to set the personality. It supports arbitrary Consts while,
|
||||
// LLVMBuildLandingPad requires the argument to be a Function (as of LLVM 12). The
|
||||
// personality lives on the parent function anyway.
|
||||
self.set_personality_fn(pers_fn);
|
||||
unsafe {
|
||||
llvm::LLVMBuildLandingPad(self.llbuilder, ty, pers_fn, num_clauses as c_uint, UNNAMED)
|
||||
llvm::LLVMBuildLandingPad(self.llbuilder, ty, None, num_clauses as c_uint, UNNAMED)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user