[cfe-commits] r59301 - /cfe/trunk/Driver/RewriteObjC.cpp
Steve Naroff
snaroff at apple.com
Fri Nov 14 06:10:05 PST 2008
Author: snaroff
Date: Fri Nov 14 08:10:01 2008
New Revision: 59301
URL: http://llvm.org/viewvc/llvm-project?rev=59301&view=rev
Log:
Fix <rdar://problem/6370288> clang ObjC rewriter: Too many _objc_symtab, _OBJC_SYMBOLS
Modified:
cfe/trunk/Driver/RewriteObjC.cpp
Modified: cfe/trunk/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteObjC.cpp?rev=59301&r1=59300&r2=59301&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteObjC.cpp (original)
+++ cfe/trunk/Driver/RewriteObjC.cpp Fri Nov 14 08:10:01 2008
@@ -3076,8 +3076,6 @@
int ClsDefCount = ClassImplementation.size();
int CatDefCount = CategoryImplementation.size();
- if (ClsDefCount == 0 && CatDefCount == 0)
- return;
// Rewrite implemented methods
for (int i = 0; i < ClsDefCount; i++)
RewriteImplementationDecl(ClassImplementation[i]);
@@ -4131,7 +4129,8 @@
InsertText(SourceLocation::getFileLoc(MainFileID, 0),
Preamble.c_str(), Preamble.size(), false);
- RewriteImplementations();
+ if (ClassImplementation.size() || CategoryImplementation.size())
+ RewriteImplementations();
// Get the buffer corresponding to MainFileID. If we haven't changed it, then
// we are done.
@@ -4143,12 +4142,13 @@
fprintf(stderr, "No changes\n");
}
- // Rewrite Objective-c meta data*
- std::string ResultStr;
- SynthesizeMetaDataIntoBuffer(ResultStr);
-
- // Emit metadata.
- *OutFile << ResultStr;
+ if (ClassImplementation.size() || CategoryImplementation.size()) {
+ // Rewrite Objective-c meta data*
+ std::string ResultStr;
+ SynthesizeMetaDataIntoBuffer(ResultStr);
+ // Emit metadata.
+ *OutFile << ResultStr;
+ }
OutFile->flush();
}
More information about the cfe-commits
mailing list