diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2005-07-07 23:21:43 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2005-07-07 23:21:43 +0000 |
commit | dd04df0ec33a903ee7fc747701bafde622f77d8b (patch) | |
tree | 341d4fd4ba6e81cb79966ef2c379ccbb2d8b5100 /tools/bugpoint | |
parent | b3d59701c89a6e03a0e0909543f3e7bd9140900f (diff) | |
download | external_llvm-dd04df0ec33a903ee7fc747701bafde622f77d8b.zip external_llvm-dd04df0ec33a903ee7fc747701bafde622f77d8b.tar.gz external_llvm-dd04df0ec33a903ee7fc747701bafde622f77d8b.tar.bz2 |
For PR495:
Get rid of the difference between file paths and directory paths. The Path
class now simply stores a path that can refer to either a file or a
directory. This required various changes in the implementation and interface
of the class with the corresponding impact to its users. Doxygen comments were
also updated to reflect these changes. Interface changes are:
appendDirectory -> appendComponent
appendFile -> appendComponent
elideDirectory -> eraseComponent
elideFile -> eraseComponent
elideSuffix -> eraseSuffix
renameFile -> rename
setDirectory -> set
setFile -> set
Changes pass Dejagnu and llvm-test/SingleSource tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 4 | ||||
-rw-r--r-- | tools/bugpoint/ExecutionDriver.cpp | 11 | ||||
-rw-r--r-- | tools/bugpoint/Miscompilation.cpp | 10 | ||||
-rw-r--r-- | tools/bugpoint/OptimizerDriver.cpp | 4 | ||||
-rw-r--r-- | tools/bugpoint/ToolRunner.cpp | 6 |
5 files changed, 18 insertions, 17 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index 6f0e3de..2ede20f 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -58,7 +58,7 @@ ReducePassList::doTest(std::vector<const PassInfo*> &Prefix, if (BD.runPasses(Prefix, PfxOutput)) return KeepPrefix; - PrefixOutput.setFile(PfxOutput); + PrefixOutput.set(PfxOutput); OrigProgram = BD.Program; BD.Program = ParseInputFile(PrefixOutput.toString()); @@ -67,7 +67,7 @@ ReducePassList::doTest(std::vector<const PassInfo*> &Prefix, << PrefixOutput << "'!\n"; exit(1); } - PrefixOutput.destroyFile(); + PrefixOutput.destroy(); } std::cout << "Checking to see if these passes crash: " diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index 972338a..936f546 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -281,7 +281,7 @@ std::string BugDriver::compileSharedObject(const std::string &BytecodeFile) { exit(1); // Remove the intermediate C file - OutputCFile.destroyFile(); + OutputCFile.destroy(); return "./" + SharedObjectFile; } @@ -302,9 +302,9 @@ bool BugDriver::diffProgram(const std::string &BytecodeFile, // If we're checking the program exit code, assume anything nonzero is bad. if (CheckProgramExitCode && ProgramExitedNonzero) { - Output.destroyFile(); + Output.destroy(); if (RemoveBytecode) - sys::Path(BytecodeFile).destroyFile(); + sys::Path(BytecodeFile).destroy(); return true; } @@ -321,10 +321,11 @@ bool BugDriver::diffProgram(const std::string &BytecodeFile, } // Remove the generated output. - Output.destroyFile(); + Output.destroy(); // Remove the bytecode file if we are supposed to. - if (RemoveBytecode) sys::Path(BytecodeFile).destroyFile(); + if (RemoveBytecode) + sys::Path(BytecodeFile).destroy(); return FilesDifferent; } diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 860b9b4..4caf0d4 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -99,7 +99,7 @@ ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix, // If the prefix maintains the predicate by itself, only keep the prefix! if (BD.diffProgram(BytecodeResult)) { std::cout << " nope.\n"; - sys::Path(BytecodeResult).destroyFile(); + sys::Path(BytecodeResult).destroy(); return KeepPrefix; } std::cout << " yup.\n"; // No miscompilation! @@ -113,7 +113,7 @@ ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix, << BytecodeResult << "'!\n"; exit(1); } - sys::Path(BytecodeResult).destroyFile(); // No longer need the file on disk + sys::Path(BytecodeResult).destroy(); // No longer need the file on disk // Don't check if there are no passes in the suffix. if (Suffix.empty()) @@ -775,9 +775,9 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe) { std::cerr << ": still failing!\n"; else std::cerr << ": didn't fail.\n"; - TestModuleBC.destroyFile(); - SafeModuleBC.destroyFile(); - sys::Path(SharedObject).destroyFile(); + TestModuleBC.destroy(); + SafeModuleBC.destroy(); + sys::Path(SharedObject).destroy(); return Result; } diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index 5de70be..c6e58fd 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/tools/bugpoint/OptimizerDriver.cpp @@ -161,7 +161,7 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, // If we are supposed to delete the bytecode file or if the passes crashed, // remove it now. This may fail if the file was never created, but that's ok. if (DeleteOutput || !ExitedOK) - sys::Path(OutputFilename).destroyFile(); + sys::Path(OutputFilename).destroy(); #ifndef PLATFORMINDEPENDENT if (!Quiet) { @@ -214,6 +214,6 @@ Module *BugDriver::runPassesOn(Module *M, << BytecodeResult << "'!\n"; exit(1); } - sys::Path(BytecodeResult).destroyFile(); // No longer need the file on disk + sys::Path(BytecodeResult).destroy(); // No longer need the file on disk return Ret; } diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index 9ef14c5..4a08e1a 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -65,7 +65,7 @@ static void ProcessFailure(sys::Path ProgPath, const char** Args) { ErrorFile.close(); } - ErrorFilename.destroyFile(); + ErrorFilename.destroy(); throw ToolExecutionError(OS.str()); } @@ -176,7 +176,7 @@ void LLC::OutputAsm(const std::string &Bytecode, sys::Path &OutputAsmFile) { void LLC::compileProgram(const std::string &Bytecode) { sys::Path OutputAsmFile; OutputAsm(Bytecode, OutputAsmFile); - OutputAsmFile.destroyFile(); + OutputAsmFile.destroy(); } int LLC::ExecuteProgram(const std::string &Bytecode, @@ -321,7 +321,7 @@ void CBE::OutputC(const std::string &Bytecode, sys::Path& OutputCFile) { void CBE::compileProgram(const std::string &Bytecode) { sys::Path OutputCFile; OutputC(Bytecode, OutputCFile); - OutputCFile.destroyFile(); + OutputCFile.destroy(); } int CBE::ExecuteProgram(const std::string &Bytecode, |