forked from OSchip/llvm-project
Fixed a bug whereby a parethesized collection expression was not being rewritten correctly.
llvm-svn: 45776
This commit is contained in:
parent
4de0c3978d
commit
22f2347791
|
|
@ -854,7 +854,7 @@ Stmt *RewriteTest::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S) {
|
||||||
// Replace ')' in for '(' type elem in collection ')' with ';'
|
// Replace ')' in for '(' type elem in collection ')' with ';'
|
||||||
SourceLocation endCollectionLoc = S->getCollection()->getLocEnd();
|
SourceLocation endCollectionLoc = S->getCollection()->getLocEnd();
|
||||||
const char *endCollectionBuf = SM->getCharacterData(endCollectionLoc);
|
const char *endCollectionBuf = SM->getCharacterData(endCollectionLoc);
|
||||||
const char *lparenBuf = strchr(endCollectionBuf, ')');
|
const char *lparenBuf = strchr(endCollectionBuf+1, ')');
|
||||||
SourceLocation lparenLoc = startLoc.getFileLocWithOffset(lparenBuf-startBuf);
|
SourceLocation lparenLoc = startLoc.getFileLocWithOffset(lparenBuf-startBuf);
|
||||||
buf = ";\n\t";
|
buf = ";\n\t";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,14 @@ int LOOP();
|
||||||
{ LOOP(); }
|
{ LOOP(); }
|
||||||
for (id el1 in self)
|
for (id el1 in self)
|
||||||
LOOP();
|
LOOP();
|
||||||
|
|
||||||
|
for (el in (self))
|
||||||
|
if (el)
|
||||||
|
LOOP();
|
||||||
|
|
||||||
|
for (el in ((self)))
|
||||||
|
if (el)
|
||||||
|
LOOP();
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue