[llvm-commits] CVS: llvm/lib/Analysis/CFGPrinter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Oct 22 11:32:01 PDT 2003
Changes in directory llvm/lib/Analysis:
CFGPrinter.cpp updated: 1.2 -> 1.3
---
Log message:
Make sure to print labels on nodes without names
---
Diffs of the changes: (+7 -1)
Index: llvm/lib/Analysis/CFGPrinter.cpp
diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.2 llvm/lib/Analysis/CFGPrinter.cpp:1.3
--- llvm/lib/Analysis/CFGPrinter.cpp:1.2 Wed Oct 22 11:22:42 2003
+++ llvm/lib/Analysis/CFGPrinter.cpp Wed Oct 22 11:30:58 2003
@@ -40,12 +40,18 @@
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) {
WriteAsOperand(Out, Node, false, true);
return Out.str();
+ }
+
+ if (Node->getName().empty()) {
+ WriteAsOperand(Out, Node, false, true);
+ Out << ":";
}
Out << *Node;
More information about the llvm-commits
mailing list