forked from OSchip/llvm-project
Pass the destination QualType to EmitStoreOfScalar. No functionality change.
llvm-svn: 72118
This commit is contained in:
parent
775640d248
commit
8370964257
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue