From: Daniel Dunbar Date: Mon, 23 Feb 2009 23:37:18 +0000 (+0000) Subject: ccc: Don't remove result files on error when -save-temps is present. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b89c1061144d80d48543d27a54cb9cb0eecbee53;p=clang ccc: Don't remove result files on error when -save-temps is present. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65349 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/ccc/ccclib/Driver.py b/tools/ccc/ccclib/Driver.py index 4472ddcc37..2015b2f0ed 100644 --- a/tools/ccc/ccclib/Driver.py +++ b/tools/ccc/ccclib/Driver.py @@ -228,10 +228,11 @@ class Driver(object): try: self.executeJobs(args, jobs) except: - for f in self.resultFiles: - # Fail if removing a result fails: - if os.path.exists(f): - os.remove(f) + if not args.getLastArg(self.parser.saveTempsOption): + for f in self.resultFiles: + # Fail if removing a result fails: + if os.path.exists(f): + os.remove(f) raise finally: for f in self.tempFiles: