diff options
author | Dan Gohman <gohman@apple.com> | 2009-03-20 20:42:23 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-03-20 20:42:23 +0000 |
commit | db95fa131a229652f925794ca7a5b84e9490050b (patch) | |
tree | db49f8c7105d5a3d82cdeb4ca34a67dc3701aa34 /lib | |
parent | 697cbbfb00c318f98d6eb51945f077e2bfe8781e (diff) | |
download | external_llvm-db95fa131a229652f925794ca7a5b84e9490050b.zip external_llvm-db95fa131a229652f925794ca7a5b84e9490050b.tar.gz external_llvm-db95fa131a229652f925794ca7a5b84e9490050b.tar.bz2 |
Simplify this code; use a while instead of an if and a do-while.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67400 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp index ea9f47b..967a8ce 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp @@ -105,18 +105,15 @@ void ScheduleDAGSDNodes::BuildSchedUnits() { // See if anything is flagged to this node, if so, add them to flagged // nodes. Nodes can have at most one flag input and one flag output. Flags - // are required the be the last operand and result of a node. + // are required to be the last operand and result of a node. // Scan up to find flagged preds. SDNode *N = NI; - if (N->getNumOperands() && - N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Flag) { - do { - N = N->getOperand(N->getNumOperands()-1).getNode(); - assert(N->getNodeId() == -1 && "Node already inserted!"); - N->setNodeId(NodeSUnit->NodeNum); - } while (N->getNumOperands() && - N->getOperand(N->getNumOperands()-1).getValueType()== MVT::Flag); + while (N->getNumOperands() && + N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Flag) { + N = N->getOperand(N->getNumOperands()-1).getNode(); + assert(N->getNodeId() == -1 && "Node already inserted!"); + N->setNodeId(NodeSUnit->NodeNum); } // Scan down to find any flagged succs. |