diff options
author | Chris Lattner <sabre@nondot.org> | 2010-08-18 00:08:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-08-18 00:08:27 +0000 |
commit | d7241c77d388f798c5db29848396109ea1aa83d2 (patch) | |
tree | 3a3b60037535de4c821e8def0741ce2449554b73 /lib/CodeGen/CGExpr.cpp | |
parent | 5c12c7bde7e39758fb127ac7089ac88097408e8e (diff) |
Fix PR7889 by generalizing some over specialized code. There is no
reason that this should be limited to simple lvalues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index e978870996..18ecf1719f 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1938,10 +1938,8 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { if (!hasAggregateLLVMType(E->getType())) { // Emit the LHS as an l-value. LValue LV = EmitLValue(E->getLHS()); - - llvm::Value *RHS = EmitScalarExpr(E->getRHS()); - EmitStoreOfScalar(RHS, LV.getAddress(), LV.isVolatileQualified(), - E->getType()); + // Sore the value through the l-value. + EmitStoreThroughLValue(EmitAnyExpr(E->getRHS()), LV, E->getType()); return LV; } |