diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-11-09 17:41:43 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-11-09 17:41:43 +0000 |
commit | 108fb14563f60f895481e2236bfdcea10d1536fb (patch) | |
tree | c96f25d1466c90f17fa9a5e0ed7dd5885711a5ad /lib/Rewrite/RewriteObjC.cpp | |
parent | f3fb5c5395d382ffd24ec2675237fa9bdff6266e (diff) |
objc rewriter: use a more specific name for local variable used
in fast enumeration rewrite. // rdar://10415026
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r-- | lib/Rewrite/RewriteObjC.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index 428418a09d..372e750132 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -1539,7 +1539,7 @@ Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) { /// sel_registerName( /// "countByEnumeratingWithState:objects:count:"), /// &enumState, -/// (id *)items, (unsigned int)16) +/// (id *)__rw_items, (unsigned int)16) /// void RewriteObjC::SynthCountByEnumWithState(std::string &buf) { buf += "((unsigned int (*) (id, SEL, struct __objcFastEnumerationState *, " @@ -1549,7 +1549,7 @@ void RewriteObjC::SynthCountByEnumWithState(std::string &buf) { buf += "sel_registerName(\"countByEnumeratingWithState:objects:count:\"),"; buf += "\n\t\t"; buf += "&enumState, " - "(id *)items, (unsigned int)16)"; + "(id *)__rw_items, (unsigned int)16)"; } /// RewriteBreakStmt - Rewrite for a break-stmt inside an ObjC2's foreach @@ -1594,10 +1594,10 @@ Stmt *RewriteObjC::RewriteContinueStmt(ContinueStmt *S) { /// { /// type elem; /// struct __objcFastEnumerationState enumState = { 0 }; -/// id items[16]; +/// id __rw_items[16]; /// id l_collection = (id)collection; /// unsigned long limit = [l_collection countByEnumeratingWithState:&enumState -/// objects:items count:16]; +/// objects:__rw_items count:16]; /// if (limit) { /// unsigned long startMutations = *enumState.mutationsPtr; /// do { @@ -1610,7 +1610,7 @@ Stmt *RewriteObjC::RewriteContinueStmt(ContinueStmt *S) { /// __continue_label: ; /// } while (counter < limit); /// } while (limit = [l_collection countByEnumeratingWithState:&enumState -/// objects:items count:16]); +/// objects:__rw_items count:16]); /// elem = nil; /// __break_label: ; /// } @@ -1662,8 +1662,8 @@ Stmt *RewriteObjC::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S, // struct __objcFastEnumerationState enumState = { 0 }; buf += "struct __objcFastEnumerationState enumState = { 0 };\n\t"; - // id items[16]; - buf += "id items[16];\n\t"; + // id __rw_items[16]; + buf += "id __rw_items[16];\n\t"; // id l_collection = (id) buf += "id l_collection = (id)"; // Find start location of 'collection' the hard way! @@ -1688,7 +1688,7 @@ Stmt *RewriteObjC::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S, buf = ";\n\t"; // unsigned long limit = [l_collection countByEnumeratingWithState:&enumState - // objects:items count:16]; + // objects:__rw_items count:16]; // which is synthesized into: // unsigned int limit = // ((unsigned int (*) @@ -1697,7 +1697,7 @@ Stmt *RewriteObjC::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S, // sel_registerName( // "countByEnumeratingWithState:objects:count:"), // (struct __objcFastEnumerationState *)&state, - // (id *)items, (unsigned int)16); + // (id *)__rw_items, (unsigned int)16); buf += "unsigned long limit =\n\t\t"; SynthCountByEnumWithState(buf); buf += ";\n\t"; @@ -1726,7 +1726,7 @@ Stmt *RewriteObjC::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S, /// __continue_label: ; /// } while (counter < limit); /// } while (limit = [l_collection countByEnumeratingWithState:&enumState - /// objects:items count:16]); + /// objects:__rw_items count:16]); /// elem = nil; /// __break_label: ; /// } |