summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/CFGPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-22 16:30:58 +0000
committerChris Lattner <sabre@nondot.org>2003-10-22 16:30:58 +0000
commitaa81dce20cb0e862455b0b3f88c1d2129cdfb5a0 (patch)
tree36b483da15753f9b2896896d8c53ff24345ec803 /llvm/lib/Analysis/CFGPrinter.cpp
parent9d63afdea554336e27f3cbc38b9e1f071e280662 (diff)
downloadbcm5719-llvm-aa81dce20cb0e862455b0b3f88c1d2129cdfb5a0.tar.gz
bcm5719-llvm-aa81dce20cb0e862455b0b3f88c1d2129cdfb5a0.zip
Make sure to print labels on nodes without names
llvm-svn: 9376
Diffstat (limited to 'llvm/lib/Analysis/CFGPrinter.cpp')
-rw-r--r--llvm/lib/Analysis/CFGPrinter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/CFGPrinter.cpp b/llvm/lib/Analysis/CFGPrinter.cpp
index 4d6819d4fa4..ac93d4c1ca0 100644
--- a/llvm/lib/Analysis/CFGPrinter.cpp
+++ b/llvm/lib/Analysis/CFGPrinter.cpp
@@ -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());
OpenPOWER on IntegriCloud