From: Chris Lattner Date: Wed, 5 Oct 2005 06:34:34 +0000 (+0000) Subject: add a helper class X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d623e953fc5f46b013994dfa4651cff4d17af159;p=oota-llvm.git add a helper class git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23633 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 0ccd8e1c06a..1f3604a5ae8 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -309,6 +309,9 @@ namespace ISD { // 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 @@ inline bool SDOperand::hasOneUse() const { 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;