Merge add_handler into catch_switch
Some codegen backends may require all handlers to be immediately known
This commit is contained in:
parent
e9646fa76b
commit
7a164509d3
5 changed files with 18 additions and 20 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue