[llvm-commits] CVS: llvm/tools/gccld/gccld.cpp

John Criswell criswell at cs.uiuc.edu
Tue Sep 2 16:18:04 PDT 2003


Changes in directory llvm/tools/gccld:

gccld.cpp updated: 1.43 -> 1.44

---
Log message:

Added code that makes the bytecode file readable (needed by the generated shell
script).
Removed the use of sys/types.h and sys/stat.h.
Modified FileExists() so that it uses the access() system call to check for
file existance.  This requires less header files and might even be a tad bit
faster.



---
Diffs of the changes:

Index: llvm/tools/gccld/gccld.cpp
diff -u llvm/tools/gccld/gccld.cpp:1.43 llvm/tools/gccld/gccld.cpp:1.44
--- llvm/tools/gccld/gccld.cpp:1.43	Tue Sep  2 15:17:20 2003
+++ llvm/tools/gccld/gccld.cpp	Tue Sep  2 16:11:22 2003
@@ -24,12 +24,11 @@
 #include "Support/FileUtilities.h"
 #include "Support/CommandLine.h"
 #include "Support/Signals.h"
+#include "Config/unistd.h"
 #include <fstream>
 #include <memory>
 #include <set>
 #include <algorithm>
-#include <sys/types.h>     // For FileExists
-#include <sys/stat.h>
 
 namespace {
   cl::list<std::string> 
@@ -78,8 +77,7 @@
 
 // FileExists - Return true if the specified string is an openable file...
 static inline bool FileExists(const std::string &FN) {
-  struct stat StatBuf;
-  return stat(FN.c_str(), &StatBuf) != -1;
+  return access(FN.c_str(), F_OK) != -1;
 }
 
 
@@ -445,8 +443,9 @@
     // Make the script executable...
     MakeFileExecutable (OutputFilename);
 
-    // Make the bytecode file directly executable in LLEE as well
+    // Make the bytecode file readable and directly executable in LLEE as well
     MakeFileExecutable (RealBytecodeOutput);
+    MakeFileReadable   (RealBytecodeOutput);
   }
 
   return 0;





More information about the llvm-commits mailing list