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 | 91e5dcb68054d2e481863528ba15b69b6821b50b (patch) | |
tree | eb84d6d611149cc8dc14bf877d22e71c09ce4cf2 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 108c58aef4bd9f70af87c513e557c43cc373c262 (diff) | |
download | bcm5719-llvm-91e5dcb68054d2e481863528ba15b69b6821b50b.tar.gz bcm5719-llvm-91e5dcb68054d2e481863528ba15b69b6821b50b.zip |
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.
llvm-svn: 54127
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 366cb4c4294..c37fa38a058 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -4138,7 +4138,7 @@ void SelectionDAG::ReplaceAllUsesWith(SDOperand FromN, SDOperand To, while (!From->use_empty()) { SDNode::use_iterator UI = From->use_begin(); - SDNode *U = UI->getUser(); + SDNode *U = *UI; // This node is about to morph, remove its old self from the CSE maps. RemoveNodeFromCSEMaps(U); @@ -4187,7 +4187,7 @@ void SelectionDAG::ReplaceAllUsesWith(SDNode *From, SDNode *To, while (!From->use_empty()) { SDNode::use_iterator UI = From->use_begin(); - SDNode *U = UI->getUser(); + SDNode *U = *UI; // This node is about to morph, remove its old self from the CSE maps. RemoveNodeFromCSEMaps(U); @@ -4230,7 +4230,7 @@ void SelectionDAG::ReplaceAllUsesWith(SDNode *From, while (!From->use_empty()) { SDNode::use_iterator UI = From->use_begin(); - SDNode *U = UI->getUser(); + SDNode *U = *UI; // This node is about to morph, remove its old self from the CSE maps. RemoveNodeFromCSEMaps(U); @@ -4276,16 +4276,9 @@ void SelectionDAG::ReplaceAllUsesOfValueWith(SDOperand From, SDOperand To, return; } - if (From.use_empty()) return; - // Get all of the users of From.Val. We want these in a nice, // deterministically ordered and uniqued set, so we use a SmallSetVector. - SmallSetVector<SDNode*, 16> Users; - for (SDNode::use_iterator UI = From.Val->use_begin(), - E = From.Val->use_end(); UI != E; ++UI) { - SDNode *User = UI->getUser(); - Users.insert(User); - } + SmallSetVector<SDNode*, 16> Users(From.Val->use_begin(), From.Val->use_end()); while (!Users.empty()) { // We know that this user uses some value of From. If it is the right @@ -4350,7 +4343,7 @@ void SelectionDAG::ReplaceAllUsesOfValuesWith(const SDOperand *From, for (unsigned i = 0; i != Num; ++i) for (SDNode::use_iterator UI = From[i].Val->use_begin(), E = From[i].Val->use_end(); UI != E; ++UI) - Users.push_back(std::make_pair(UI->getUser(), i)); + Users.push_back(std::make_pair(*UI, i)); while (!Users.empty()) { // We know that this user uses some value of From. If it is the right @@ -4556,7 +4549,7 @@ bool SDNode::hasNUsesOfValue(unsigned NUses, unsigned Value) const { // TODO: Only iterate over uses of a given value of the node for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) { - if (UI->getSDOperand().ResNo == Value) { + if (UI.getUse().getSDOperand().ResNo == Value) { if (NUses == 0) return false; --NUses; @@ -4574,7 +4567,7 @@ bool SDNode::hasAnyUseOfValue(unsigned Value) const { assert(Value < getNumValues() && "Bad value!"); for (SDNode::use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) - if (UI->getSDOperand().ResNo == Value) + if (UI.getUse().getSDOperand().ResNo == Value) return true; return false; @@ -4586,7 +4579,7 @@ bool SDNode::hasAnyUseOfValue(unsigned Value) const { bool SDNode::isOnlyUserOf(SDNode *N) const { bool Seen = false; for (SDNode::use_iterator I = N->use_begin(), E = N->use_end(); I != E; ++I) { - SDNode *User = I->getUser(); + SDNode *User = *I; if (User == this) Seen = true; else |