summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-01-08 01:29:44 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-01-08 01:29:44 +0000
commit39d70940e422cf7cfadd9a8eb454616cfef9fa18 (patch)
tree0742612d127afdaf9c6a4f299bdb9778baad2ce6 /clang/lib/Frontend/RewriteObjC.cpp
parentb92f263ceb0177e10ac6cd511029063774fdb06d (diff)
downloadbcm5719-llvm-39d70940e422cf7cfadd9a8eb454616cfef9fa18.tar.gz
bcm5719-llvm-39d70940e422cf7cfadd9a8eb454616cfef9fa18.zip
clang ObjC rewriter: generated code used in "for (x in y)" loop uses
incorrect cast, causing compile error (fixes radar 7342867). llvm-svn: 92986
Diffstat (limited to 'clang/lib/Frontend/RewriteObjC.cpp')
-rw-r--r--clang/lib/Frontend/RewriteObjC.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp
index 4245856efa5..ee803a33e3a 100644
--- a/clang/lib/Frontend/RewriteObjC.cpp
+++ b/clang/lib/Frontend/RewriteObjC.cpp
@@ -1483,14 +1483,18 @@ Stmt *RewriteObjC::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S,
SynthCountByEnumWithState(buf);
buf += ");\n\t";
buf += elementName;
- buf += " = ((id)0);\n\t";
+ buf += " = ((";
+ buf += elementTypeAsString;
+ buf += ")0);\n\t";
buf += "__break_label_";
buf += utostr(ObjCBcLabelNo.back());
buf += ": ;\n\t";
buf += "}\n\t";
buf += "else\n\t\t";
buf += elementName;
- buf += " = ((id)0);\n";
+ buf += " = ((";
+ buf += elementTypeAsString;
+ buf += ")0);\n\t";
buf += "}\n";
// Insert all these *after* the statement body.
OpenPOWER on IntegriCloud