@@ -435,12 +435,12 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
435
435
self . block . end_with_switch ( None , value, default_block, & gcc_cases) ;
436
436
}
437
437
438
- fn invoke ( & mut self , _typ : Type < ' gcc > , _func : RValue < ' gcc > , _args : & [ RValue < ' gcc > ] , then : Block < ' gcc > , catch : Block < ' gcc > , _funclet : Option < & Funclet > ) -> RValue < ' gcc > {
439
- let condition = self . context . new_rvalue_from_int ( self . bool_type , 0 ) ;
438
+ fn invoke ( & mut self , typ : Type < ' gcc > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , then : Block < ' gcc > , catch : Block < ' gcc > , _funclet : Option < & Funclet > ) -> RValue < ' gcc > {
439
+ // TODO(bjorn3): Properly implement unwinding.
440
+ let call_site = self . call ( typ, func, args, None ) ;
441
+ let condition = self . context . new_rvalue_from_int ( self . bool_type , 1 ) ;
440
442
self . llbb ( ) . end_with_conditional ( None , condition, then, catch) ;
441
- self . context . new_rvalue_from_int ( self . int_type , 0 )
442
-
443
- // TODO(antoyo)
443
+ call_site
444
444
}
445
445
446
446
fn unreachable ( & mut self ) {
@@ -1106,7 +1106,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
1106
1106
}
1107
1107
1108
1108
fn cleanup_landing_pad ( & mut self , _ty : Type < ' gcc > , _pers_fn : RValue < ' gcc > ) -> RValue < ' gcc > {
1109
- let field1 = self . context . new_field ( None , self . u8_type , "landing_pad_field_1" ) ;
1109
+ let field1 = self . context . new_field ( None , self . u8_type . make_pointer ( ) , "landing_pad_field_1" ) ;
1110
1110
let field2 = self . context . new_field ( None , self . i32_type , "landing_pad_field_1" ) ;
1111
1111
let struct_type = self . context . new_struct_type ( None , "landing_pad" , & [ field1, field2] ) ;
1112
1112
self . current_func ( ) . new_local ( None , struct_type. as_type ( ) , "landing_pad" )
@@ -1117,7 +1117,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
1117
1117
}
1118
1118
1119
1119
fn resume ( & mut self , _exn : RValue < ' gcc > ) {
1120
- unimplemented ! ( ) ;
1120
+ // TODO(bjorn3): Properly implement unwinding.
1121
+ self . unreachable ( ) ;
1121
1122
}
1122
1123
1123
1124
fn cleanup_pad ( & mut self , _parent : Option < RValue < ' gcc > > , _args : & [ RValue < ' gcc > ] ) -> Funclet {
0 commit comments