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

Chris Lattner sabre at nondot.org
Wed Feb 7 13:41:53 PST 2007



Changes in directory llvm/tools/llvm-nm:

llvm-nm.cpp updated: 1.30 -> 1.31
---
Log message:

push bytecode decompressor out through APIs.  Now the bytecode reader
api's look like this:

ModuleProvider *getBytecodeModuleProvider(
  const std::string &Filename,  ///< Name of file to be read
  BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
  std::string* ErrMsg = 0,      ///< Optional error message holder 
  BytecodeHandler* H = 0        ///< Optional handler for reader events
);

This is ugly, but allows a client to say:

  getBytecodeModuleProvider("foo", 0);

If they do this, there is no dependency on the compression libraries, saving
codesize.




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

 llvm-nm.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/tools/llvm-nm/llvm-nm.cpp
diff -u llvm/tools/llvm-nm/llvm-nm.cpp:1.30 llvm/tools/llvm-nm/llvm-nm.cpp:1.31
--- llvm/tools/llvm-nm/llvm-nm.cpp:1.30	Tue Jan 30 14:08:38 2007
+++ llvm/tools/llvm-nm/llvm-nm.cpp	Wed Feb  7 15:41:02 2007
@@ -127,7 +127,9 @@
   }
   // Note: Currently we do not support reading an archive from stdin.
   if (Filename == "-" || aPath.isBytecodeFile()) {
-    Module *Result = ParseBytecodeFile(Filename, &ErrorMessage);
+    Module *Result = ParseBytecodeFile(Filename,
+                                       Compressor::decompressToNewBuffer,
+                                       &ErrorMessage);
     if (Result) {
       DumpSymbolNamesFromModule (Result);
     } else {






More information about the llvm-commits mailing list