aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-11-14 14:10:01 +0000
committerSteve Naroff <snaroff@apple.com>2008-11-14 14:10:01 +0000
commit0aab796da21bfc45381d3ce76c795710cb97acfc (patch)
tree9b0528e558071c9b11f0744ca2cc40718eb7dfb2
parentf2cad8633e46cce12fc3d77c0bd451ffd7264baf (diff)
Fix <rdar://problem/6370288> clang ObjC rewriter: Too many _objc_symtab, _OBJC_SYMBOLS
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59301 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Driver/RewriteObjC.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp
index 14971207a4..d4774467df 100644
--- a/Driver/RewriteObjC.cpp
+++ b/Driver/RewriteObjC.cpp
@@ -3076,8 +3076,6 @@ void RewriteObjC::RewriteImplementations() {
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 @@ void RewriteObjC::HandleTranslationUnit(TranslationUnit& TU) {
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 @@ void RewriteObjC::HandleTranslationUnit(TranslationUnit& TU) {
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();
}