aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-11-29 06:21:05 +0000
committerChris Lattner <sabre@nondot.org>2005-11-29 06:21:05 +0000
commit36ce69195ed488034d0bb11180cc2ebd923679c8 (patch)
tree0233e6a89710fe69222f7d1e3b25bb553df3e45f /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent02fc8ff80091c38760670c2b91e0f487dcc6b8a3 (diff)
Add support for a new STRING and LOCATION node for line number support, patch
contributed by Daniel Berlin, with a few cleanups here and there by me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 7676ead355..1eb95864c0 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -274,6 +274,9 @@ void SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
Erased = ConstantFPs.erase(std::make_pair(V, N->getValueType(0)));
break;
}
+ case ISD::STRING:
+ Erased = StringNodes.erase(cast<StringSDNode>(N)->getValue());
+ break;
case ISD::CONDCODE:
assert(CondCodeNodes[cast<CondCodeSDNode>(N)->get()] &&
"Cond code doesn't exist!");
@@ -448,6 +451,15 @@ SDOperand SelectionDAG::getConstant(uint64_t Val, MVT::ValueType VT) {
return SDOperand(N, 0);
}
+SDOperand SelectionDAG::getString(const std::string &Val) {
+ StringSDNode *&N = StringNodes[Val];
+ if (!N) {
+ N = new StringSDNode(Val);
+ AllNodes.push_back(N);
+ }
+ return SDOperand(N, 0);
+}
+
SDOperand SelectionDAG::getTargetConstant(uint64_t Val, MVT::ValueType VT) {
assert(MVT::isInteger(VT) && "Cannot create FP integer constant!");
// Mask out any bits that are not valid for this constant.
@@ -1670,6 +1682,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
case ISD::READCYCLECOUNTER: return "ReadCycleCounter";
case ISD::SRCVALUE: return "SrcValue";
case ISD::VALUETYPE: return "ValueType";
+ case ISD::STRING: return "String";
case ISD::EntryToken: return "EntryToken";
case ISD::TokenFactor: return "TokenFactor";
case ISD::AssertSext: return "AssertSext";
@@ -1787,6 +1800,9 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
case ISD::READIO: return "readio";
case ISD::WRITEIO: return "writeio";
+ // Debug info
+ case ISD::LOCATION: return "location";
+
case ISD::CONDCODE:
switch (cast<CondCodeSDNode>(this)->get()) {
default: assert(0 && "Unknown setcc condition!");