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

Reid Spencer reid at x10sys.com
Sun Dec 12 19:01:37 PST 2004



Changes in directory llvm/tools/llvm-nm:

llvm-nm.cpp updated: 1.19 -> 1.20
---
Log message:

PR351: http://llvm.cs.uiuc.edu/PR351 : \
Use sys::Path not FileUtilities to check file types

---
Diffs of the changes:  (+4 -3)

Index: llvm/tools/llvm-nm/llvm-nm.cpp
diff -u llvm/tools/llvm-nm/llvm-nm.cpp:1.19 llvm/tools/llvm-nm/llvm-nm.cpp:1.20
--- llvm/tools/llvm-nm/llvm-nm.cpp:1.19	Sun Nov 14 16:27:46 2004
+++ llvm/tools/llvm-nm/llvm-nm.cpp	Sun Dec 12 21:01:26 2004
@@ -119,13 +119,14 @@
 
 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 @@
       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";






More information about the llvm-commits mailing list