PR351: \
authorReid Spencer <rspencer@reidspencer.com>
Mon, 13 Dec 2004 03:01:26 +0000 (03:01 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 13 Dec 2004 03:01:26 +0000 (03:01 +0000)
Use sys::Path not FileUtilities to check file types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18865 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-nm/llvm-nm.cpp
tools/llvmc/CompilerDriver.cpp

index daac355c0fe9c897c44bf53de853d0971311e70a..80a02c37f95c3af82be7253f050d50df7fb6d9af 100644 (file)
@@ -119,13 +119,14 @@ void DumpSymbolNamesFromModule (Module *M) {
 
 void DumpSymbolNamesFromFile (std::string &Filename) {
   std::string ErrorMessage;
-  if (Filename != "-" && !FileOpenable (Filename)) {
+  sys::Path aPath(Filename);
+  if (Filename != "-" && !aPath.readable()) {
     std::cerr << ToolName << ": " << Filename << ": " << strerror (errno)
               << "\n";
     return;
   }
   // Note: Currently we do not support reading an archive from stdin.
-  if (Filename == "-" || IsBytecode (Filename)) {
+  if (Filename == "-" || aPath.isBytecodeFile()) {
     Module *Result = ParseBytecodeFile(Filename, &ErrorMessage);
     if (Result) {
       DumpSymbolNamesFromModule (Result);
@@ -133,7 +134,7 @@ void DumpSymbolNamesFromFile (std::string &Filename) {
       std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
       return;
     }
-  } else if (IsArchive(Filename)) {
+  } else if (aPath.isArchive()) {
     Archive* archive = Archive::OpenAndLoad(sys::Path(Filename));
     if (!archive)
       std::cerr << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
index 61d0d5ac8b94d772795f8f9e852843bb39f57a99..f7630a2aaee5fdb13336b2b495ea70b18f6ca984 100644 (file)
@@ -780,8 +780,9 @@ public:
       if (finalPhase == LINKING) {
 
         // Insert the platform-specific system libraries to the path list
-        LibraryPaths.push_back(sys::Path::GetSystemLibraryPath1());
-        LibraryPaths.push_back(sys::Path::GetSystemLibraryPath2());
+        std::vector<sys::Path> SysLibs;
+        sys::Path::GetSystemLibraryPaths(SysLibs);
+        LibraryPaths.insert(LibraryPaths.end(), SysLibs.begin(), SysLibs.end());
 
         // Set up the linking action with llvm-ld
         Action* link = new Action();