forked from OSchip/llvm-project
* Provide option for specifying bytecode compression
* Enabled bytecode compression by default. llvm-svn: 17563
This commit is contained in:
parent
fbb15f39b8
commit
1f9e18e7c5
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue