summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-04 03:47:34 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-04 03:47:34 +0000
commit34376a68c414ccf372e9d83f3251ecb08eb055f2 (patch)
tree336b12526893f3694b8cb5654fef621818daca81 /clang/lib/Parse/ParseStmt.cpp
parent1c8ac8f027d4a7af830e91513f37a2139c684f19 (diff)
downloadbcm5719-llvm-34376a68c414ccf372e9d83f3251ecb08eb055f2.tar.gz
bcm5719-llvm-34376a68c414ccf372e9d83f3251ecb08eb055f2.zip
Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r--clang/lib/Parse/ParseStmt.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 4d737b73704..29779070bee 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -1032,13 +1032,19 @@ StmtResult Parser::ParseForStatement(AttributeList *Attr) {
} else {
Value = ParseExpression();
+ ForEach = isTokIdentifier_in();
+
// Turn the expression into a stmt.
- if (!Value.isInvalid())
- FirstPart = Actions.ActOnExprStmt(Actions.MakeFullExpr(Value.get()));
+ if (!Value.isInvalid()) {
+ if (ForEach)
+ FirstPart = Actions.ActOnForEachLValueExpr(Value.get());
+ else
+ FirstPart = Actions.ActOnExprStmt(Actions.MakeFullExpr(Value.get()));
+ }
if (Tok.is(tok::semi)) {
ConsumeToken();
- } else if ((ForEach = isTokIdentifier_in())) {
+ } else if (ForEach) {
ConsumeToken(); // consume 'in'
if (Tok.is(tok::code_completion)) {
OpenPOWER on IntegriCloud