@@ -344,18 +344,18 @@ impl ArgAbiMethods<'tcx> for Builder<'a, 'll, 'tcx> {
344
344
}
345
345
346
346
pub trait FnAbiLlvmExt < ' tcx > {
347
- fn llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > , decl : bool ) -> & ' ll Type ;
347
+ fn llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type ;
348
348
fn ptr_to_llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type ;
349
349
fn llvm_cconv ( & self ) -> llvm:: CallConv ;
350
350
fn apply_attrs_llfn ( & self , cx : & CodegenCx < ' ll , ' tcx > , llfn : & ' ll Value ) ;
351
351
fn apply_attrs_callsite ( & self , bx : & mut Builder < ' a , ' ll , ' tcx > , callsite : & ' ll Value ) ;
352
352
}
353
353
354
354
impl < ' tcx > FnAbiLlvmExt < ' tcx > for FnAbi < ' tcx , Ty < ' tcx > > {
355
- fn llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > , decl : bool ) -> & ' ll Type {
356
- // Ignore extra args when calling C variadic functions.
357
- let args =
358
- if decl && self . c_variadic { & self . args [ ..self . fixed_count ] } else { & self . args } ;
355
+ fn llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type {
356
+ // Ignore " extra" args from the call site for C variadic functions.
357
+ // Only the "fixed" args are part of the LLVM function signature.
358
+ let args = if self . c_variadic { & self . args [ ..self . fixed_count ] } else { & self . args } ;
359
359
360
360
let args_capacity: usize = args. iter ( ) . map ( |arg|
361
361
if arg. pad . is_some ( ) { 1 } else { 0 } +
@@ -414,7 +414,7 @@ impl<'tcx> FnAbiLlvmExt<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
414
414
fn ptr_to_llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type {
415
415
unsafe {
416
416
llvm:: LLVMPointerType (
417
- self . llvm_type ( cx, false ) ,
417
+ self . llvm_type ( cx) ,
418
418
cx. data_layout ( ) . instruction_address_space . 0 as c_uint ,
419
419
)
420
420
}
0 commit comments