diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/CodeGen/Targets/Mips.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/CodeGen/Targets/Mips.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/contrib/llvm-project/clang/lib/CodeGen/Targets/Mips.cpp b/contrib/llvm-project/clang/lib/CodeGen/Targets/Mips.cpp index 8f11c63dcd85..06d9b6d4a576 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/Targets/Mips.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/Targets/Mips.cpp @@ -34,8 +34,8 @@ public: ABIArgInfo classifyReturnType(QualType RetTy) const; ABIArgInfo classifyArgumentType(QualType RetTy, uint64_t &Offset) const; void computeInfo(CGFunctionInfo &FI) const override; - Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, - QualType Ty) const override; + RValue EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty, + AggValueSlot Slot) const override; ABIArgInfo extendType(QualType Ty) const; }; @@ -346,8 +346,8 @@ void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const { I.info = classifyArgumentType(I.type, Offset); } -Address MipsABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, - QualType OrigTy) const { +RValue MipsABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, + QualType OrigTy, AggValueSlot Slot) const { QualType Ty = OrigTy; // Integer arguments are promoted to 32-bit on O32 and 64-bit on N32/N64. @@ -373,28 +373,25 @@ Address MipsABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, // MinABIStackAlignInBytes is the size of argument slots on the stack. CharUnits ArgSlotSize = CharUnits::fromQuantity(MinABIStackAlignInBytes); - Address Addr = emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, - TyInfo, ArgSlotSize, /*AllowHigherAlign*/ true); + RValue Res = emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, TyInfo, + ArgSlotSize, /*AllowHigherAlign*/ true, Slot); - - // If there was a promotion, "unpromote" into a temporary. + // If there was a promotion, "unpromote". // TODO: can we just use a pointer into a subset of the original slot? if (DidPromote) { - Address Temp = CGF.CreateMemTemp(OrigTy, "vaarg.promotion-temp"); - llvm::Value *Promoted = CGF.Builder.CreateLoad(Addr); + llvm::Type *ValTy = CGF.ConvertType(OrigTy); + llvm::Value *Promoted = Res.getScalarVal(); // Truncate down to the right width. - llvm::Type *IntTy = (OrigTy->isIntegerType() ? Temp.getElementType() - : CGF.IntPtrTy); + llvm::Type *IntTy = (OrigTy->isIntegerType() ? ValTy : CGF.IntPtrTy); llvm::Value *V = CGF.Builder.CreateTrunc(Promoted, IntTy); if (OrigTy->isPointerType()) - V = CGF.Builder.CreateIntToPtr(V, Temp.getElementType()); + V = CGF.Builder.CreateIntToPtr(V, ValTy); - CGF.Builder.CreateStore(V, Temp); - Addr = Temp; + return RValue::get(V); } - return Addr; + return Res; } ABIArgInfo MipsABIInfo::extendType(QualType Ty) const { |