Skip to content

Commit bf8f0d9

Browse files
committed
Use for-range loop
1 parent 235b629 commit bf8f0d9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,17 +2356,14 @@ void SelectionDAGLegalize::ExpandSinCosLibCall(
23562356
// Find users of the node that store the results. The destination pointers
23572357
// can be used instead of creating stack allocations.
23582358
std::array<StoreSDNode *, 2> ResultStores = {nullptr};
2359-
for (SDNode::use_iterator UI = Node->use_begin(), UE = Node->use_end();
2360-
UI != UE; ++UI) {
2361-
SDUse &Use = UI.getUse();
2362-
SDNode *User = Use.getUser();
2359+
for (SDNode *User : Node->uses()) {
23632360
if (!ISD::isNormalStore(User))
23642361
continue;
23652362
auto *ST = cast<StoreSDNode>(User);
23662363
if (!ST->isSimple() || ST->getAddressSpace() != 0 ||
23672364
ST->getAlign() < DAG.getDataLayout().getABITypeAlign(Ty))
23682365
continue;
2369-
ResultStores[Use.getResNo()] = ST;
2366+
ResultStores[ST->getValue().getResNo()] = ST;
23702367
}
23712368

23722369
// Collect input chains (and avoid chains referring to one of the stores).

0 commit comments

Comments
 (0)