LLVM: lib/IRPrinter/IRPrintingPasses.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
23
24using namespace llvm;
25
28 bool ShouldPreserveUseListOrder,
29 bool EmitSummaryIndex)
30 : OS(OS), Banner(Banner),
31 ShouldPreserveUseListOrder(ShouldPreserveUseListOrder),
32 EmitSummaryIndex(EmitSummaryIndex) {}
33
35
36
37 M.removeDebugIntrinsicDeclarations();
38
40 if (!Banner.empty())
41 OS << Banner << "\n";
42 M.print(OS, nullptr, ShouldPreserveUseListOrder);
43 } else {
44 bool BannerPrinted = false;
45 for (const auto &F : M.functions()) {
47 if (!BannerPrinted && !Banner.empty()) {
48 OS << Banner << "\n";
49 BannerPrinted = true;
50 }
51 F.print(OS);
52 }
53 }
54 }
55
58 : nullptr;
59 if (Index) {
60 if (Index->modulePaths().empty())
61 Index->addModule("");
62 Index->print(OS);
63 }
64
66}
67
70 : OS(OS), Banner(Banner) {}
71
76 OS << Banner << " (function: " << F.getName() << ")\n" << *F.getParent();
77 else
78 OS << Banner << '\n' << static_cast<Value &>(F);
79 }
80
82}
This file defines passes to print out IR in various granularities.
Module.h This file contains the declarations for the Module class.
This is the interface to build a ModuleSummaryIndex for a module.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Analysis pass to provide the ModuleSummaryIndex object.
Class to hold module path string table and global value map, and encapsulate methods for operating on...
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
LLVM_ABI PreservedAnalyses run(Function &F, AnalysisManager< Function > &)
Definition IRPrintingPasses.cpp:72
LLVM_ABI PrintFunctionPass()
Definition IRPrintingPasses.cpp:68
LLVM_ABI PrintModulePass()
Definition IRPrintingPasses.cpp:26
LLVM_ABI PreservedAnalyses run(Module &M, AnalysisManager< Module > &)
Definition IRPrintingPasses.cpp:34
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.
bool forcePrintModuleIR()
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool isFunctionInPrintList(StringRef FunctionName)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.