For PR351:

* removeFile() -> sys::Path::destroyFile()
* remove extraneous toString() calls
* convert local variables representing path names from std::string to
  sys::Path
* Use sys::Path objects with FileRemove instead of std::string
* Use sys::Path methods for construction of path names


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19001 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2004-12-16 23:04:20 +00:00
parent 9ac141823d
commit 5f76760c88
7 changed files with 54 additions and 44 deletions
+6 -4
View File
@@ -49,23 +49,25 @@ namespace llvm {
ReducePassList::TestResult
ReducePassList::doTest(std::vector<const PassInfo*> &Prefix,
std::vector<const PassInfo*> &Suffix) {
std::string PrefixOutput;
sys::Path PrefixOutput;
Module *OrigProgram = 0;
if (!Prefix.empty()) {
std::cout << "Checking to see if these passes crash: "
<< getPassesString(Prefix) << ": ";
if (BD.runPasses(Prefix, PrefixOutput))
std::string PfxOutput;
if (BD.runPasses(Prefix, PfxOutput))
return KeepPrefix;
PrefixOutput.setFile(PfxOutput);
OrigProgram = BD.Program;
BD.Program = ParseInputFile(PrefixOutput);
BD.Program = ParseInputFile(PrefixOutput.toString());
if (BD.Program == 0) {
std::cerr << BD.getToolName() << ": Error reading bytecode file '"
<< PrefixOutput << "'!\n";
exit(1);
}
removeFile(PrefixOutput);
PrefixOutput.destroyFile();
}
std::cout << "Checking to see if these passes crash: "