@@ -344,18 +344,18 @@ impl ArgAbiMethods<'tcx> for Builder<'a, 'll, 'tcx> {
344344}
345345
346346pub 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 ;
348348 fn ptr_to_llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type ;
349349 fn llvm_cconv ( & self ) -> llvm:: CallConv ;
350350 fn apply_attrs_llfn ( & self , cx : & CodegenCx < ' ll , ' tcx > , llfn : & ' ll Value ) ;
351351 fn apply_attrs_callsite ( & self , bx : & mut Builder < ' a , ' ll , ' tcx > , callsite : & ' ll Value ) ;
352352}
353353
354354impl < ' 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 } ;
359359
360360 let args_capacity: usize = args. iter ( ) . map ( |arg|
361361 if arg. pad . is_some ( ) { 1 } else { 0 } +
@@ -414,7 +414,7 @@ impl<'tcx> FnAbiLlvmExt<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
414414 fn ptr_to_llvm_type ( & self , cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll Type {
415415 unsafe {
416416 llvm:: LLVMPointerType (
417- self . llvm_type ( cx, false ) ,
417+ self . llvm_type ( cx) ,
418418 cx. data_layout ( ) . instruction_address_space . 0 as c_uint ,
419419 )
420420 }
0 commit comments