[ARM64,C++11]: Range'ify use-list iterators in DAGToDAG.

llvm-svn: 206007
This commit is contained in:
Jim Grosbach 2014-04-11 00:27:22 +00:00
parent d3249d0923
commit 8838d793b7
1 changed files with 3 additions and 6 deletions

View File

@ -720,8 +720,7 @@ bool ARM64DAGToDAGISel::SelectAddrModeRO(SDValue N, unsigned Size,
// operation. If yes, do not try to fold this node into the address // operation. If yes, do not try to fold this node into the address
// computation, since the computation will be kept. // computation, since the computation will be kept.
const SDNode *Node = N.getNode(); const SDNode *Node = N.getNode();
for (SDNode::use_iterator UI = Node->use_begin(), UE = Node->use_end(); for (SDNode *UI : Node->uses()) {
UI != UE; ++UI) {
if (!isa<MemSDNode>(*UI)) if (!isa<MemSDNode>(*UI))
return false; return false;
} }
@ -1573,12 +1572,10 @@ static void getUsefulBits(SDValue Op, APInt &UsefulBits, unsigned Depth) {
} }
APInt UsersUsefulBits(UsefulBits.getBitWidth(), 0); APInt UsersUsefulBits(UsefulBits.getBitWidth(), 0);
for (SDNode::use_iterator UseIt = Op.getNode()->use_begin(), for (SDNode *Node : Op.getNode()->uses()) {
UseEnd = Op.getNode()->use_end();
UseIt != UseEnd; ++UseIt) {
// A use cannot produce useful bits // A use cannot produce useful bits
APInt UsefulBitsForUse = APInt(UsefulBits); APInt UsefulBitsForUse = APInt(UsefulBits);
getUsefulBitsForUse(*UseIt, UsefulBitsForUse, Op, Depth); getUsefulBitsForUse(Node, UsefulBitsForUse, Op, Depth);
UsersUsefulBits |= UsefulBitsForUse; UsersUsefulBits |= UsefulBitsForUse;
} }
// UsefulBits contains the produced bits that are meaningful for the // UsefulBits contains the produced bits that are meaningful for the