[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h

Chris Lattner lattner at cs.uiuc.edu
Tue Oct 4 23:34:46 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGNodes.h updated: 1.68 -> 1.69
---
Log message:

add a helper class


---
Diffs of the changes:  (+17 -0)

 SelectionDAGNodes.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+)


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.68 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.69
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.68	Wed Sep 28 17:26:50 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Wed Oct  5 01:34:34 2005
@@ -309,6 +309,9 @@
     // other operands match the intrinsic.  These produce a token chain in
     // addition to a value (if any).
     READPORT, WRITEPORT, READIO, WRITEIO,
+    
+    // HANDLENODE node - Used as a handle for various purposes.
+    HANDLENODE,
 
     // BUILTIN_OP_END - This must be the last enum value in this list.
     BUILTIN_OP_END,
@@ -751,6 +754,20 @@
   return Val->hasNUsesOfValue(1, ResNo);
 }
 
+/// HandleSDNode - This class is used to form a handle around another node that
+/// is persistant and is updated across invocations of replaceAllUsesWith on its
+/// operand.  This node should be directly created by end-users and not added to
+/// the AllNodes list.
+class HandleSDNode : public SDNode {
+public:
+  HandleSDNode(SDOperand X) : SDNode(ISD::HANDLENODE, X) {}
+  ~HandleSDNode() {
+    MorphNodeTo(ISD::HANDLENODE);  // Drops operand uses.
+  }
+  
+  SDOperand getValue() const { return getOperand(0); }
+};
+
 
 class ConstantSDNode : public SDNode {
   uint64_t Value;






More information about the llvm-commits mailing list