summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-07-08 03:08:58 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-07-08 03:08:58 +0000
commitaf48d8643debbca222fb868e8e4e8dce18271a9f (patch)
treee488352d4dd46f55b0dfd24466244bdfd9c08cc3 /llvm/tools
parent215db9041b1618c0f4a076cc03246471797d0b66 (diff)
downloadbcm5719-llvm-af48d8643debbca222fb868e8e4e8dce18271a9f.tar.gz
bcm5719-llvm-af48d8643debbca222fb868e8e4e8dce18271a9f.zip
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. llvm-svn: 22354
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/bugpoint/CrashDebugger.cpp2
-rw-r--r--llvm/tools/bugpoint/ExecutionDriver.cpp10
-rw-r--r--llvm/tools/bugpoint/Miscompilation.cpp10
-rw-r--r--llvm/tools/bugpoint/OptimizerDriver.cpp4
-rw-r--r--llvm/tools/gccld/gccld.cpp14
-rw-r--r--llvm/tools/llvm-ar/llvm-ar.cpp4
-rw-r--r--llvm/tools/llvm-ld/llvm-ld.cpp10
-rw-r--r--llvm/tools/llvmc/CompilerDriver.cpp2
8 files changed, 28 insertions, 28 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index 2ede20fad7a..b63ce219e89 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/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/llvm/tools/bugpoint/ExecutionDriver.cpp b/llvm/tools/bugpoint/ExecutionDriver.cpp
index 936f54682dd..142faeef7df 100644
--- a/llvm/tools/bugpoint/ExecutionDriver.cpp
+++ b/llvm/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/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp
index 4caf0d43e4b..2e0bdb33483 100644
--- a/llvm/tools/bugpoint/Miscompilation.cpp
+++ b/llvm/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/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp
index c6e58fdc340..3a77e16d4ef 100644
--- a/llvm/tools/bugpoint/OptimizerDriver.cpp
+++ b/llvm/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/llvm/tools/gccld/gccld.cpp b/llvm/tools/gccld/gccld.cpp
index 7a4dec329a0..2ae13aa7d4e 100644
--- a/llvm/tools/gccld/gccld.cpp
+++ b/llvm/tools/gccld/gccld.cpp
@@ -313,9 +313,9 @@ int main(int argc, char **argv, char **envp ) {
if (!SaveTemps) {
// Remove the assembly language file.
- AssemblyFile.destroy();
+ AssemblyFile.eraseFromDisk();
// Remove the bytecode language file.
- sys::Path(RealBytecodeOutput).destroy();
+ sys::Path(RealBytecodeOutput).eraseFromDisk();
}
} else if (NativeCBE) {
@@ -345,21 +345,21 @@ int main(int argc, char **argv, char **envp ) {
if (!SaveTemps) {
// Remove the assembly language file.
- CFile.destroy();
+ CFile.eraseFromDisk();
// Remove the bytecode language file.
- sys::Path(RealBytecodeOutput).destroy();
+ sys::Path(RealBytecodeOutput).eraseFromDisk();
}
} else if (!LinkAsLibrary) {
EmitShellScript(argv);
// Make the bytecode file readable and directly executable in LLEE
- sys::Path(RealBytecodeOutput).makeExecutable();
- sys::Path(RealBytecodeOutput).makeReadable();
+ sys::Path(RealBytecodeOutput).makeExecutableOnDisk();
+ sys::Path(RealBytecodeOutput).makeReadableOnDisk();
}
// Make the output, whether native or script, executable as well...
- sys::Path(OutputFilename).makeExecutable();
+ sys::Path(OutputFilename).makeExecutableOnDisk();
} catch (const char*msg) {
std::cerr << argv[0] << ": " << msg << "\n";
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index 3725a17883d..09efeca3daf 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -432,7 +432,7 @@ void doExtract() {
if (I->hasPath()) {
sys::Path dirs(I->getPath());
dirs.eraseComponent();
- dirs.createDirectory(/*create_parents=*/true);
+ dirs.createDirectoryOnDisk(/*create_parents=*/true);
}
// Open up a file stream for writing
@@ -455,7 +455,7 @@ void doExtract() {
// If we're supposed to retain the original modification times, etc. do so
// now.
if (OriginalDates)
- I->getPath().setStatusInfo(I->getStatusInfo());
+ I->getPath().setStatusInfoOnDisk(I->getStatusInfo());
}
}
}
diff --git a/llvm/tools/llvm-ld/llvm-ld.cpp b/llvm/tools/llvm-ld/llvm-ld.cpp
index 23efb48cfa3..65a220a3acb 100644
--- a/llvm/tools/llvm-ld/llvm-ld.cpp
+++ b/llvm/tools/llvm-ld/llvm-ld.cpp
@@ -480,7 +480,7 @@ int main(int argc, char **argv, char **envp) {
gcc, envp);
// Remove the assembly language file.
- AssemblyFile.destroy();
+ AssemblyFile.eraseFromDisk();
} else if (NativeCBE) {
sys::Path CFile (OutputFilename);
CFile.appendSuffix("cbe.c");
@@ -505,18 +505,18 @@ int main(int argc, char **argv, char **envp) {
GenerateNative(OutputFilename, CFile.toString(), Libraries, gcc, envp);
// Remove the assembly language file.
- CFile.destroy();
+ CFile.eraseFromDisk();
} else {
EmitShellScript(argv);
}
// Make the script executable...
- sys::Path(OutputFilename).makeExecutable();
+ sys::Path(OutputFilename).makeExecutableOnDisk();
// Make the bytecode file readable and directly executable in LLEE as well
- sys::Path(RealBytecodeOutput).makeExecutable();
- sys::Path(RealBytecodeOutput).makeReadable();
+ sys::Path(RealBytecodeOutput).makeExecutableOnDisk();
+ sys::Path(RealBytecodeOutput).makeReadableOnDisk();
}
return 0;
diff --git a/llvm/tools/llvmc/CompilerDriver.cpp b/llvm/tools/llvmc/CompilerDriver.cpp
index 659af169a83..ff7c48a0774 100644
--- a/llvm/tools/llvmc/CompilerDriver.cpp
+++ b/llvm/tools/llvmc/CompilerDriver.cpp
@@ -188,7 +188,7 @@ private:
void cleanup() {
if (!isSet(KEEP_TEMPS_FLAG)) {
if (TempDir.isDirectory() && TempDir.canWrite())
- TempDir.destroy(/*remove_contents=*/true);
+ TempDir.eraseFromDisk(/*remove_contents=*/true);
} else {
std::cout << "Temporary files are in " << TempDir << "\n";
}
OpenPOWER on IntegriCloud