diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-14 19:21:21 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-14 19:21:21 +0000 |
commit | 3c717b459b047987fd43566cb1d38971934b21aa (patch) | |
tree | 5f8adc6d8229554c100164b8b30303d32da27f03 /clang/lib | |
parent | b9a9273826c5560432f10aeef8531292ced51590 (diff) | |
download | bcm5719-llvm-3c717b459b047987fd43566cb1d38971934b21aa.tar.gz bcm5719-llvm-3c717b459b047987fd43566cb1d38971934b21aa.zip |
Delete temporary output files when an error occurs during PCH reading.
This reduces the spam make test leaves behind in /tmp. The assert isn't
particularly useful because it's not run with -disable-free (the default when
using the clang driver) but should cover all -cc1 tests.
llvm-svn: 165910
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 1 | ||||
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 24f38d428b0..c50a6514446 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -52,6 +52,7 @@ CompilerInstance::CompilerInstance() } CompilerInstance::~CompilerInstance() { + assert(OutputFiles.empty() && "Still output files in flight?"); } void CompilerInstance::setInvocation(CompilerInvocation *Value) { diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index ca8511247a3..c8e41def8e3 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -316,6 +316,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, if (HasBegunSourceFile) CI.getDiagnosticClient().EndSourceFile(); + CI.clearOutputFiles(/*EraseFiles=*/true); setCurrentInput(FrontendInputFile()); setCompilerInstance(0); return false; |