diff options
| author | Dan Gohman <gohman@apple.com> | 2008-07-27 20:43:25 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-07-27 20:43:25 +0000 |
| commit | 0c97f1da6784c4097fd6c9d1a15813ad9802cc5b (patch) | |
| tree | 254f94bf8a78f2a8cc7db6d7c40c26cca95c4023 /include/llvm/CodeGen/SelectionDAGNodes.h | |
| parent | ef69561ff8b09023199898ea6423701dadf42d5d (diff) | |
| download | external_llvm-0c97f1da6784c4097fd6c9d1a15813ad9802cc5b.zip external_llvm-0c97f1da6784c4097fd6c9d1a15813ad9802cc5b.tar.gz external_llvm-0c97f1da6784c4097fd6c9d1a15813ad9802cc5b.tar.bz2 | |
Tidy SDNode::use_iterator, and complete the transition to have it
parallel its analogue, Value::value_use_iterator. The operator* method
now returns the user, rather than the use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54127 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
| -rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 9690d8d..dae3a55 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -932,7 +932,7 @@ public: return *this; } - SDUse * getNext() { return Next; } + SDUse *getNext() { return Next; } SDNode *getUser() { return User; } @@ -942,7 +942,7 @@ public: const SDOperand& getSDOperand() const { return Operand; } - SDNode* &getVal () { return Operand.Val; } + SDNode *&getVal() { return Operand.Val; } bool operator==(const SDOperand &O) const { return Operand == O; @@ -1156,33 +1156,27 @@ public: use_iterator tmp = *this; ++*this; return tmp; } - - /// getOperandNum - Retrive a number of a current operand. - unsigned getOperandNum() const { + /// Retrieve a pointer to the current user node. + SDNode *operator*() const { assert(Op && "Cannot dereference end iterator!"); - return (unsigned)(Op - Op->getUser()->OperandList); + return Op->getUser(); } - /// Retrieve a reference to the current operand. - SDUse &operator*() const { - assert(Op && "Cannot dereference end iterator!"); - return *Op; - } + SDNode *operator->() const { return operator*(); } + + SDUse &getUse() const { return *Op; } - /// Retrieve a pointer to the current operand. - SDUse *operator->() const { + /// getOperandNo - Retrive the operand # of this use in its user. + /// + unsigned getOperandNo() const { assert(Op && "Cannot dereference end iterator!"); - return Op; + return (unsigned)(Op - Op->getUser()->OperandList); } }; /// use_begin/use_end - Provide iteration support to walk over all uses /// of an SDNode. - use_iterator use_begin(SDNode *node) const { - return use_iterator(node->Uses); - } - use_iterator use_begin() const { return use_iterator(Uses); } |
