diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-11-06 00:40:05 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-11-06 00:40:05 +0000 |
commit | 9b515cb0ec76b0f1b4af77e18630a453ef782e4f (patch) | |
tree | 66266709b98519eb99cd4dc78a335d4ec2704e17 /clang/lib/Driver/Compilation.cpp | |
parent | 34146d8ca7af16335e8e290f85d316ebc0a37902 (diff) | |
download | llvm-9b515cb0ec76b0f1b4af77e18630a453ef782e4f.zip llvm-9b515cb0ec76b0f1b4af77e18630a453ef782e4f.tar.gz llvm-9b515cb0ec76b0f1b4af77e18630a453ef782e4f.tar.bz2 |
Add the depfile as a result file so that it is deleted if we crash,
and prevent the diagnostic preprocessor run from writing a depfile.
llvm-svn: 143846
Diffstat (limited to 'clang/lib/Driver/Compilation.cpp')
-rw-r--r-- | clang/lib/Driver/Compilation.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index d02da95..42c8449 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -217,8 +217,12 @@ void Compilation::initCompilationForDiagnostics(void) { // Remove any user specified output. Claim any unclaimed arguments, so as // to avoid emitting warnings about unused args. - if (TranslatedArgs->hasArg(options::OPT_o)) - TranslatedArgs->eraseArg(options::OPT_o); + OptSpecifier OutputOpts[] = { options::OPT_o, options::OPT_MD, + options::OPT_MMD }; + for (unsigned i = 0; i != sizeof(OutputOpts)/sizeof(OutputOpts[0]); ++i) { + if (TranslatedArgs->hasArg(OutputOpts[i])) + TranslatedArgs->eraseArg(OutputOpts[i]); + } TranslatedArgs->ClaimAllArgs(); // Redirect stdout/stderr to /dev/null. |