diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 03:01:26 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 03:01:26 +0000 |
commit | 11db4b8084270cb91446485b9534864ce52a95ef (patch) | |
tree | b990aa6d4735bab6bc3b41d8cf0ce421ca6e0175 /tools/llvm-nm | |
parent | c40641347131c15e5b8ace6d7b2abbbb51828833 (diff) | |
download | external_llvm-11db4b8084270cb91446485b9534864ce52a95ef.zip external_llvm-11db4b8084270cb91446485b9534864ce52a95ef.tar.gz external_llvm-11db4b8084270cb91446485b9534864ce52a95ef.tar.bz2 |
PR351: \
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
Diffstat (limited to 'tools/llvm-nm')
-rw-r--r-- | tools/llvm-nm/llvm-nm.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp index daac355..80a02c3 100644 --- a/tools/llvm-nm/llvm-nm.cpp +++ b/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"; |