summaryrefslogtreecommitdiffstats
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
commit2a2a41fa116552016019047daafd18ad7393285f (patch)
tree67019f8b127ccb6eaef22c0d88b3a55c5b70f583
parentbe35ce953efafdc0975ac18b8048471ca9ce1878 (diff)
downloadbcm5719-llvm-2a2a41fa116552016019047daafd18ad7393285f.tar.gz
bcm5719-llvm-2a2a41fa116552016019047daafd18ad7393285f.zip
Fix <rdar://problem/6370288> clang ObjC rewriter: Too many _objc_symtab, _OBJC_SYMBOLS
llvm-svn: 59301
-rw-r--r--clang/Driver/RewriteObjC.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/Driver/RewriteObjC.cpp b/clang/Driver/RewriteObjC.cpp
index 14971207a47..d4774467df0 100644
--- a/clang/Driver/RewriteObjC.cpp
+++ b/clang/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();
}
OpenPOWER on IntegriCloud