Don't use a random type for the select condition,
[oota-llvm.git] / lib / CodeGen / SelectionDAG / SelectionDAGPrinter.cpp
index 8e3247fb673e2c89a66c0ae4837ab2a11960a63e..f1883744129467d77364227e9182d91ad4f6b175 100644 (file)
@@ -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 (int64_t 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)) {
@@ -186,8 +187,9 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
       Op += ", isVarArg";
     if (C->isTailCall())
       Op += ", isTailCall";
-  } else if (const SymbolSDNode *S = dyn_cast<SymbolSDNode>(Node)) {
-    Op += "'" + std::string(S->getSymbol()) + "'";
+  } else if (const ExternalSymbolSDNode *ES =
+             dyn_cast<ExternalSymbolSDNode>(Node)) {
+    Op += "'" + std::string(ES->getSymbol()) + "'";
   } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(Node)) {
     if (M->getValue())
       Op += "<" + M->getValue()->getName() + ">";