From 17e7444a61051f6d1ae2bd9c328929018d9a3f9b Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 13 Dec 2004 03:01:26 +0000 Subject: [PATCH] PR351: \ Use sys::Path not FileUtilities to check file types llvm-svn: 18865 --- llvm/tools/llvm-nm/llvm-nm.cpp | 7 ++++--- llvm/tools/llvmc/CompilerDriver.cpp | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index daac355c0fe9..80a02c37f95c 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -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"; diff --git a/llvm/tools/llvmc/CompilerDriver.cpp b/llvm/tools/llvmc/CompilerDriver.cpp index 61d0d5ac8b94..f7630a2aaee5 100644 --- a/llvm/tools/llvmc/CompilerDriver.cpp +++ b/llvm/tools/llvmc/CompilerDriver.cpp @@ -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 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();