]> granicus.if.org Git - clang/commitdiff
Driver: Result files shouldn't be removed on failure when -save-temps
authorDaniel Dunbar <daniel@zuster.org>
Tue, 24 Mar 2009 17:49:01 +0000 (17:49 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 24 Mar 2009 17:49:01 +0000 (17:49 +0000)
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

lib/Driver/Compilation.cpp

index a2fc9212a511035f0355f0d51146b66299786ead..2165bb74018a650451c7adb4274c7a0032fe3582 100644 (file)
@@ -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;