diff options
| author | John McCall <rjmccall@apple.com> | 2011-06-25 02:11:03 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2011-06-25 02:11:03 +0000 |
| commit | 55e1fbc848c0d2f3660251a9b6ef19beff512ac8 (patch) | |
| tree | 02dc96d6f2b1cfb27dc2fe4c014560a319807cec /clang/lib/CodeGen/CGDecl.cpp | |
| parent | 8ca6622e9aff0e8c4296f0bb5187e659725dfa52 (diff) | |
| download | bcm5719-llvm-55e1fbc848c0d2f3660251a9b6ef19beff512ac8.tar.gz bcm5719-llvm-55e1fbc848c0d2f3660251a9b6ef19beff512ac8.zip | |
LValue carries a type now, so simplify the main EmitLoad/Store APIs
by removing the redundant type parameter.
llvm-svn: 133860
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 7e126d95e18..68b1d3be668 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/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]; |

