llvm.org GIT mirror llvm / a75b3ef
If the basic block has no name, make sure to print the % number of it git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9375 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 15 years ago
1 changed file(s) with 7 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2020 #include "llvm/Pass.h"
2121 #include "llvm/Function.h"
2222 #include "llvm/iTerminators.h"
23 #include "llvm/Assembly/Writer.h"
2324 #include "llvm/Support/CFG.h"
2425 #include
2526 #include
3839
3940 static std::string getNodeLabel(const BasicBlock *Node,
4041 const Function *Graph) {
41 if (CFGOnly) return Node->getName() + ":";
42 if (CFGOnly && !Node->getName().empty()) return Node->getName() + ":";
4243
4344 std::ostringstream Out;
45 if (CFGOnly) {
46 WriteAsOperand(Out, Node, false, true);
47 return Out.str();
48 }
49
4450 Out << *Node;
4551 std::string OutStr = Out.str();
4652 if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());