From: Daniel Dunbar Date: Tue, 24 Mar 2009 17:49:01 +0000 (+0000) Subject: Driver: Result files shouldn't be removed on failure when -save-temps X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e3a224943163995d49c474f372c72ca91884780;p=clang Driver: Result files shouldn't be removed on failure when -save-temps is specified. - No easy way to make a safe test case for this (given where the driver is supposed to put temp files). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67632 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp index a2fc9212a5..2165bb7401 100644 --- a/lib/Driver/Compilation.cpp +++ b/lib/Driver/Compilation.cpp @@ -170,7 +170,7 @@ int Compilation::Execute() const { CleanupFileList(TempFiles); // If the compilation failed, remove result files as well. - if (Res != 0) + if (Res != 0 && !getArgs().hasArg(options::OPT_save_temps)) CleanupFileList(ResultFiles, true); return Res;