aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-09-21 18:38:31 +0000
committerChris Lattner <sabre@nondot.org>2008-09-21 18:38:31 +0000
commit1659476b8ad97985ff3c4fff02f39018582f2e5f (patch)
tree48c4b9c848ec85fefdfe60a8dea84c639c7b5f13 /lib
parent89c283fce3031e9231156d5d33a03f4377ce99c0 (diff)
downloadexternal_llvm-1659476b8ad97985ff3c4fff02f39018582f2e5f.zip
external_llvm-1659476b8ad97985ff3c4fff02f39018582f2e5f.tar.gz
external_llvm-1659476b8ad97985ff3c4fff02f39018582f2e5f.tar.bz2
don't print GlobalAddressSDNode's with an offset of zero as "foo0".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56399 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index caeaa83..410f615 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/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)) {