30 cl::desc(
"Show only simple regions in the graphviz viewer"),
48 ::getSimpleNodeLabel(BB, BB->
getParent());
54 return "Not implemented";
65 return "Region Graph";
88 while (R && R->getParent())
89 if (R->getParent()->getEntry() == destBB)
94 if (R->getEntry() == destBB && R->contains(srcBB))
95 return "constraint=false";
104 unsigned depth = 0) {
106 O.
indent(2 * depth) <<
"subgraph cluster_" <<
static_cast<const void*
>(&R)
108 O.
indent(2 * (depth + 1)) <<
"label = \"\";\n";
111 O.
indent(2 * (depth + 1)) <<
"style = filled;\n";
112 O.
indent(2 * (depth + 1)) <<
"color = "
113 << ((R.
getDepth() * 2 % 12) + 1) <<
"\n";
116 O.
indent(2 * (depth + 1)) <<
"style = solid;\n";
117 O.
indent(2 * (depth + 1)) <<
"color = "
118 << ((R.
getDepth() * 2 % 12) + 2) <<
"\n";
122 printRegionCluster(**RI, GW, depth + 1);
126 for (
auto *BB : R.
blocks())
128 O.
indent(2 * (depth + 1)) <<
"Node"
132 O.
indent(2 * depth) <<
"}\n";
139 O <<
"\tcolorscheme = \"paired12\"\n";
156 struct RegionOnlyViewer
177 "Print regions of function to 'dot' file",
true,
true)
183 "View regions of function (with no function bodies)",
188 struct RegionOnlyPrinter
191 RegionOnlyPrinter() :
201 "Print regions of function to 'dot' file "
202 "(with no function bodies)",
206 return new RegionViewer();
210 return new RegionOnlyViewer();
214 return new RegionPrinter();
218 return new RegionOnlyPrinter();
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
bool isSimple() const
Is this a simple region?
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
void initializeRegionViewerPass(PassRegistry &)
void initializeRegionPrinterPass(PassRegistry &)
std::string getNodeLabel(RegionNode *Node, RegionNode *Graph)
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
const Function * getParent() const
Return the enclosing method, or null if none.
bool isSubRegion() const
Is this RegionNode a subregion?
RegionT * getTopLevelRegion() const
T * getNodeAs() const
Get the content of this RegionNode.
RegionT * getRegionFor(BlockT *BB) const
Get the smallest region that contains a BasicBlock.
INITIALIZE_PASS(RegionPrinter,"dot-regions","Print regions of function to 'dot' file", true, true) INITIALIZE_PASS(RegionViewer
raw_ostream & getOStream()
getOStream - Get the raw output stream into the graph file.
RegionInfoT * getRegionInfo() const
Return the RegionInfo object, that belongs to this Region.
FunctionPass * createRegionOnlyViewerPass()
unsigned getDepth() const
Get the nesting level of this Region.
DOTGraphTraits(bool isSimple=false)
RegionInfo & getRegionInfo()
block_range blocks()
Returns a range view of the basic blocks in the region.
std::string getNodeLabel(const void *, const GraphType &)
getNodeLabel - Given a node and a pointer to the top level graph, return the label to print in the no...
view View regions of function
FunctionPass * createRegionOnlyPrinterPass()
initializer< Ty > init(const Ty &Val)
LLVM Basic Block Representation.
static void printRegionCluster(const Region &R, GraphWriter< RegionInfoPass * > &GW, unsigned depth=0)
FunctionPass class - This class is used to implement most global optimizations.
FunctionPass * createRegionViewerPass()
std::string getNodeLabel(RegionNode *Node, RegionInfoPass *G)
DOTGraphTraits - Template class that can be specialized to customize how graphs are converted to 'dot...
FunctionPass * createRegionPrinterPass()
void initializeRegionOnlyViewerPass(PassRegistry &)
std::string getEdgeAttributes(RegionNode *srcNode, GraphTraits< RegionInfo * >::ChildIteratorType CI, RegionInfoPass *G)
static void addCustomGraphFeatures(const RegionInfoPass *RIP, GraphWriter< RegionInfoPass * > &GW)
void initializeRegionOnlyPrinterPass(PassRegistry &)
DOTGraphTraits(bool isSimple=false)
view View regions of true
RegionSet::const_iterator const_iterator
static cl::opt< bool > onlySimpleRegions("only-simple-regions", cl::desc("Show only simple regions in the graphviz viewer"), cl::Hidden, cl::init(false))
onlySimpleRegion - Show only the simple regions in the RegionViewer.
This class implements an extremely fast bulk output stream that can only output to a stream...
DefaultDOTGraphTraits - This class provides the default implementations of all of the DOTGraphTraits ...
static std::string getGraphName(RegionInfoPass *DT)