Set personality with LLVMSetPersonalityFn

This commit is contained in:
Tomasz Miąsko 2021-07-07 00:00:00 +00:00
parent a84d1b21ae
commit ae33a9714e
2 changed files with 6 additions and 2 deletions

View File

@ -937,8 +937,12 @@ fn landing_pad(
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)
}
}

View File

@ -1165,7 +1165,7 @@ pub fn LLVMRustBuildInvoke(
pub fn LLVMBuildLandingPad(
B: &Builder<'a>,
Ty: &'a Type,
PersFn: &'a Value,
PersFn: Option<&'a Value>,
NumClauses: c_uint,
Name: *const c_char,
) -> &'a Value;