Fix bugpoint execution/reference output file name
authorHal Finkel <hfinkel@anl.gov>
Fri, 28 Jun 2013 16:37:52 +0000 (16:37 +0000)
committerHal Finkel <hfinkel@anl.gov>
Fri, 28 Jun 2013 16:37:52 +0000 (16:37 +0000)
sys::fs::unique_file will now loop infinitely if provided with a file name
without '%' characters and the input file already exists. As a result, bugpoint
cannot use a fixed file name for the execution output (including the reference
output).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185166 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/BugDriver.h
tools/bugpoint/ExecutionDriver.cpp

index bb15b79034cb53ff1c42678de8c74edd6d45261e..27b37f4dc69b5a431c2f812a11aedd141462be8e 100644 (file)
@@ -191,7 +191,7 @@ public:
   /// this function.
   ///
   bool createReferenceFile(Module *M, const std::string &Filename
-                                            = "bugpoint.reference.out");
+                                            = "bugpoint.reference.out-%%%%%%%");
 
   /// diffProgram - This method executes the specified module and diffs the
   /// output against the file specified by ReferenceOutputFile.  If the output
index 6edf2335f6c5fa36e44a45d2be0a17c27f572d79..270dab23171dee7fef534bfbe08e1ba343155e7a 100644 (file)
@@ -328,7 +328,7 @@ std::string BugDriver::executeProgram(const Module *Program,
   FileRemover BitcodeFileRemover(BitcodePath,
     CreatedBitcode && !SaveTemps);
 
-  if (OutputFile.empty()) OutputFile = OutputPrefix + "-execution-output";
+  if (OutputFile.empty()) OutputFile = OutputPrefix + "-execution-output-%%%%%%%";
 
   // Check to see if this is a valid output filename...
   SmallString<128> UniqueFile;