@@ -444,11 +444,23 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
444444 self . block . end_with_switch ( None , value, default_block, & gcc_cases) ;
445445 }
446446
447- fn invoke ( & mut self , typ : Type < ' gcc > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , then : Block < ' gcc > , catch : Block < ' gcc > , _funclet : Option < & Funclet > ) -> RValue < ' gcc > {
447+ fn invoke (
448+ & mut self ,
449+ typ : Type < ' gcc > ,
450+ fn_abi : Option < & FnAbi < ' tcx , Ty < ' tcx > > > ,
451+ func : RValue < ' gcc > ,
452+ args : & [ RValue < ' gcc > ] ,
453+ then : Block < ' gcc > ,
454+ catch : Block < ' gcc > ,
455+ _funclet : Option < & Funclet > ,
456+ ) -> RValue < ' gcc > {
448457 // TODO(bjorn3): Properly implement unwinding.
449- let call_site = self . call ( typ, func, args, None ) ;
458+ let call_site = self . call ( typ, None , func, args, None ) ;
450459 let condition = self . context . new_rvalue_from_int ( self . bool_type , 1 ) ;
451460 self . llbb ( ) . end_with_conditional ( None , condition, then, catch) ;
461+ if let Some ( _fn_abi) = fn_abi {
462+ // TODO(bjorn3): Apply function attributes
463+ }
452464 call_site
453465 }
454466
@@ -1227,16 +1239,27 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
12271239 // TODO(antoyo)
12281240 }
12291241
1230- fn call ( & mut self , _typ : Type < ' gcc > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , funclet : Option < & Funclet > ) -> RValue < ' gcc > {
1242+ fn call (
1243+ & mut self ,
1244+ _typ : Type < ' gcc > ,
1245+ fn_abi : Option < & FnAbi < ' tcx , Ty < ' tcx > > > ,
1246+ func : RValue < ' gcc > ,
1247+ args : & [ RValue < ' gcc > ] ,
1248+ funclet : Option < & Funclet > ,
1249+ ) -> RValue < ' gcc > {
12311250 // FIXME(antoyo): remove when having a proper API.
12321251 let gcc_func = unsafe { std:: mem:: transmute ( func) } ;
1233- if self . functions . borrow ( ) . values ( ) . find ( |value| * * value == gcc_func) . is_some ( ) {
1252+ let call = if self . functions . borrow ( ) . values ( ) . find ( |value| * * value == gcc_func) . is_some ( ) {
12341253 self . function_call ( func, args, funclet)
12351254 }
12361255 else {
12371256 // If it's a not function that was defined, it's a function pointer.
12381257 self . function_ptr_call ( func, args, funclet)
1258+ } ;
1259+ if let Some ( _fn_abi) = fn_abi {
1260+ // TODO(bjorn3): Apply function attributes
12391261 }
1262+ call
12401263 }
12411264
12421265 fn zext ( & mut self , value : RValue < ' gcc > , dest_typ : Type < ' gcc > ) -> RValue < ' gcc > {
0 commit comments