зеркало из https://github.com/microsoft/clang-1.git
Move backend output out of destructor.
Don't free AST consumer when --disable-free is set. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59030 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
4c99263910
Коммит
d68ba0ee18
|
@ -89,9 +89,6 @@ namespace {
|
|||
CodeGenPasses(0), PerModulePasses(0), PerFunctionPasses(0) {}
|
||||
|
||||
~BackendConsumer() {
|
||||
// FIXME: Move out of destructor.
|
||||
EmitAssembly();
|
||||
|
||||
delete AsmOutStream;
|
||||
delete TheTargetData;
|
||||
delete ModuleProvider;
|
||||
|
@ -115,6 +112,11 @@ namespace {
|
|||
|
||||
virtual void HandleTranslationUnit(TranslationUnit& TU) {
|
||||
Gen->HandleTranslationUnit(TU);
|
||||
|
||||
EmitAssembly();
|
||||
// Force a flush here in case we never get released.
|
||||
if (AsmOutStream)
|
||||
AsmOutStream->flush();
|
||||
}
|
||||
|
||||
virtual void HandleTagDeclDefinition(TagDecl *D) {
|
||||
|
|
|
@ -1363,6 +1363,9 @@ static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF,
|
|||
// files.
|
||||
if (ClearSourceMgr)
|
||||
PP.getSourceManager().clearIDTables();
|
||||
|
||||
if (DisableFree)
|
||||
Consumer.take();
|
||||
}
|
||||
|
||||
static void ProcessSerializedFile(const std::string& InFile, Diagnostic& Diag,
|
||||
|
|
Загрузка…
Ссылка в новой задаче