31 DeleteStream(
false) {}
32 PrintModulePass(
const std::string &B,
raw_ostream *o,
bool DS)
36 if (DeleteStream)
delete Out;
39 bool runOnModule(
Module &M) {
40 (*Out) << Banner << M;
56 DeleteStream(
false) {}
57 PrintFunctionPass(
const std::string &B,
raw_ostream *o,
bool DS)
60 ~PrintFunctionPass() {
61 if (DeleteStream)
delete Out;
68 (*Out) << Banner << static_cast<Value&>(
F);
84 DeleteStream(
false) {}
85 PrintBasicBlockPass(
const std::string &B,
raw_ostream *o,
bool DS)
88 ~PrintBasicBlockPass() {
89 if (DeleteStream)
delete Out;
93 (*Out) << Banner << BB;
105 "Print module to stderr",
false,
false)
106 char PrintFunctionPass::
ID = 0;
108 "Print function to stderr",
false, false)
109 char PrintBasicBlockPass::ID = 0;
111 "Print BB to stderr", false, false)
117 const std::
string &Banner) {
118 return new PrintModulePass(Banner, OS, DeleteStream);
126 return new PrintFunctionPass(Banner, OS, DeleteStream);
133 const std::string &Banner) {
134 return new PrintBasicBlockPass(Banner, OS, DeleteStream);
The main container class for the LLVM Intermediate Representation.
INITIALIZE_PASS(PrintModulePass,"print-module","Print module to stderr", false, false) char PrintFunctionPass INITIALIZE_PASS(PrintFunctionPass,"print-function","Print function to stderr", false, false) char PrintBasicBlockPass INITIALIZE_PASS(PrintBasicBlockPass,"print-bb","Print BB to stderr", false, false) ModulePass *llvm
ModulePass * createPrintModulePass(raw_ostream *OS, bool DeleteStream=false, const std::string &Banner="")
ID
LLVM Calling Convention Representation.
LLVM Basic Block Representation.
FunctionPass * createPrintFunctionPass(const std::string &Banner, raw_ostream *OS, bool DeleteStream=false)
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
BasicBlockPass * createPrintBasicBlockPass(raw_ostream *OS, bool DeleteStream=false, const std::string &Banner="")
print Print MemDeps of function