diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2005-07-07 18:21:42 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2005-07-07 18:21:42 +0000 |
commit | c7f083297cd796c2fadb534307e4ef406fd68945 (patch) | |
tree | 9b2229594545a12585fe9e49e955595c4f5c5725 /tools/llvmc | |
parent | 8d4b9eddc00ad2c1c8f5bada32750c72f06c1517 (diff) | |
download | external_llvm-c7f083297cd796c2fadb534307e4ef406fd68945.zip external_llvm-c7f083297cd796c2fadb534307e4ef406fd68945.tar.gz external_llvm-c7f083297cd796c2fadb534307e4ef406fd68945.tar.bz2 |
For PR495:
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute
More (incremental) changes coming to close 495.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc')
-rw-r--r-- | tools/llvmc/CompilerDriver.cpp | 18 | ||||
-rw-r--r-- | tools/llvmc/Configuration.cpp | 10 |
2 files changed, 14 insertions, 14 deletions
diff --git a/tools/llvmc/CompilerDriver.cpp b/tools/llvmc/CompilerDriver.cpp index 39a2989..34e4038 100644 --- a/tools/llvmc/CompilerDriver.cpp +++ b/tools/llvmc/CompilerDriver.cpp @@ -187,7 +187,7 @@ private: void cleanup() { if (!isSet(KEEP_TEMPS_FLAG)) { - if (TempDir.isDirectory() && TempDir.writable()) + if (TempDir.isDirectory() && TempDir.canWrite()) TempDir.destroyDirectory(/*remove_contents=*/true); } else { std::cout << "Temporary files are in " << TempDir << "\n"; @@ -415,7 +415,7 @@ private: if (progpath.isEmpty()) throw std::string("Can't find program '" + action->program.toString()+"'"); - else if (progpath.executable()) + else if (progpath.canExecute()) action->program = progpath; else throw std::string("Program '"+action->program.toString()+ @@ -449,32 +449,32 @@ private: bool native = false) { sys::Path fullpath; fullpath.setFile(link_item); - if (fullpath.readable()) + if (fullpath.canRead()) return fullpath; for (PathVector::iterator PI = LibraryPaths.begin(), PE = LibraryPaths.end(); PI != PE; ++PI) { fullpath.setDirectory(PI->toString()); fullpath.appendFile(link_item); - if (fullpath.readable()) + if (fullpath.canRead()) return fullpath; if (native) { fullpath.appendSuffix("a"); } else { fullpath.appendSuffix("bc"); - if (fullpath.readable()) + if (fullpath.canRead()) return fullpath; fullpath.elideSuffix(); fullpath.appendSuffix("o"); - if (fullpath.readable()) + if (fullpath.canRead()) return fullpath; fullpath = *PI; fullpath.appendFile(std::string("lib") + link_item); fullpath.appendSuffix("a"); - if (fullpath.readable()) + if (fullpath.canRead()) return fullpath; fullpath.elideSuffix(); fullpath.appendSuffix("so"); - if (fullpath.readable()) + if (fullpath.canRead()) return fullpath; } } @@ -494,7 +494,7 @@ private: // First, see if the unadorned file name is not readable. If so, // we must track down the file in the lib search path. sys::Path fullpath; - if (!link_item.readable()) { + if (!link_item.canRead()) { // look for the library using the -L arguments specified // on the command line. fullpath = GetPathForLinkageItem(link_item.toString()); diff --git a/tools/llvmc/Configuration.cpp b/tools/llvmc/Configuration.cpp index e29ece2..27b1b3f 100644 --- a/tools/llvmc/Configuration.cpp +++ b/tools/llvmc/Configuration.cpp @@ -549,7 +549,7 @@ LLVMC_ConfigDataProvider::ReadConfigData(const std::string& ftype) { if (conf) { confFile.setDirectory(conf); confFile.appendFile(ftype); - if (!confFile.readable()) + if (!confFile.canRead()) throw std::string("Configuration file for '") + ftype + "' is not available."; } else { @@ -559,18 +559,18 @@ LLVMC_ConfigDataProvider::ReadConfigData(const std::string& ftype) { confFile.appendDirectory(".llvm"); confFile.appendDirectory("etc"); confFile.appendFile(ftype); - if (!confFile.readable()) + if (!confFile.canRead()) confFile.clear(); } if (confFile.isEmpty()) { // Okay, try the LLVM installation directory confFile = sys::Path::GetLLVMConfigDir(); confFile.appendFile(ftype); - if (!confFile.readable()) { + if (!confFile.canRead()) { // Okay, try the "standard" place confFile = sys::Path::GetLLVMDefaultConfigDir(); confFile.appendFile(ftype); - if (!confFile.readable()) { + if (!confFile.canRead()) { throw std::string("Configuration file for '") + ftype + "' is not available."; } @@ -580,7 +580,7 @@ LLVMC_ConfigDataProvider::ReadConfigData(const std::string& ftype) { } else { confFile = configDir; confFile.appendFile(ftype); - if (!confFile.readable()) + if (!confFile.canRead()) throw std::string("Configuration file for '") + ftype + "' is not available."; } |