@@ -455,7 +455,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
455
455
}
456
456
457
457
#[ 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 > {
459
459
let try_block = self . current_func ( ) . new_block ( "try" ) ;
460
460
461
461
let current_block = self . block . clone ( ) ;
@@ -483,10 +483,13 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
483
483
}
484
484
485
485
#[ 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 ) ;
488
488
let condition = self . context . new_rvalue_from_int ( self . bool_type , 1 ) ;
489
489
self . llbb ( ) . end_with_conditional ( None , condition, then, catch) ;
490
+ if let Some ( _fn_abi) = fn_abi {
491
+ // TODO(bjorn3): Apply function attributes
492
+ }
490
493
call_site
491
494
}
492
495
@@ -1359,16 +1362,27 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
1359
1362
// TODO(antoyo)
1360
1363
}
1361
1364
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 > {
1363
1373
// FIXME(antoyo): remove when having a proper API.
1364
1374
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 ( ) {
1366
1376
self . function_call ( func, args, funclet)
1367
1377
}
1368
1378
else {
1369
1379
// If it's a not function that was defined, it's a function pointer.
1370
1380
self . function_ptr_call ( func, args, funclet)
1381
+ } ;
1382
+ if let Some ( _fn_abi) = fn_abi {
1383
+ // TODO(bjorn3): Apply function attributes
1371
1384
}
1385
+ call
1372
1386
}
1373
1387
1374
1388
fn zext ( & mut self , value : RValue < ' gcc > , dest_typ : Type < ' gcc > ) -> RValue < ' gcc > {
0 commit comments