@@ -455,7 +455,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
455455 }
456456
457457 #[ cfg( feature="master" ) ]
458- fn invoke ( & mut self , typ : Type < ' gcc > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , then : Block < ' gcc > , catch : Block < ' gcc > , _funclet : Option < & Funclet > ) -> RValue < ' gcc > {
458+ fn invoke ( & mut self , typ : Type < ' gcc > , fn_abi : Option < & FnAbi < ' tcx , Ty < ' tcx > > > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , then : Block < ' gcc > , catch : Block < ' gcc > , _funclet : Option < & Funclet > ) -> RValue < ' gcc > {
459459 let try_block = self . current_func ( ) . new_block ( "try" ) ;
460460
461461 let current_block = self . block . clone ( ) ;
@@ -483,10 +483,13 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
483483 }
484484
485485 #[ cfg( not( feature="master" ) ) ]
486- fn invoke ( & mut self , typ : Type < ' gcc > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , then : Block < ' gcc > , catch : Block < ' gcc > , _funclet : Option < & Funclet > ) -> RValue < ' gcc > {
487- let call_site = self . call ( typ, func, args, None ) ;
486+ fn invoke ( & mut self , typ : Type < ' gcc > , fn_abi : Option < & FnAbi < ' tcx , Ty < ' tcx > > > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , then : Block < ' gcc > , catch : Block < ' gcc > , _funclet : Option < & Funclet > ) -> RValue < ' gcc > {
487+ let call_site = self . call ( typ, None , func, args, None ) ;
488488 let condition = self . context . new_rvalue_from_int ( self . bool_type , 1 ) ;
489489 self . llbb ( ) . end_with_conditional ( None , condition, then, catch) ;
490+ if let Some ( _fn_abi) = fn_abi {
491+ // TODO(bjorn3): Apply function attributes
492+ }
490493 call_site
491494 }
492495
@@ -1359,16 +1362,27 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
13591362 // TODO(antoyo)
13601363 }
13611364
1362- fn call ( & mut self , _typ : Type < ' gcc > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , funclet : Option < & Funclet > ) -> RValue < ' gcc > {
1365+ fn call (
1366+ & mut self ,
1367+ _typ : Type < ' gcc > ,
1368+ fn_abi : Option < & FnAbi < ' tcx , Ty < ' tcx > > > ,
1369+ func : RValue < ' gcc > ,
1370+ args : & [ RValue < ' gcc > ] ,
1371+ funclet : Option < & Funclet > ,
1372+ ) -> RValue < ' gcc > {
13631373 // FIXME(antoyo): remove when having a proper API.
13641374 let gcc_func = unsafe { std:: mem:: transmute ( func) } ;
1365- if self . functions . borrow ( ) . values ( ) . find ( |value| * * value == gcc_func) . is_some ( ) {
1375+ let call = if self . functions . borrow ( ) . values ( ) . find ( |value| * * value == gcc_func) . is_some ( ) {
13661376 self . function_call ( func, args, funclet)
13671377 }
13681378 else {
13691379 // If it's a not function that was defined, it's a function pointer.
13701380 self . function_ptr_call ( func, args, funclet)
1381+ } ;
1382+ if let Some ( _fn_abi) = fn_abi {
1383+ // TODO(bjorn3): Apply function attributes
13711384 }
1385+ call
13721386 }
13731387
13741388 fn zext ( & mut self , value : RValue < ' gcc > , dest_typ : Type < ' gcc > ) -> RValue < ' gcc > {
0 commit comments