30 if (SourceLocFilterEmpty)
47 const std::string Banner;
49 MachineFunctionPrinterPass() : MachineFunctionPass(ID), OS(
dbgs()) { }
50 MachineFunctionPrinterPass(raw_ostream &os,
const std::string &banner)
51 : MachineFunctionPass(ID), OS(os), Banner(banner) {}
53 StringRef getPassName()
const override {
return "MachineFunction Printer"; }
55 void getAnalysisUsage(AnalysisUsage &AU)
const override {
62 if (!shouldPrintMachineFunction(MF))
64 OS <<
"# " << Banner <<
":\n";
65 auto *SIWrapper = getAnalysisIfAvailable<SlotIndexesWrapperPass>();
66 MF.
print(OS, SIWrapper ? &SIWrapper->getSI() :
nullptr);
71char MachineFunctionPrinterPass::ID = 0;
76 "Machine Function Printer",
false,
false)
84 return new MachineFunctionPrinterPass(OS, Banner);
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
AnalysisUsage & addUsedIfAvailable()
Add the specified Pass class to the set of analyses used by this pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
void print(raw_ostream &OS, const SlotIndexes *=nullptr) const
print - Print out the MachineFunction in a format suitable for debugging to the specified stream.
Representation of each machine instruction.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI bool isSourceLocInPrintList(const DebugLoc &Loc)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ABI bool isFunctionInPrintList(StringRef FunctionName)
LLVM_ABI MachineFunctionPass * createMachineFunctionPrinterPass(raw_ostream &OS, const std::string &Banner="")
MachineFunctionPrinter pass - This pass prints out the machine function to the given stream as a debu...
LLVM_ABI bool isSourceLocFilterEmpty()
LLVM_ABI char & MachineFunctionPrinterPassID
MachineFunctionPrinterPass - This pass prints out MachineInstr's.
Implement std::hash so that hash_code can be used in STL containers.