From: Anders Carlsson Date: Tue, 19 May 2009 18:50:41 +0000 (+0000) Subject: Pass the destination QualType to EmitStoreOfScalar. No functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4aa4664ec851573624a7a29c6c750fc1d5cc268;p=clang Pass the destination QualType to EmitStoreOfScalar. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72118 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 22a234fea9..10fc6d95c2 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1971,7 +1971,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI, EmitAggregateCopy(CurFn->arg_begin(), ReturnValue, RetTy); } else { EmitStoreOfScalar(Builder.CreateLoad(ReturnValue), CurFn->arg_begin(), - false); + false, RetTy); } break; @@ -2034,7 +2034,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, // Make a temporary alloca to pass the argument. Args.push_back(CreateTempAlloca(ConvertTypeForMem(I->second))); if (RV.isScalar()) - EmitStoreOfScalar(RV.getScalarVal(), Args.back(), false); + EmitStoreOfScalar(RV.getScalarVal(), Args.back(), false, I->second); else StoreComplexToAddr(RV.getComplexVal(), Args.back(), false); } else { @@ -2063,7 +2063,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, llvm::Value *SrcPtr; if (RV.isScalar()) { SrcPtr = CreateTempAlloca(ConvertTypeForMem(I->second), "coerce"); - EmitStoreOfScalar(RV.getScalarVal(), SrcPtr, false); + EmitStoreOfScalar(RV.getScalarVal(), SrcPtr, false, I->second); } else if (RV.isComplex()) { SrcPtr = CreateTempAlloca(ConvertTypeForMem(I->second), "coerce"); StoreComplexToAddr(RV.getComplexVal(), SrcPtr, false); diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index e0ceaf6a2a..d01e578ffc 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -343,7 +343,8 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { } if (!hasAggregateLLVMType(Init->getType())) { llvm::Value *V = EmitScalarExpr(Init); - EmitStoreOfScalar(V, Loc, D.getType().isVolatileQualified()); + EmitStoreOfScalar(V, Loc, D.getType().isVolatileQualified(), + D.getType()); } else if (Init->getType()->isAnyComplexType()) { EmitComplexExprIntoAddr(Init, Loc, D.getType().isVolatileQualified()); } else { @@ -466,7 +467,7 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) { DeclPtr->setName(Name.c_str()); // Store the initial value into the alloca. - EmitStoreOfScalar(Arg, DeclPtr, Ty.isVolatileQualified()); + EmitStoreOfScalar(Arg, DeclPtr, Ty.isVolatileQualified(), Ty); } else { // Otherwise, if this is an aggregate, just use the input pointer. DeclPtr = Arg; diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 212ce10bdd..24d885cec5 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -210,7 +210,7 @@ llvm::Value *CodeGenFunction::EmitLoadOfScalar(llvm::Value *Addr, bool Volatile, } void CodeGenFunction::EmitStoreOfScalar(llvm::Value *Value, llvm::Value *Addr, - bool Volatile) { + bool Volatile, QualType Ty) { // Handle stores of types which have different representations in memory and // as LLVM values. @@ -449,8 +449,8 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst, } assert(Src.isScalar() && "Can't emit an agg store with this method"); - EmitStoreOfScalar(Src.getScalarVal(), Dst.getAddress(), - Dst.isVolatileQualified()); + EmitStoreOfScalar(Src.getScalarVal(), Dst.getAddress(), + Dst.isVolatileQualified(), Ty); } void CodeGenFunction::EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 964f92123b..081e44f915 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -580,7 +580,7 @@ public: /// care to appropriately convert from the memory representation to /// the LLVM value representation. void EmitStoreOfScalar(llvm::Value *Value, llvm::Value *Addr, - bool Volatile); + bool Volatile, QualType Ty); /// EmitLoadOfLValue - Given an expression that represents a value lvalue, /// this method emits the address of the lvalue, then loads the result as an