[llvm-commits] CVS: llvm/tools/llvm2cpp/llvm2cpp.cpp
Chris Lattner
sabre at nondot.org
Wed Feb 7 13:41:51 PST 2007
Changes in directory llvm/tools/llvm2cpp:
llvm2cpp.cpp updated: 1.6 -> 1.7
---
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)
llvm2cpp.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: llvm/tools/llvm2cpp/llvm2cpp.cpp
diff -u llvm/tools/llvm2cpp/llvm2cpp.cpp:1.6 llvm/tools/llvm2cpp/llvm2cpp.cpp:1.7
--- llvm/tools/llvm2cpp/llvm2cpp.cpp:1.6 Tue Dec 5 19:18:01 2006
+++ llvm/tools/llvm2cpp/llvm2cpp.cpp Wed Feb 7 15:41:02 2007
@@ -49,7 +49,9 @@
int exitCode = 0;
std::ostream *Out = 0;
std::string ErrorMessage;
- std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename, &ErrorMessage));
+ std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename,
+ Compressor::decompressToNewBuffer,
+ &ErrorMessage));
if (M.get() == 0) {
std::cerr << argv[0] << ": ";
if (ErrorMessage.size())
More information about the llvm-commits
mailing list