28 cl::desc(
"The name of a function (or its substring)" 29 " whose CFG is viewed/printed."));
33 cl::desc(
"The prefix used for the CFG dot file names."));
56 INITIALIZE_PASS(CFGViewerLegacyPass,
"view-cfg",
"View CFG of function",
false,
true)
87 "View CFG of function (with no function bodies)",
false,
true)
98 std::string Filename =
100 errs() <<
"Writing '" << Filename <<
"'...";
108 errs() <<
" error opening file for writing!";
133 INITIALIZE_PASS(CFGPrinterLegacyPass,
"dot-cfg",
"Print CFG of function to 'dot' file",
163 "Print CFG of function to 'dot' file (with no function bodies)",
195 return new CFGPrinterLegacyPass();
199 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...
This class represents lattice values for constants.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool contains(StringRef Other) const
Return true if the given string is a substring of *this, and false otherwise.
static cl::opt< std::string > CFGFuncName("cfg-func-name", cl::Hidden, cl::desc("The name of a function (or its substring)" " whose CFG is viewed/printed."))
A Module instance is used to store all the information related to an LLVM module. ...
FunctionPass * createCFGPrinterLegacyPassPass()
static void writeCFGToDotFile(Function &F, bool CFGOnly=false)
static cl::opt< std::string > CFGDotFilenamePrefix("cfg-dot-filename-prefix", cl::Hidden, cl::desc("The prefix used for the CFG dot file names."))
INITIALIZE_PASS(CFGOnlyViewerLegacyPass, "view-cfg-only", "View CFG of function (with no function bodies)", false, true) PreservedAnalyses CFGOnlyViewerPass
*ViewGraph Emit a dot run run gv on the postscript *then cleanup For use from the debugger *void ViewGraph(const GraphType &G, const Twine &Name, bool ShortNames=false, const Twine &Title="", GraphProgram::Name Program=GraphProgram::DOT)
void initializeCFGOnlyPrinterLegacyPassPass(PassRegistry &)
static StringRef getName(Value *V)
void viewCFG() const
viewCFG - This function is meant for use from the debugger.
raw_ostream & WriteGraph(raw_ostream &O, const GraphType &G, bool ShortNames=false, const Twine &Title="")
static bool runOnFunction(Function &F, bool PostInlining)
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
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.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
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.
void initializeCFGViewerLegacyPassPass(PassRegistry &)
void initializeCFGPrinterLegacyPassPass(PassRegistry &)
A raw_ostream that writes to a file descriptor.
StringRef getName() const
Return a constant reference to the value's name.
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 &)