Skip to content

Commit 23ca7cf

Browse files
committed
[SelectionDAG] Use SDNode::op_iterator instead of SDNodeIterator. NFC
I think SDNodeIterator primarily exists because GraphTraits requires an iterator that dereferences to SDNode*. op_iterator dereferences to SDUse* which is implicitly convertible to SDValue. This piece of code can use SDValue instead of SDNode* so we should prefer to use the the more common op_iterator.
1 parent 29ed600 commit 23ca7cf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2986,8 +2986,7 @@ bool TargetLowering::SimplifyDemandedBits(
29862986
DemandedBits.isSubsetOf(Known.Zero | Known.One)) {
29872987
// Avoid folding to a constant if any OpaqueConstant is involved.
29882988
const SDNode *N = Op.getNode();
2989-
for (SDNode *Op :
2990-
llvm::make_range(SDNodeIterator::begin(N), SDNodeIterator::end(N))) {
2989+
for (SDValue Op : N->ops()) {
29912990
if (auto *C = dyn_cast<ConstantSDNode>(Op))
29922991
if (C->isOpaque())
29932992
return false;

0 commit comments

Comments
 (0)