File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
llvm/include/llvm/Support Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -187,10 +187,8 @@ template <class NodeT>
187
187
void PrintDomTree (const DomTreeNodeBase<NodeT> *N, raw_ostream &O,
188
188
unsigned Lev) {
189
189
O.indent (2 * Lev) << " [" << Lev << " ] " << N;
190
- for (typename DomTreeNodeBase<NodeT>::const_iterator I = N->begin (),
191
- E = N->end ();
192
- I != E; ++I)
193
- PrintDomTree<NodeT>(*I, O, Lev + 1 );
190
+ for (const auto &I : *N)
191
+ PrintDomTree<NodeT>(I, O, Lev + 1 );
194
192
}
195
193
196
194
namespace DomTreeBuilder {
Original file line number Diff line number Diff line change @@ -595,9 +595,7 @@ struct SemiNCAInfo {
595
595
// Attach the first unreachable block to AttachTo.
596
596
NodeToInfo[NumToNode[1 ]].IDom = AttachTo->getBlock ();
597
597
// Loop over all of the discovered blocks in the function...
598
- for (size_t i = 1 , e = NumToNode.size (); i != e; ++i) {
599
- NodePtr W = NumToNode[i];
600
-
598
+ for (NodePtr W : llvm::drop_begin (NumToNode)) {
601
599
// Don't replace this with 'count', the insertion side effect is important
602
600
if (DT.DomTreeNodes [W]) continue ; // Haven't calculated this node yet?
603
601
@@ -614,8 +612,7 @@ struct SemiNCAInfo {
614
612
615
613
void reattachExistingSubtree (DomTreeT &DT, const TreeNodePtr AttachTo) {
616
614
NodeToInfo[NumToNode[1 ]].IDom = AttachTo->getBlock ();
617
- for (size_t i = 1 , e = NumToNode.size (); i != e; ++i) {
618
- const NodePtr N = NumToNode[i];
615
+ for (const NodePtr N : llvm::drop_begin (NumToNode)) {
619
616
const TreeNodePtr TN = DT.getNode (N);
620
617
assert (TN);
621
618
const TreeNodePtr NewIDom = DT.getNode (NodeToInfo[N].IDom );
You can’t perform that action at this time.
0 commit comments