aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-19 22:31:04 +0000
committerChris Lattner <sabre@nondot.org>2005-08-19 22:31:04 +0000
commitaaaa0b67dd0a943ee9275c42d7df4bd244d52c95 (patch)
treefa7d10036b9662a205eedfadfa797fc355968a32 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent7ef330478ff7f87fece5144ebeb5783894fa3f33 (diff)
Add support for TargetGlobalAddress nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index fdefa93028..405933d331 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -255,6 +255,9 @@ void SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
case ISD::GlobalAddress:
GlobalValues.erase(cast<GlobalAddressSDNode>(N)->getGlobal());
break;
+ case ISD::TargetGlobalAddress:
+ TargetGlobalValues.erase(cast<GlobalAddressSDNode>(N)->getGlobal());
+ break;
case ISD::FrameIndex:
FrameIndices.erase(cast<FrameIndexSDNode>(N)->getIndex());
break;
@@ -413,7 +416,16 @@ SDOperand SelectionDAG::getGlobalAddress(const GlobalValue *GV,
MVT::ValueType VT) {
SDNode *&N = GlobalValues[GV];
if (N) return SDOperand(N, 0);
- N = new GlobalAddressSDNode(GV,VT);
+ N = new GlobalAddressSDNode(false, GV, VT);
+ AllNodes.push_back(N);
+ return SDOperand(N, 0);
+}
+
+SDOperand SelectionDAG::getTargetGlobalAddress(const GlobalValue *GV,
+ MVT::ValueType VT) {
+ SDNode *&N = TargetGlobalValues[GV];
+ if (N) return SDOperand(N, 0);
+ N = new GlobalAddressSDNode(true, GV, VT);
AllNodes.push_back(N);
return SDOperand(N, 0);
}
@@ -1907,6 +1919,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
case ISD::TargetConstant: return "TargetConstant";
case ISD::ConstantFP: return "ConstantFP";
case ISD::GlobalAddress: return "GlobalAddress";
+ case ISD::TargetGlobalAddress: return "TargetGlobalAddress";
case ISD::FrameIndex: return "FrameIndex";
case ISD::BasicBlock: return "BasicBlock";
case ISD::Register: return "Register";