[cfe-commits] r144191 - /cfe/trunk/lib/Rewrite/RewriteObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Nov 9 09:41:43 PST 2011
Author: fjahanian
Date: Wed Nov 9 11:41:43 2011
New Revision: 144191
URL: http://llvm.org/viewvc/llvm-project?rev=144191&view=rev
Log:
objc rewriter: use a more specific name for local variable used
in fast enumeration rewrite. // rdar://10415026
Modified:
cfe/trunk/lib/Rewrite/RewriteObjC.cpp
Modified: cfe/trunk/lib/Rewrite/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteObjC.cpp?rev=144191&r1=144190&r2=144191&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteObjC.cpp Wed Nov 9 11:41:43 2011
@@ -1539,7 +1539,7 @@
/// 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 @@
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 @@
/// {
/// 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 @@
/// __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 @@
// 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 @@
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 @@
// 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 @@
/// __continue_label: ;
/// } while (counter < limit);
/// } while (limit = [l_collection countByEnumeratingWithState:&enumState
- /// objects:items count:16]);
+ /// objects:__rw_items count:16]);
/// elem = nil;
/// __break_label: ;
/// }
More information about the cfe-commits
mailing list