summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit435b402e1f0095cbe9568e91a2e736477dee7909 (patch)
treea5a8fc66da817f86002cfa004563f8fad182cad6 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent4d0251ad55a8e5143a7e64279f2f5d3ae0901676 (diff)
downloadbcm5719-llvm-435b402e1f0095cbe9568e91a2e736477dee7909.tar.gz
bcm5719-llvm-435b402e1f0095cbe9568e91a2e736477dee7909.zip
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. llvm-svn: 24515
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 7676ead3551..1eb95864c07 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/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!");
OpenPOWER on IntegriCloud