]> granicus.if.org Git - clang/commit
Change compound assignment operators to keep track of both the promoted
authorEli Friedman <eli.friedman@gmail.com>
Sat, 28 Mar 2009 01:22:36 +0000 (01:22 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sat, 28 Mar 2009 01:22:36 +0000 (01:22 +0000)
commitab3a852ae713189444dcbf75e70accf1e8c2b7f2
tree11ea284e9000f600d757c6715283fbc7ba2116f4
parente5194ff24c224fa8ee83064dff73f62f745a4469
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
include/clang/AST/Expr.h
lib/AST/StmtDumper.cpp
lib/AST/StmtSerialization.cpp
lib/Analysis/GRExprEngine.cpp
lib/CodeGen/CGExprComplex.cpp
lib/CodeGen/CGExprScalar.cpp
lib/Sema/Sema.h
lib/Sema/SemaExpr.cpp
test/CodeGen/complex.c
test/CodeGen/compound-type.c [new file with mode: 0644]