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

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



Changes in directory llvm/tools/lli:

lli.cpp updated: 1.66 -> 1.67
---
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)

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


Index: llvm/tools/lli/lli.cpp
diff -u llvm/tools/lli/lli.cpp:1.66 llvm/tools/lli/lli.cpp:1.67
--- llvm/tools/lli/lli.cpp:1.66	Mon Feb  5 15:19:13 2007
+++ llvm/tools/lli/lli.cpp	Wed Feb  7 15:41:02 2007
@@ -22,6 +22,7 @@
 #include "llvm/ExecutionEngine/Interpreter.h"
 #include "llvm/ExecutionEngine/GenericValue.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compressor.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/PluginLoader.h"
 #include "llvm/System/Process.h"
@@ -70,7 +71,9 @@
     // Load the bytecode...
     std::string ErrorMsg;
     ModuleProvider *MP = 0;
-    MP = getBytecodeModuleProvider(InputFile, &ErrorMsg);
+    MP = getBytecodeModuleProvider(InputFile, 
+                                   Compressor::decompressToNewBuffer,
+                                   &ErrorMsg);
     if (!MP) {
       std::cerr << "Error loading program '" << InputFile << "': "
                 << ErrorMsg << "\n";






More information about the llvm-commits mailing list