1
Fork 0

Merge add_handler into catch_switch

Some codegen backends may require all handlers to be immediately known
This commit is contained in:
bjorn3 2022-01-24 13:50:12 +01:00
parent e9646fa76b
commit 7a164509d3
5 changed files with 18 additions and 20 deletions

View file

@ -1346,8 +1346,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let mut cp_bx = self.new_block(&format!("cp_funclet{:?}", bb));
ret_llbb = cs_bx.llbb();
let cs = cs_bx.catch_switch(None, None, 1);
cs_bx.add_handler(cs, cp_bx.llbb());
let cs = cs_bx.catch_switch(None, None, &[cp_bx.llbb()]);
// The "null" here is actually a RTTI type descriptor for the
// C++ personality function, but `catch (...)` has no type so

View file

@ -441,9 +441,8 @@ pub trait BuilderMethods<'a, 'tcx>:
&mut self,
parent: Option<Self::Value>,
unwind: Option<Self::BasicBlock>,
num_handlers: usize,
handlers: &[Self::BasicBlock],
) -> Self::Value;
fn add_handler(&mut self, catch_switch: Self::Value, handler: Self::BasicBlock);
fn atomic_cmpxchg(
&mut self,