summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-08-24 19:07:16 +0000
committerSteve Naroff <snaroff@apple.com>2007-08-24 19:07:16 +0000
commitbe4c4d14c3514c0836d2a105e6a15d026f91afef (patch)
tree88f72f9e5f61b2e14e8bb6a67c069db10e3abb75 /llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
parent85e92ec6ffe0f524ea6b4c82293881806b15b0bd (diff)
downloadbcm5719-llvm-be4c4d14c3514c0836d2a105e6a15d026f91afef.tar.gz
bcm5719-llvm-be4c4d14c3514c0836d2a105e6a15d026f91afef.zip
Surpress ImplicitCastExprs for compound assignment expressions. For compound assignments,
it is o.k. for the LHS and RHS to have different types. Converting the type can cause errors like the one Chris noticed (below). This change required a fair number of diffs (since there is a lot of shared code between single and compound assignments). This makes the API's look a bit uglier, however I couldn't think of a better way to do it (without duplicating code). Fix the following (incorrect) error: int A; long long B; void foo() { A /= B; } $ clang ~/scalar.c -emit-llvm /Users/sabre/scalar.c:6:5: error: expression is not assignable A /= B; ~ ^ Now it works properly... [dylan:~/llvm/tools/clang] admin% cat compound.c int A; long long B; void foo() { A /= B; } [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang compound.c -parse-ast-dump Read top-level variable decl: 'A' Read top-level variable decl: 'B' void foo() (CompoundStmt 0x2605c40 (BinaryOperator 0x2605c20 'int' '/=' ComputeTy='long long' (DeclRefExpr 0x2605be0 'int' Decl='A' 0x2605a80) (DeclRefExpr 0x2605c00 'long long' Decl='B' 0x2605ab0))) llvm-svn: 41364
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud