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

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



Changes in directory llvm/tools/llvm-bcanalyzer:

llvm-bcanalyzer.cpp updated: 1.9 -> 1.10
---
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:  (+4 -1)

 llvm-bcanalyzer.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.9 llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.10
--- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.9	Tue Dec  5 19:18:00 2006
+++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp	Wed Feb  7 15:41:02 2007
@@ -32,6 +32,7 @@
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Bytecode/Analyzer.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compressor.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/System/Signals.h"
 #include <fstream>
@@ -66,7 +67,9 @@
     bca.progressiveVerify = Verify;
 
     /// Analyze the bytecode file
-    Module* M = AnalyzeBytecodeFile(InputFilename, bca, &ErrorMessage, (Dump?Out:0));
+    Module* M = AnalyzeBytecodeFile(InputFilename, bca, 
+                                    Compressor::decompressToNewBuffer,
+                                    &ErrorMessage, (Dump?Out:0));
 
     // All that bcanalyzer does is write the gathered statistics to the output
     PrintBytecodeAnalysis(bca,*Out);






More information about the llvm-commits mailing list