diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2005-07-08 03:08:58 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2005-07-08 03:08:58 +0000 |
commit | a229c5cce75209047db32c6039aa0b0fd481f049 (patch) | |
tree | 7e69ee21a80ed018e52af9071602c3db887b8326 /tools/bugpoint | |
parent | edb9d6bc720bb2328bb49f4400bf8d6b3b04ef50 (diff) | |
download | external_llvm-a229c5cce75209047db32c6039aa0b0fd481f049.zip external_llvm-a229c5cce75209047db32c6039aa0b0fd481f049.tar.gz external_llvm-a229c5cce75209047db32c6039aa0b0fd481f049.tar.bz2 |
Final Changes For PR495:
This chagne just renames some sys::Path methods to ensure they are not
misused. The Path documentation now divides methods into two dimensions:
Path/Disk and accessor/mutator. Path accessors and mutators only operate
on the Path object itself without making any disk accesses. Disk accessors
and mutators will also access or modify the file system. Because of the
potentially destructive nature of disk mutators, it was decided that all
such methods should end in the work "Disk" to ensure the user recognizes
that the change will occur on the file system. This patch makes that
change. The method name changes are:
makeReadable -> makeReadableOnDisk
makeWriteable -> makeWriteableOnDisk
makeExecutable -> makeExecutableOnDisk
setStatusInfo -> setStatusInfoOnDisk
createDirectory -> createDirectoryOnDisk
createFile -> createFileOnDisk
createTemporaryFile -> createTemporaryFileOnDisk
destroy -> eraseFromDisk
rename -> renamePathOnDisk
These changes pass the Linux Deja Gnu tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22354 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 2 | ||||
-rw-r--r-- | tools/bugpoint/ExecutionDriver.cpp | 10 | ||||
-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, 16 insertions, 16 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index 2ede20f..b63ce21 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -67,7 +67,7 @@ ReducePassList::doTest(std::vector<const PassInfo*> &Prefix, << PrefixOutput << "'!\n"; exit(1); } - PrefixOutput.destroy(); + PrefixOutput.eraseFromDisk(); } std::cout << "Checking to see if these passes crash: " diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index 936f546..142faee 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.destroy(); + OutputCFile.eraseFromDisk(); 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.destroy(); + Output.eraseFromDisk(); if (RemoveBytecode) - sys::Path(BytecodeFile).destroy(); + sys::Path(BytecodeFile).eraseFromDisk(); return true; } @@ -321,11 +321,11 @@ bool BugDriver::diffProgram(const std::string &BytecodeFile, } // Remove the generated output. - Output.destroy(); + Output.eraseFromDisk(); // Remove the bytecode file if we are supposed to. if (RemoveBytecode) - sys::Path(BytecodeFile).destroy(); + sys::Path(BytecodeFile).eraseFromDisk(); return FilesDifferent; } diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 4caf0d4..2e0bdb3 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).destroy(); + sys::Path(BytecodeResult).eraseFromDisk(); 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).destroy(); // No longer need the file on disk + sys::Path(BytecodeResult).eraseFromDisk(); // 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.destroy(); - SafeModuleBC.destroy(); - sys::Path(SharedObject).destroy(); + TestModuleBC.eraseFromDisk(); + SafeModuleBC.eraseFromDisk(); + sys::Path(SharedObject).eraseFromDisk(); return Result; } diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index c6e58fd..3a77e16 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).destroy(); + sys::Path(OutputFilename).eraseFromDisk(); #ifndef PLATFORMINDEPENDENT if (!Quiet) { @@ -214,6 +214,6 @@ Module *BugDriver::runPassesOn(Module *M, << BytecodeResult << "'!\n"; exit(1); } - sys::Path(BytecodeResult).destroy(); // No longer need the file on disk + sys::Path(BytecodeResult).eraseFromDisk(); // No longer need the file on disk return Ret; } diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index 3cea338..f516986 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.destroy(); + ErrorFilename.eraseFromDisk(); 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.destroy(); + OutputAsmFile.eraseFromDisk(); } 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.destroy(); + OutputCFile.eraseFromDisk(); } int CBE::ExecuteProgram(const std::string &Bytecode, |