aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-06-06 12:08:01 +0000
committerDuncan Sands <baldrick@free.fr>2008-06-06 12:08:01 +0000
commit83ec4b6711980242ef3c55a4fa36b2d7a39c1bfb (patch)
tree318323f012863299f9ae063e79a47985c2e8dc4b /lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
parentcc41940dff771c98321d601e04e60dc8c67b6e87 (diff)
Wrap MVT::ValueType in a struct to get type safety
and better control the abstraction. Rename the type to MVT. To update out-of-tree patches, the main thing to do is to rename MVT::ValueType to MVT, and rewrite expressions like MVT::getSizeInBits(VT) in the form VT.getSizeInBits(). Use VT.getSimpleVT() to extract a MVT::SimpleValueType for use in switch statements (you will get an assert failure if VT is an extended value type - these shouldn't exist after type legalization). This results in a small speedup of codegen and no new testsuite failures (x86-64 linux). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52044 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index 904638d4f7..f922168019 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -48,7 +48,7 @@ namespace llvm {
template<typename EdgeIter>
static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
SDOperand Op = EI.getNode()->getOperand(EI.getOperand());
- MVT::ValueType VT = Op.getValueType();
+ MVT VT = Op.getValueType();
if (VT == MVT::Flag)
return "color=red,style=bold";
else if (VT == MVT::Other)
@@ -90,7 +90,7 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
if (Node->getValueType(i) == MVT::Other)
Op += ":ch";
else
- Op = Op + ":" + MVT::getValueTypeString(Node->getValueType(i));
+ Op = Op + ":" + Node->getValueType(i).getMVTString();
if (const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(Node)) {
Op += ": " + utostr(CSDN->getValue());
@@ -154,7 +154,7 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
} else if (const ARG_FLAGSSDNode *N = dyn_cast<ARG_FLAGSSDNode>(Node)) {
Op = Op + " AF=" + N->getArgFlags().getArgFlagsString();
} else if (const VTSDNode *N = dyn_cast<VTSDNode>(Node)) {
- Op = Op + " VT=" + MVT::getValueTypeString(N->getVT());
+ Op = Op + " VT=" + N->getVT().getMVTString();
} else if (const StringSDNode *N = dyn_cast<StringSDNode>(Node)) {
Op = Op + "\"" + N->getValue() + "\"";
} else if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(Node)) {
@@ -172,7 +172,7 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
break;
}
if (doExt)
- Op += MVT::getValueTypeString(LD->getMemoryVT()) + ">";
+ Op += LD->getMemoryVT().getMVTString() + ">";
if (LD->isVolatile())
Op += "<V>";
Op += LD->getIndexedModeName(LD->getAddressingMode());
@@ -180,7 +180,7 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
Op += " A=" + utostr(LD->getAlignment());
} else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(Node)) {
if (ST->isTruncatingStore())
- Op += "<trunc " + MVT::getValueTypeString(ST->getMemoryVT()) + ">";
+ Op += "<trunc " + ST->getMemoryVT().getMVTString() + ">";
if (ST->isVolatile())
Op += "<V>";
Op += ST->getIndexedModeName(ST->getAddressingMode());