@@ -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
@@ -643,11 +655,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
643655 self . current_func ( ) . new_local ( None , aligned_type, & format ! ( "stack_var_{}" , self . stack_var_count. get( ) ) ) . get_address ( None )
644656 }
645657
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 > {
651659 unimplemented ! ( ) ;
652660 }
653661
@@ -1227,16 +1235,27 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
12271235 // TODO(antoyo)
12281236 }
12291237
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 > {
12311246 // FIXME(antoyo): remove when having a proper API.
12321247 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 ( ) {
12341249 self . function_call ( func, args, funclet)
12351250 }
12361251 else {
12371252 // If it's a not function that was defined, it's a function pointer.
12381253 self . function_ptr_call ( func, args, funclet)
1254+ } ;
1255+ if let Some ( _fn_abi) = fn_abi {
1256+ // TODO(bjorn3): Apply function attributes
12391257 }
1258+ call
12401259 }
12411260
12421261 fn zext ( & mut self , value : RValue < ' gcc > , dest_typ : Type < ' gcc > ) -> RValue < ' gcc > {
0 commit comments