From 8ad8a5219c396fcd143b5c3363e60952e5647df7 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 7 Nov 2004 05:30:43 +0000 Subject: [PATCH] * Provide option for specifying bytecode compression * Enabled bytecode compression by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17563 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Bytecode/WriteBytecodePass.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/llvm/Bytecode/WriteBytecodePass.h b/include/llvm/Bytecode/WriteBytecodePass.h index 5b6325d521e..8a061d298a7 100644 --- a/include/llvm/Bytecode/WriteBytecodePass.h +++ b/include/llvm/Bytecode/WriteBytecodePass.h @@ -24,18 +24,19 @@ namespace llvm { class WriteBytecodePass : public ModulePass { std::ostream *Out; // ostream to print on bool DeleteStream; + bool CompressFile; public: - WriteBytecodePass() : Out(&std::cout), DeleteStream(false) {} - WriteBytecodePass(std::ostream *o, bool DS = false) - : Out(o), DeleteStream(DS) { - } + WriteBytecodePass() + : Out(&std::cout), DeleteStream(false), CompressFile(true) {} + WriteBytecodePass(std::ostream *o, bool DS = false, bool CF = false ) + : Out(o), DeleteStream(DS), CompressFile(CF) {} inline ~WriteBytecodePass() { if (DeleteStream) delete Out; } bool runOnModule(Module &M) { - WriteBytecodeToFile(&M, *Out); + WriteBytecodeToFile(&M, *Out, CompressFile ); return false; } }; -- 2.34.1