mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-11 10:25:41 +00:00
Make sure to print labels on nodes without names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9376 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -40,7 +40,8 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
|
|||||||
|
|
||||||
static std::string getNodeLabel(const BasicBlock *Node,
|
static std::string getNodeLabel(const BasicBlock *Node,
|
||||||
const Function *Graph) {
|
const Function *Graph) {
|
||||||
if (CFGOnly && !Node->getName().empty()) return Node->getName() + ":";
|
if (CFGOnly && !Node->getName().empty())
|
||||||
|
return Node->getName() + ":";
|
||||||
|
|
||||||
std::ostringstream Out;
|
std::ostringstream Out;
|
||||||
if (CFGOnly) {
|
if (CFGOnly) {
|
||||||
@@ -48,6 +49,11 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
|
|||||||
return Out.str();
|
return Out.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Node->getName().empty()) {
|
||||||
|
WriteAsOperand(Out, Node, false, true);
|
||||||
|
Out << ":";
|
||||||
|
}
|
||||||
|
|
||||||
Out << *Node;
|
Out << *Node;
|
||||||
std::string OutStr = Out.str();
|
std::string OutStr = Out.str();
|
||||||
if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
|
if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
|
||||||
|
Reference in New Issue
Block a user