aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-06-25 02:11:03 +0000
committerJohn McCall <rjmccall@apple.com>2011-06-25 02:11:03 +0000
commit545d996ec5a3113f046944f11b27cc2d6cb055b4 (patch)
treee685c2dbd04eb819195efca9a0539719e02af5b5 /lib/CodeGen/CGDecl.cpp
parent913dab2525cc705e5238023a446f5371fa411883 (diff)
LValue carries a type now, so simplify the main EmitLoad/Store APIs
by removing the redundant type parameter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 7e126d95e1..68b1d3be66 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -482,7 +482,7 @@ void CodeGenFunction::EmitScalarInit(const Expr *init,
llvm::Value *value = EmitScalarExpr(init);
if (capturedByInit)
drillIntoBlockVariable(*this, lvalue, cast<VarDecl>(D));
- EmitStoreThroughLValue(RValue::get(value), lvalue, lvalue.getType());
+ EmitStoreThroughLValue(RValue::get(value), lvalue);
return;
}
@@ -579,7 +579,7 @@ void CodeGenFunction::EmitScalarInit(const Expr *init,
void CodeGenFunction::EmitScalarInit(llvm::Value *init, LValue lvalue) {
Qualifiers::ObjCLifetime lifetime = lvalue.getObjCLifetime();
if (!lifetime)
- return EmitStoreThroughLValue(RValue::get(init), lvalue, lvalue.getType());
+ return EmitStoreThroughLValue(RValue::get(init), lvalue);
switch (lifetime) {
case Qualifiers::OCL_None:
@@ -982,7 +982,7 @@ void CodeGenFunction::EmitExprAsInit(const Expr *init,
RValue rvalue = EmitReferenceBindingToExpr(init, D);
if (capturedByInit)
drillIntoBlockVariable(*this, lvalue, cast<VarDecl>(D));
- EmitStoreThroughLValue(rvalue, lvalue, type);
+ EmitStoreThroughLValue(rvalue, lvalue);
} else if (!hasAggregateLLVMType(type)) {
EmitScalarInit(init, D, lvalue, capturedByInit);
} else if (type->isAnyComplexType()) {
@@ -1163,10 +1163,11 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg,
}
// Store the initial value into the alloca.
- if (doStore)
- EmitStoreOfScalar(Arg, DeclPtr, Ty.isVolatileQualified(),
- getContext().getDeclAlign(&D).getQuantity(), Ty,
- CGM.getTBAAInfo(Ty));
+ if (doStore) {
+ LValue lv = MakeAddrLValue(DeclPtr, Ty,
+ getContext().getDeclAlign(&D).getQuantity());
+ EmitStoreOfScalar(Arg, lv);
+ }
}
llvm::Value *&DMEntry = LocalDeclMap[&D];