25 bool ShouldPreserveUseListOrder)
26 : OS(OS), Banner(Banner),
27 ShouldPreserveUseListOrder(ShouldPreserveUseListOrder) {}
32 M.
print(OS,
nullptr, ShouldPreserveUseListOrder);
43 : OS(OS), Banner(Banner) {}
48 OS << Banner << static_cast<Value &>(
F);
54 class PrintModulePassWrapper :
public ModulePass {
60 PrintModulePassWrapper(
raw_ostream &OS,
const std::string &Banner,
61 bool ShouldPreserveUseListOrder)
62 :
ModulePass(
ID),
P(OS, Banner, ShouldPreserveUseListOrder) {}
64 bool runOnModule(
Module &M)
override {
81 PrintFunctionPassWrapper(
raw_ostream &OS,
const std::string &Banner)
85 bool runOnFunction(
Function &
F)
override {
103 PrintBasicBlockPass(
raw_ostream &Out,
const std::string &Banner)
120 "Print module to stderr",
false,
false)
121 char PrintFunctionPassWrapper::
ID = 0;
124 char PrintBasicBlockPass::ID = 0;
129 const std::
string &Banner,
130 bool ShouldPreserveUseListOrder) {
131 return new PrintModulePassWrapper(OS, Banner, ShouldPreserveUseListOrder);
135 const std::string &Banner) {
136 return new PrintFunctionPassWrapper(OS, Banner);
140 const std::string &Banner) {
141 return new PrintBasicBlockPass(OS, Banner);
void Print(const Unit &v, const char *PrintAfter)
A Module instance is used to store all the information related to an LLVM module. ...
Pass for printing a Module as LLVM's text IR assembly.
static bool runOnBasicBlock(BasicBlock &BB)
FunctionPass * createPrintFunctionPass(raw_ostream &OS, const std::string &Banner="")
Create and return a pass that prints functions to the specified raw_ostream as they are processed...
StringRef getName() const
Return a constant reference to the value's name.
Function Alias Analysis false
A set of analyses that are preserved following a run of a transformation pass.
iterator_range< iterator > functions()
LLVM Basic Block Representation.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
BasicBlockPass class - This class is used to implement most local optimizations.
Module.h This file contains the declarations for the Module class.
BasicBlockPass * createPrintBasicBlockPass(raw_ostream &OS, const std::string &Banner="")
Create and return a pass that writes the BB to the specified raw_ostream.
bool isFunctionInPrintList(StringRef FunctionName)
isFunctionInPrintList - returns true if a function should be printed via
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void setPreservesAll()
Set by analyses that do not transform their input at all.
void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW, bool ShouldPreserveUseListOrder=false, bool IsForDebug=false) const
Print the module to an output stream with an optional AssemblyAnnotationWriter.
PreservedAnalyses run(Module &M, AnalysisManager< Module > &)
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
ModulePass * createPrintModulePass(raw_ostream &OS, const std::string &Banner="", bool ShouldPreserveUseListOrder=false)
Create and return a pass that writes the module to the specified raw_ostream.
This file defines passes to print out IR in various granularities.
INITIALIZE_PASS(PrintModulePassWrapper,"print-module","Print module to stderr", false, false) char PrintFunctionPassWrapper INITIALIZE_PASS(PrintFunctionPassWrapper,"print-function","Print function to stderr", false, false) char PrintBasicBlockPass INITIALIZE_PASS(PrintBasicBlockPass,"print-bb","Print BB to stderr", false, false) ModulePass *llvm
PreservedAnalyses run(Function &F, AnalysisManager< Function > &)
This class implements an extremely fast bulk output stream that can only output to a stream...
print Print MemDeps of function
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.
Pass for printing a Function as LLVM's text IR assembly.