summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-05 09:38:03 +0000
committerChris Lattner <sabre@nondot.org>2006-03-05 09:38:03 +0000
commitc610e62e46e9c6e0c9714fc9d58f40d14900ebd2 (patch)
treecab26dce898588ae6b57e028609d9acadcd4ede7 /llvm/lib
parentd428e22c073dead59e9ea841e17e367490eb097e (diff)
downloadbcm5719-llvm-c610e62e46e9c6e0c9714fc9d58f40d14900ebd2.tar.gz
bcm5719-llvm-c610e62e46e9c6e0c9714fc9d58f40d14900ebd2.zip
print arbitrary constant pool entries
llvm-svn: 26545
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index 61e4e021242..0638807af7a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -13,6 +13,7 @@
#include "llvm/Constants.h"
#include "llvm/Function.h"
+#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Target/MRegisterInfo.h"
@@ -22,6 +23,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/Config/config.h"
#include <fstream>
+#include <sstream>
using namespace llvm;
namespace llvm {
@@ -81,6 +83,13 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
} else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Node)){
if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->get()))
Op += "<" + ftostr(CFP->getValue()) + ">";
+ else if (ConstantInt *CI = dyn_cast<ConstantInt>(CP->get()))
+ Op += "<" + utostr(CI->getZExtValue()) + ">";
+ else {
+ std::ostringstream SS;
+ WriteAsOperand(SS, CP->get(), false);
+ Op += "<" + SS.str() + ">";
+ }
} else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(Node)) {
Op = "BB: ";
const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock();
OpenPOWER on IntegriCloud