objective-c translator: fixes an obscure rewriting bug

which attempted to rewrite the same meta-data twice.

llvm-svn: 150618
This commit is contained in:
Fariborz Jahanian 2012-02-15 22:01:47 +00:00
parent 13f09b4191
commit ff51338772
1 changed files with 14 additions and 14 deletions

View File

@ -1202,26 +1202,26 @@ void RewriteModernObjC::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) {
ResultStr += "typedef struct objc_object ";
ResultStr += ClassDecl->getNameAsString();
ResultStr += ";\n#endif\n";
RewriteObjCInternalStruct(ClassDecl, ResultStr);
// Mark this typedef as having been generated.
ObjCForwardDecls.insert(ClassDecl->getCanonicalDecl());
}
RewriteObjCInternalStruct(ClassDecl, ResultStr);
for (ObjCInterfaceDecl::prop_iterator I = ClassDecl->prop_begin(),
for (ObjCInterfaceDecl::prop_iterator I = ClassDecl->prop_begin(),
E = ClassDecl->prop_end(); I != E; ++I)
RewriteProperty(*I);
for (ObjCInterfaceDecl::instmeth_iterator
RewriteProperty(*I);
for (ObjCInterfaceDecl::instmeth_iterator
I = ClassDecl->instmeth_begin(), E = ClassDecl->instmeth_end();
I != E; ++I)
RewriteMethodDeclaration(*I);
for (ObjCInterfaceDecl::classmeth_iterator
I != E; ++I)
RewriteMethodDeclaration(*I);
for (ObjCInterfaceDecl::classmeth_iterator
I = ClassDecl->classmeth_begin(), E = ClassDecl->classmeth_end();
I != E; ++I)
RewriteMethodDeclaration(*I);
I != E; ++I)
RewriteMethodDeclaration(*I);
// Lastly, comment out the @end.
ReplaceText(ClassDecl->getAtEndRange().getBegin(), strlen("@end"),
"/* @end */");
// Lastly, comment out the @end.
ReplaceText(ClassDecl->getAtEndRange().getBegin(), strlen("@end"),
"/* @end */");
}
}
Stmt *RewriteModernObjC::RewritePropertyOrImplicitSetter(PseudoObjectExpr *PseudoOp) {