summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-06-12 01:40:06 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-06-12 01:40:06 +0000
commit0934e18b620ecaa6c7ec18ba5c4286b6122d6fb8 (patch)
treea1f15ff9df212287a84f31b2b9afe480c69af744 /lib/CodeGen/CGExprScalar.cpp
parent7a1b586a383622e3287a5f3d82736ec513032744 (diff)
downloadclang-0934e18b620ecaa6c7ec18ba5c4286b6122d6fb8.tar.gz
clang-0934e18b620ecaa6c7ec18ba5c4286b6122d6fb8.tar.bz2
clang-0934e18b620ecaa6c7ec18ba5c4286b6122d6fb8.tar.xz
Add support for complex compound assignments where the LHS is a scalar.
Fixes <rdar://problem/11224126> and PR12790. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183821 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--lib/CodeGen/CGExprScalar.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index 7fb8e87cbd..f055c67f0c 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -1931,15 +1931,8 @@ LValue ScalarExprEmitter::EmitCompoundAssignLValue(
QualType LHSTy = E->getLHS()->getType();
BinOpInfo OpInfo;
- if (E->getComputationResultType()->isAnyComplexType()) {
- // This needs to go through the complex expression emitter, but it's a tad
- // complicated to do that... I'm leaving it out for now. (Note that we do
- // actually need the imaginary part of the RHS for multiplication and
- // division.)
- CGF.ErrorUnsupported(E, "complex compound assignment");
- Result = llvm::UndefValue::get(CGF.ConvertType(E->getType()));
- return LValue();
- }
+ if (E->getComputationResultType()->isAnyComplexType())
+ return CGF.EmitScalarCompooundAssignWithComplex(E, Result);
// Emit the RHS first. __block variables need to have the rhs evaluated
// first, plus this should improve codegen a little.