diff options
author | John McCall <rjmccall@apple.com> | 2010-12-05 02:00:02 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-12-05 02:00:02 +0000 |
commit | a2342eb8574e4f5ef455424a02c24feb8ce8b2a1 (patch) | |
tree | 05648d6f71d06f249dff5f424f1b2e7239a8dc28 /clang/lib/CodeGen/CGExprScalar.cpp | |
parent | 77a11c6174d506f4adfb10a5e4d38606244dad69 (diff) | |
download | bcm5719-llvm-a2342eb8574e4f5ef455424a02c24feb8ce8b2a1.tar.gz bcm5719-llvm-a2342eb8574e4f5ef455424a02c24feb8ce8b2a1.zip |
Fix a bug in the emission of __real/__imag l-values on scalar operands.
Fix a bug in the emission of complex compound assignment l-values.
Introduce a method to emit an expression whose value isn't relevant.
Make that method evaluate its operand as an l-value if it is one.
Fixes our volatile compliance in C++.
llvm-svn: 120931
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index a65eae8f78a..d4bd170e8d1 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -1139,10 +1139,7 @@ Value *ScalarExprEmitter::EmitCastExpr(CastExpr *CE) { return Builder.CreatePtrToInt(Src, ConvertType(DestTy)); } case CK_ToVoid: { - if (!E->isRValue()) - CGF.EmitLValue(E); - else - CGF.EmitAnyExpr(E, AggValueSlot::ignored(), true); + CGF.EmitIgnoredExpr(E); return 0; } case CK_VectorSplat: { @@ -1464,7 +1461,7 @@ ScalarExprEmitter::VisitSizeOfAlignOfExpr(const SizeOfAlignOfExpr *E) { } else { // C99 6.5.3.4p2: If the argument is an expression of type // VLA, it is evaluated. - CGF.EmitAnyExpr(E->getArgumentExpr()); + CGF.EmitIgnoredExpr(E->getArgumentExpr()); } return CGF.GetVLASize(VAT); @@ -2308,7 +2305,7 @@ Value *ScalarExprEmitter::VisitBinLOr(const BinaryOperator *E) { } Value *ScalarExprEmitter::VisitBinComma(const BinaryOperator *E) { - CGF.EmitStmt(E->getLHS()); + CGF.EmitIgnoredExpr(E->getLHS()); CGF.EnsureInsertPoint(); return Visit(E->getRHS()); } @@ -2578,7 +2575,7 @@ LValue CodeGenFunction::EmitObjCIsaExpr(const ObjCIsaExpr *E) { } -LValue CodeGenFunction::EmitCompoundAssignOperatorLValue( +LValue CodeGenFunction::EmitCompoundAssignmentLValue( const CompoundAssignOperator *E) { ScalarExprEmitter Scalar(*this); Value *Result = 0; |