diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-09-21 18:38:31 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-09-21 18:38:31 +0000 |
| commit | 43f5449c48be7d5af565685b9545185c429228d1 (patch) | |
| tree | 26fc66fbab3cf9c526f8e5d09f31499f7f992208 /llvm/lib/CodeGen | |
| parent | 9eca6af2f2372f97677c6b3f5b8fdc8936c88c51 (diff) | |
| download | bcm5719-llvm-43f5449c48be7d5af565685b9545185c429228d1.tar.gz bcm5719-llvm-43f5449c48be7d5af565685b9545185c429228d1.zip | |
don't print GlobalAddressSDNode's with an offset of zero as "foo0".
llvm-svn: 56399
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index caeaa838e9a..410f6157358 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -126,12 +126,13 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node, Op += ": " + ftostr(CSDN->getValueAPF()); } else if (const GlobalAddressSDNode *GADN = dyn_cast<GlobalAddressSDNode>(Node)) { - int offset = GADN->getOffset(); Op += ": " + GADN->getGlobal()->getName(); - if (offset > 0) - Op += "+" + itostr(offset); - else - Op += itostr(offset); + if (int Offset = GADN->getOffset()) { + if (Offset > 0) + Op += "+" + itostr(Offset); + else + Op += itostr(Offset); + } } else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(Node)) { Op += " " + itostr(FIDN->getIndex()); } else if (const JumpTableSDNode *JTDN = dyn_cast<JumpTableSDNode>(Node)) { |

