* Provide option for specifying bytecode compression

* Enabled bytecode compression by default.

llvm-svn: 17563
This commit is contained in:
Reid Spencer 2004-11-07 05:30:43 +00:00
parent fbb15f39b8
commit 1f9e18e7c5
1 changed files with 6 additions and 5 deletions

View File

@ -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;
}
};