From 827faf8f2bada469f5fb5e4c751692aba115b4af Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 24 Mar 2009 17:49:01 +0000 Subject: [PATCH] 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). llvm-svn: 67632 --- clang/lib/Driver/Compilation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index a2fc9212a511..2165bb74018a 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/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;