@@ -444,11 +444,23 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
444
444
self . block . end_with_switch ( None , value, default_block, & gcc_cases) ;
445
445
}
446
446
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 > {
448
457
// 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 ) ;
450
459
let condition = self . context . new_rvalue_from_int ( self . bool_type , 1 ) ;
451
460
self . llbb ( ) . end_with_conditional ( None , condition, then, catch) ;
461
+ if let Some ( _fn_abi) = fn_abi {
462
+ // TODO(bjorn3): Apply function attributes
463
+ }
452
464
call_site
453
465
}
454
466
@@ -1227,16 +1239,27 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
1227
1239
// TODO(antoyo)
1228
1240
}
1229
1241
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 > {
1231
1250
// FIXME(antoyo): remove when having a proper API.
1232
1251
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 ( ) {
1234
1253
self . function_call ( func, args, funclet)
1235
1254
}
1236
1255
else {
1237
1256
// If it's a not function that was defined, it's a function pointer.
1238
1257
self . function_ptr_call ( func, args, funclet)
1258
+ } ;
1259
+ if let Some ( _fn_abi) = fn_abi {
1260
+ // TODO(bjorn3): Apply function attributes
1239
1261
}
1262
+ call
1240
1263
}
1241
1264
1242
1265
fn zext ( & mut self , value : RValue < ' gcc > , dest_typ : Type < ' gcc > ) -> RValue < ' gcc > {
0 commit comments