@@ -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
@@ -643,11 +655,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
643
655
self . current_func ( ) . new_local ( None , aligned_type, & format ! ( "stack_var_{}" , self . stack_var_count. get( ) ) ) . get_address ( None )
644
656
}
645
657
646
- fn dynamic_alloca ( & mut self , _ty : Type < ' gcc > , _align : Align ) -> RValue < ' gcc > {
647
- unimplemented ! ( ) ;
648
- }
649
-
650
- fn array_alloca ( & mut self , _ty : Type < ' gcc > , _len : RValue < ' gcc > , _align : Align ) -> RValue < ' gcc > {
658
+ fn byte_array_alloca ( & mut self , _len : RValue < ' gcc > , _align : Align ) -> RValue < ' gcc > {
651
659
unimplemented ! ( ) ;
652
660
}
653
661
@@ -1227,16 +1235,27 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
1227
1235
// TODO(antoyo)
1228
1236
}
1229
1237
1230
- fn call ( & mut self , _typ : Type < ' gcc > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , funclet : Option < & Funclet > ) -> RValue < ' gcc > {
1238
+ fn call (
1239
+ & mut self ,
1240
+ _typ : Type < ' gcc > ,
1241
+ fn_abi : Option < & FnAbi < ' tcx , Ty < ' tcx > > > ,
1242
+ func : RValue < ' gcc > ,
1243
+ args : & [ RValue < ' gcc > ] ,
1244
+ funclet : Option < & Funclet > ,
1245
+ ) -> RValue < ' gcc > {
1231
1246
// FIXME(antoyo): remove when having a proper API.
1232
1247
let gcc_func = unsafe { std:: mem:: transmute ( func) } ;
1233
- if self . functions . borrow ( ) . values ( ) . find ( |value| * * value == gcc_func) . is_some ( ) {
1248
+ let call = if self . functions . borrow ( ) . values ( ) . find ( |value| * * value == gcc_func) . is_some ( ) {
1234
1249
self . function_call ( func, args, funclet)
1235
1250
}
1236
1251
else {
1237
1252
// If it's a not function that was defined, it's a function pointer.
1238
1253
self . function_ptr_call ( func, args, funclet)
1254
+ } ;
1255
+ if let Some ( _fn_abi) = fn_abi {
1256
+ // TODO(bjorn3): Apply function attributes
1239
1257
}
1258
+ call
1240
1259
}
1241
1260
1242
1261
fn zext ( & mut self , value : RValue < ' gcc > , dest_typ : Type < ' gcc > ) -> RValue < ' gcc > {
0 commit comments