@@ -3038,30 +3038,8 @@ static Address EmitX86_64VAArgFromMemory(CodeGenFunction &CGF,
30383038 return Address (Res, LTy, Align);
30393039}
30403040
3041- static RValue EmitMSABIVAArg (CodeGenFunction &CGF, Address VAListAddr,
3042- QualType Ty, AggValueSlot Slot,
3043- ASTContext &context) {
3044- // MS x64 ABI requirement: "Any argument that doesn't fit in 8 bytes, or is
3045- // not 1, 2, 4, or 8 bytes, must be passed by reference."
3046- uint64_t Width = context.getTypeSize (Ty);
3047- bool IsIndirect = Width > 64 || !llvm::isPowerOf2_64 (Width);
3048-
3049- return emitVoidPtrVAArg (CGF, VAListAddr, Ty, IsIndirect,
3050- CGF.getContext ().getTypeInfoInChars (Ty),
3051- CharUnits::fromQuantity (8 ),
3052- /* allowHigherAlign*/ false , Slot);
3053- }
3054-
30553041RValue X86_64ABIInfo::EmitVAArg (CodeGenFunction &CGF, Address VAListAddr,
30563042 QualType Ty, AggValueSlot Slot) const {
3057-
3058- // Emit MS ABI compliant va_list for X86_64 targets which use Microsoft CXX
3059- // ABI and CharPtrBuiltinVaList.
3060- if (CGF.getTarget ().getCXXABI ().isMicrosoft () &&
3061- CGF.getTarget ().getBuiltinVaListKind () ==
3062- clang::TargetInfo::CharPtrBuiltinVaList)
3063- return EmitMSABIVAArg (CGF, VAListAddr, Ty, Slot, getContext ());
3064-
30653043 // Assume that va_list type is correct; should be pointer to LLVM type:
30663044 // struct {
30673045 // i32 gp_offset;
@@ -3508,7 +3486,15 @@ void WinX86_64ABIInfo::computeInfo(CGFunctionInfo &FI) const {
35083486
35093487RValue WinX86_64ABIInfo::EmitVAArg (CodeGenFunction &CGF, Address VAListAddr,
35103488 QualType Ty, AggValueSlot Slot) const {
3511- return EmitMSABIVAArg (CGF, VAListAddr, Ty, Slot, getContext ());
3489+ // MS x64 ABI requirement: "Any argument that doesn't fit in 8 bytes, or is
3490+ // not 1, 2, 4, or 8 bytes, must be passed by reference."
3491+ uint64_t Width = getContext ().getTypeSize (Ty);
3492+ bool IsIndirect = Width > 64 || !llvm::isPowerOf2_64 (Width);
3493+
3494+ return emitVoidPtrVAArg (CGF, VAListAddr, Ty, IsIndirect,
3495+ CGF.getContext ().getTypeInfoInChars (Ty),
3496+ CharUnits::fromQuantity (8 ),
3497+ /* allowHigherAlign*/ false , Slot);
35123498}
35133499
35143500std::unique_ptr<TargetCodeGenInfo> CodeGen::createX86_32TargetCodeGenInfo (
0 commit comments