aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-09-12 21:00:35 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-09-12 21:00:35 +0000
commitd6594ae54cfde4db4d30272192645c0a45fb9902 (patch)
tree7b89d2a0c89f9fc9bdb58acad508acd59cf3702d /lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
parentcd5731d98b15c9de236bd0dd6c9c57d9bcecbceb (diff)
Added support for machine specific constantpool values. These are useful for
representing expressions that can only be resolved at link time, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index 28baa32449..1669c08a40 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -15,6 +15,7 @@
#include "llvm/Function.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/SelectionDAG.h"
+#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Target/MRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"
@@ -80,14 +81,20 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
} else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(Node)) {
Op += " " + itostr(FIDN->getIndex());
} 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 {
+ if (CP->isMachineConstantPoolEntry()) {
std::ostringstream SS;
- WriteAsOperand(SS, CP->get(), false);
+ CP->getMachineCPVal()->print(SS);
Op += "<" + SS.str() + ">";
+ } else {
+ if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->getConstVal()))
+ Op += "<" + ftostr(CFP->getValue()) + ">";
+ else if (ConstantInt *CI = dyn_cast<ConstantInt>(CP->getConstVal()))
+ Op += "<" + utostr(CI->getZExtValue()) + ">";
+ else {
+ std::ostringstream SS;
+ WriteAsOperand(SS, CP->getConstVal(), false);
+ Op += "<" + SS.str() + ">";
+ }
}
} else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(Node)) {
Op = "BB: ";