32 bool runOnFunction(
Function &
F)
override {
46 INITIALIZE_PASS(CFGViewerLegacyPass,
"view-cfg",
"View CFG of function",
false,
true)
62 bool runOnFunction(
Function &
F)
override {
77 "View CFG of function (with no function bodies)",
false,
true)
86 std::string Filename = (
"cfg." + F.
getName() +
".dot").str();
87 errs() <<
"Writing '" << Filename <<
"'...";
95 errs() <<
" error opening file for writing!";
106 bool runOnFunction(
Function &
F)
override {
120 INITIALIZE_PASS(CFGPrinterLegacyPass,
"dot-cfg",
"Print CFG of function to 'dot' file",
136 bool runOnFunction(
Function &
F)
override {
150 "Print CFG of function to 'dot' file (with no function bodies)",
178 return new CFGPrinterLegacyPass();
182 return new CFGOnlyPrinterLegacyPass();
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A Module instance is used to store all the information related to an LLVM module. ...
FunctionPass * createCFGPrinterLegacyPassPass()
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
INITIALIZE_PASS(CFGOnlyViewerLegacyPass,"view-cfg-only","View CFG of function (with no function bodies)", false, true) PreservedAnalyses CFGOnlyViewerPass
StringRef getName() const
Return a constant reference to the value's name.
void initializeCFGOnlyPrinterLegacyPassPass(PassRegistry &)
raw_ostream & WriteGraph(raw_ostream &O, const GraphType &G, bool ShortNames=false, const Twine &Title="")
FunctionPass * createCFGOnlyPrinterLegacyPassPass()
A set of analyses that are preserved following a run of a transformation pass.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
void ViewGraph(const GraphType &G, const Twine &Name, bool ShortNames=false, const Twine &Title="", GraphProgram::Name Program=GraphProgram::DOT)
ViewGraph - Emit a dot graph, run 'dot', run gv on the postscript file, then cleanup.
static void writeCFGToDotFile(Function &F)
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
void setPreservesAll()
Set by analyses that do not transform their input at all.
The file should be opened in text mode on platforms that make this distinction.
void initializeCFGViewerLegacyPassPass(PassRegistry &)
void initializeCFGPrinterLegacyPassPass(PassRegistry &)
A raw_ostream that writes to a file descriptor.
This class implements an extremely fast bulk output stream that can only output to a stream...
A container for analyses that lazily runs them and caches their results.
void initializeCFGOnlyViewerLegacyPassPass(PassRegistry &)
void viewCFG() const
viewCFG - This function is meant for use from the debugger.