32 bool runOnFunction(
Function &
F)
override {
46 INITIALIZE_PASS(CFGViewer,
"view-cfg",
"View CFG of function",
false,
true)
55 bool runOnFunction(
Function &
F)
override {
70 "View CFG of function (with no function bodies)",
false,
true)
79 bool runOnFunction(
Function &
F)
override {
80 std::string Filename = (
"cfg." + F.
getName() +
".dot").str();
81 errs() <<
"Writing '" << Filename <<
"'...";
89 errs() <<
" error opening file for writing!";
113 bool runOnFunction(
Function &
F)
override {
114 std::string Filename = (
"cfg." + F.
getName() +
".dot").str();
115 errs() <<
"Writing '" << Filename <<
"'...";
123 errs() <<
" error opening file for writing!";
137 "Print CFG of function to 'dot' file (with no function bodies)",
159 return new CFGPrinter();
163 return new CFGOnlyPrinter();
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
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. ...
StringRef getName() const
Return a constant reference to the value's name.
static StringRef getName(Value *V)
void viewCFG() const
viewCFG - This function is meant for use from the debugger.
FunctionPass * createCFGPrinterPass()
void initializeCFGOnlyPrinterPass(PassRegistry &)
raw_ostream & WriteGraph(raw_ostream &O, const GraphType &G, bool ShortNames=false, const Twine &Title="")
INITIALIZE_PASS(CFGOnlyViewer,"view-cfg-only","View CFG of function (with no function bodies)", false, true) namespace
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.
void initializeCFGPrinterPass(PassRegistry &)
void initializeCFGOnlyViewerPass(PassRegistry &)
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.
A raw_ostream that writes to a file descriptor.
FunctionPass * createCFGOnlyPrinterPass()
This class implements an extremely fast bulk output stream that can only output to a stream...