diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-03-28 01:22:36 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-03-28 01:22:36 +0000 |
commit | ab3a852ae713189444dcbf75e70accf1e8c2b7f2 (patch) | |
tree | 11ea284e9000f600d757c6715283fbc7ba2116f4 /lib/CodeGen/CGExprComplex.cpp | |
parent | e5194ff24c224fa8ee83064dff73f62f745a4469 (diff) |
Change compound assignment operators to keep track of both the promoted
LHS type and the computation result type; this encodes information into
the AST which is otherwise non-obvious. Fix Sema to always come up with the
right answer for both of these types. Fix IRGen and the analyzer to
account for these changes. This fixes PR2601. The approach is inspired
by PR2601 comment 2.
Note that this changes real *= complex in CodeGen from a silent
miscompilation to an explicit error.
I'm not really sure that the analyzer changes are correct, or how to
test them... someone more familiar with the analyzer should check those
changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r-- | lib/CodeGen/CGExprComplex.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index 3e4410611c..3e28490f6f 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -419,7 +419,7 @@ EmitCompoundAssign(const CompoundAssignOperator *E, LValue LHSLV = CGF.EmitLValue(E->getLHS()); BinOpInfo OpInfo; - OpInfo.Ty = E->getComputationType(); + OpInfo.Ty = E->getComputationResultType(); // We know the LHS is a complex lvalue. OpInfo.LHS = EmitLoadOfComplex(LHSLV.getAddress(), LHSLV.isVolatileQualified()); |