From ab3a852ae713189444dcbf75e70accf1e8c2b7f2 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Sat, 28 Mar 2009 01:22:36 +0000 Subject: 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 --- lib/CodeGen/CGExprComplex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExprComplex.cpp') 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()); -- cgit v1.2.3