forked from OSchip/llvm-project
Make sure to print labels on nodes without names
llvm-svn: 9376
This commit is contained in:
parent
9d63afdea5
commit
aa81dce20c
|
@ -40,7 +40,8 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
|
|||
|
||||
static std::string getNodeLabel(const BasicBlock *Node,
|
||||
const Function *Graph) {
|
||||
if (CFGOnly && !Node->getName().empty()) return Node->getName() + ":";
|
||||
if (CFGOnly && !Node->getName().empty())
|
||||
return Node->getName() + ":";
|
||||
|
||||
std::ostringstream Out;
|
||||
if (CFGOnly) {
|
||||
|
@ -48,6 +49,11 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
|
|||
return Out.str();
|
||||
}
|
||||
|
||||
if (Node->getName().empty()) {
|
||||
WriteAsOperand(Out, Node, false, true);
|
||||
Out << ":";
|
||||
}
|
||||
|
||||
Out << *Node;
|
||||
std::string OutStr = Out.str();
|
||||
if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
|
||||
|
|
Loading…
Reference in New Issue