forked from OSchip/llvm-project
Fix <rdar://problem/6370288> clang ObjC rewriter: Too many _objc_symtab, _OBJC_SYMBOLS
llvm-svn: 59301
This commit is contained in:
parent
be35ce953e
commit
2a2a41fa11
|
@ -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,6 +4129,7 @@ void RewriteObjC::HandleTranslationUnit(TranslationUnit& TU) {
|
|||
InsertText(SourceLocation::getFileLoc(MainFileID, 0),
|
||||
Preamble.c_str(), Preamble.size(), false);
|
||||
|
||||
if (ClassImplementation.size() || CategoryImplementation.size())
|
||||
RewriteImplementations();
|
||||
|
||||
// Get the buffer corresponding to MainFileID. If we haven't changed it, then
|
||||
|
@ -4143,12 +4142,13 @@ void RewriteObjC::HandleTranslationUnit(TranslationUnit& TU) {
|
|||
fprintf(stderr, "No changes\n");
|
||||
}
|
||||
|
||||
if (ClassImplementation.size() || CategoryImplementation.size()) {
|
||||
// Rewrite Objective-c meta data*
|
||||
std::string ResultStr;
|
||||
SynthesizeMetaDataIntoBuffer(ResultStr);
|
||||
|
||||
// Emit metadata.
|
||||
*OutFile << ResultStr;
|
||||
}
|
||||
OutFile->flush();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue