[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Aug 19 15:31:16 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.152 -> 1.153
---
Log message:

Add support for TargetGlobalAddress nodes


---
Diffs of the changes:  (+14 -1)

 SelectionDAG.cpp |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.152 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.153
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.152	Fri Aug 19 16:34:13 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Fri Aug 19 17:31:04 2005
@@ -255,6 +255,9 @@
   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 @@
                                          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 @@
   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";






More information about the llvm-commits mailing list