summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-03-04 04:25:14 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-03-04 04:25:14 +0000
commit3efa41a47872f74d58aef330274855ae55e50599 (patch)
tree43c6f56a3acf993845ba06db9ff2793af558d395 /clang/lib/CodeGen/CGDecl.cpp
parent34a2209177d7c137d2fde410e2a27de4d5c5e78a (diff)
downloadbcm5719-llvm-3efa41a47872f74d58aef330274855ae55e50599.tar.gz
bcm5719-llvm-3efa41a47872f74d58aef330274855ae55e50599.zip
Continuation of PR3687: fix more places to use the right type for
booleans. llvm-svn: 66012
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 3a4ef953504..9cdb40b1218 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -232,7 +232,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
if (Ty->isConstantSizeType()) {
if (!Target.useGlobalsForAutomaticVariables()) {
// A normal fixed sized variable becomes an alloca in the entry block.
- const llvm::Type *LTy = ConvertType(Ty);
+ const llvm::Type *LTy = ConvertTypeForMem(Ty);
if (isByRef)
LTy = BuildByRefType(Ty, getContext().getDeclAlignInBytes(&D));
llvm::AllocaInst *Alloc =
@@ -278,7 +278,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
}
// Get the element type.
- const llvm::Type *LElemTy = ConvertType(Ty);
+ const llvm::Type *LElemTy = ConvertTypeForMem(Ty);
const llvm::Type *LElemPtrTy =
llvm::PointerType::get(LElemTy, D.getType().getAddressSpace());
@@ -318,7 +318,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
}
if (!hasAggregateLLVMType(Init->getType())) {
llvm::Value *V = EmitScalarExpr(Init);
- Builder.CreateStore(V, Loc, D.getType().isVolatileQualified());
+ EmitStoreOfScalar(V, Loc, D.getType().isVolatileQualified());
} else if (Init->getType()->isAnyComplexType()) {
EmitComplexExprIntoAddr(Init, Loc, D.getType().isVolatileQualified());
} else {
@@ -410,7 +410,7 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) {
llvm::GlobalValue::ExternalLinkage);
} else {
// A fixed sized single-value variable becomes an alloca in the entry block.
- const llvm::Type *LTy = ConvertType(Ty);
+ const llvm::Type *LTy = ConvertTypeForMem(Ty);
if (LTy->isSingleValueType()) {
// TODO: Alignment
std::string Name = D.getNameAsString();
@@ -418,7 +418,7 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) {
DeclPtr = CreateTempAlloca(LTy, Name.c_str());
// Store the initial value into the alloca.
- Builder.CreateStore(Arg, DeclPtr,Ty.isVolatileQualified());
+ EmitStoreOfScalar(Arg, DeclPtr, Ty.isVolatileQualified());
} else {
// Otherwise, if this is an aggregate, just use the input pointer.
DeclPtr = Arg;
OpenPOWER on IntegriCloud