[llvm-commits] [llvm] r117765 - /llvm/trunk/lib/CodeGen/MachineFunction.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Fri Oct 29 18:26:20 PDT 2010
Author: stoklund
Date: Fri Oct 29 20:26:19 2010
New Revision: 117765
URL: http://llvm.org/viewvc/llvm-project?rev=117765&view=rev
Log:
Include MachineBasicBlock numbers in viewCFG() output.
Modified:
llvm/trunk/lib/CodeGen/MachineFunction.cpp
Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=117765&r1=117764&r2=117765&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Fri Oct 29 20:26:19 2010
@@ -347,17 +347,15 @@
std::string getNodeLabel(const MachineBasicBlock *Node,
const MachineFunction *Graph) {
- if (isSimple () && Node->getBasicBlock() &&
- !Node->getBasicBlock()->getName().empty())
- return Node->getBasicBlock()->getNameStr() + ":";
-
std::string OutStr;
{
raw_string_ostream OSS(OutStr);
-
- if (isSimple())
- OSS << Node->getNumber() << ':';
- else
+
+ if (isSimple()) {
+ OSS << "BB#" << Node->getNumber();
+ if (const BasicBlock *BB = Node->getBasicBlock())
+ OSS << ": " << BB->getName();
+ } else
Node->print(OSS);
}
More information about the llvm-commits
mailing list