[llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp Configuration.cpp

Reid Spencer reid at x10sys.com
Thu Jul 7 11:21:57 PDT 2005



Changes in directory llvm/tools/llvmc:

CompilerDriver.cpp updated: 1.31 -> 1.32
Configuration.cpp updated: 1.21 -> 1.22
---
Log message:

For PR495: http://llvm.cs.uiuc.edu/PR495 :
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute

More (incremental) changes coming to close 495.



---
Diffs of the changes:  (+14 -14)

 CompilerDriver.cpp |   18 +++++++++---------
 Configuration.cpp  |   10 +++++-----
 2 files changed, 14 insertions(+), 14 deletions(-)


Index: llvm/tools/llvmc/CompilerDriver.cpp
diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.31 llvm/tools/llvmc/CompilerDriver.cpp:1.32
--- llvm/tools/llvmc/CompilerDriver.cpp:1.31	Wed May 18 19:52:29 2005
+++ llvm/tools/llvmc/CompilerDriver.cpp	Thu Jul  7 13:21:42 2005
@@ -187,7 +187,7 @@
 
   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 @@
       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 @@
                                         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 @@
     // 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());


Index: llvm/tools/llvmc/Configuration.cpp
diff -u llvm/tools/llvmc/Configuration.cpp:1.21 llvm/tools/llvmc/Configuration.cpp:1.22
--- llvm/tools/llvmc/Configuration.cpp:1.21	Wed May 18 20:06:46 2005
+++ llvm/tools/llvmc/Configuration.cpp	Thu Jul  7 13:21:42 2005
@@ -549,7 +549,7 @@
     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 @@
         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 @@
   } else {
     confFile = configDir;
     confFile.appendFile(ftype);
-    if (!confFile.readable())
+    if (!confFile.canRead())
       throw std::string("Configuration file for '") + ftype +
                         "' is not available.";
   }






More information about the llvm-commits mailing list