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,10 +1202,9 @@ 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(),
E = ClassDecl->prop_end(); I != E; ++I)
@ -1222,6 +1221,7 @@ void RewriteModernObjC::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) {
// Lastly, comment out the @end.
ReplaceText(ClassDecl->getAtEndRange().getBegin(), strlen("@end"),
"/* @end */");
}
}
Stmt *RewriteModernObjC::RewritePropertyOrImplicitSetter(PseudoObjectExpr *PseudoOp) {