30 cl::desc(
"Show only simple regions in the graphviz viewer"),
48 ::getSimpleNodeLabel(BB, BB->
getParent());
54 return "Not implemented";
65 return "Region Graph";
87 while (R && R->getParent())
88 if (R->getParent()->getEntry() == destBB)
93 if (R->getEntry() == destBB && R->contains(srcBB))
94 return "constraint=false";
102 unsigned depth = 0) {
104 O.
indent(2 * depth) <<
"subgraph cluster_" <<
static_cast<const void*
>(R)
106 O.
indent(2 * (depth + 1)) <<
"label = \"\";\n";
109 O.
indent(2 * (depth + 1)) <<
"style = filled;\n";
110 O.
indent(2 * (depth + 1)) <<
"color = "
111 << ((R->
getDepth() * 2 % 12) + 1) <<
"\n";
114 O.
indent(2 * (depth + 1)) <<
"style = solid;\n";
115 O.
indent(2 * (depth + 1)) <<
"color = "
116 << ((R->
getDepth() * 2 % 12) + 2) <<
"\n";
120 printRegionCluster(*RI, GW, depth + 1);
127 O.
indent(2 * (depth + 1)) <<
"Node"
131 O.
indent(2 * depth) <<
"}\n";
137 O <<
"\tcolorscheme = \"paired12\"\n";
154 struct RegionOnlyViewer
175 "Print regions of function to 'dot' file",
true,
true)
181 "View regions of function (with no function bodies)",
186 struct RegionOnlyPrinter
189 RegionOnlyPrinter() :
199 "Print regions of function to 'dot' file "
200 "(with no function bodies)",
204 return new RegionViewer();
208 return new RegionOnlyViewer();
212 return new RegionPrinter();
216 return new RegionOnlyPrinter();
unsigned getDepth() const
Get the nesting level of this Region.
static PassRegistry * getPassRegistry()
static std::string getGraphName(RegionInfo *DT)
void initializeRegionViewerPass(PassRegistry &)
void initializeRegionPrinterPass(PassRegistry &)
block_iterator block_begin()
Region * getRegionFor(BasicBlock *BB) const
Get the smallest region that contains a BasicBlock.
RegionSet::const_iterator const_iterator
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.
A RegionNode represents a subregion or a BasicBlock that is part of a Region.
INITIALIZE_PASS(RegionPrinter,"dot-regions","Print regions of function to 'dot' file", true, true) INITIALIZE_PASS(RegionViewer
raw_ostream & getOStream()
FunctionPass * createRegionOnlyViewerPass()
RegionInfo * getRegionInfo() const
Return the RegionInfo object, that belongs to this Region.
DOTGraphTraits(bool isSimple=false)
DOTGraphTraits(bool isSimple=false)
std::string getNodeLabel(RegionNode *Node, RegionInfo *G)
block_iterator block_end()
ID
LLVM Calling Convention Representation.
std::string getNodeLabel(const void *, const GraphType &)
view View regions of function
FunctionPass * createRegionOnlyPrinterPass()
Region * getParent() const
Get the parent of the Region.
static void printRegionCluster(const Region *R, GraphWriter< RegionInfo * > &GW, unsigned depth=0)
initializer< Ty > init(const Ty &Val)
static void addCustomGraphFeatures(const RegionInfo *RI, GraphWriter< RegionInfo * > &GW)
LLVM Basic Block Representation.
A single entry single exit Region.
bool isSimple() const
Is this a simple region?
FunctionPass * createRegionViewerPass()
RegionNode * getBBNode(BasicBlock *BB) const
Get the BasicBlock RegionNode for a BasicBlock.
Region * getTopLevelRegion() const
FunctionPass * createRegionPrinterPass()
void initializeRegionOnlyViewerPass(PassRegistry &)
void initializeRegionOnlyPrinterPass(PassRegistry &)
bool isSubRegion() const
Is this RegionNode a subregion?
view View regions of true
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.
T * getNodeAs() const
Get the content of this RegionNode.
std::string getEdgeAttributes(RegionNode *srcNode, GraphTraits< RegionInfo * >::ChildIteratorType CI, RegionInfo *RI)
Analysis that detects all canonical Regions.