@@ -570,61 +570,61 @@ AttributeSetNode *AttributeSetNode::get(LLVMContext &C,
570
570
}
571
571
572
572
bool AttributeSetNode::hasAttribute (StringRef Kind) const {
573
- for (iterator I = begin (), E = end (); I != E; ++I )
574
- if (I-> hasAttribute (Kind))
573
+ for (Attribute I : * this )
574
+ if (I. hasAttribute (Kind))
575
575
return true ;
576
576
return false ;
577
577
}
578
578
579
579
Attribute AttributeSetNode::getAttribute (Attribute::AttrKind Kind) const {
580
580
if (hasAttribute (Kind)) {
581
- for (iterator I = begin (), E = end (); I != E; ++I )
582
- if (I-> hasAttribute (Kind))
583
- return * I;
581
+ for (Attribute I : * this )
582
+ if (I. hasAttribute (Kind))
583
+ return I;
584
584
}
585
585
return Attribute ();
586
586
}
587
587
588
588
Attribute AttributeSetNode::getAttribute (StringRef Kind) const {
589
- for (iterator I = begin (), E = end (); I != E; ++I )
590
- if (I-> hasAttribute (Kind))
591
- return * I;
589
+ for (Attribute I : * this )
590
+ if (I. hasAttribute (Kind))
591
+ return I;
592
592
return Attribute ();
593
593
}
594
594
595
595
unsigned AttributeSetNode::getAlignment () const {
596
- for (iterator I = begin (), E = end (); I != E; ++I )
597
- if (I-> hasAttribute (Attribute::Alignment))
598
- return I-> getAlignment ();
596
+ for (Attribute I : * this )
597
+ if (I. hasAttribute (Attribute::Alignment))
598
+ return I. getAlignment ();
599
599
return 0 ;
600
600
}
601
601
602
602
unsigned AttributeSetNode::getStackAlignment () const {
603
- for (iterator I = begin (), E = end (); I != E; ++I )
604
- if (I-> hasAttribute (Attribute::StackAlignment))
605
- return I-> getStackAlignment ();
603
+ for (Attribute I : * this )
604
+ if (I. hasAttribute (Attribute::StackAlignment))
605
+ return I. getStackAlignment ();
606
606
return 0 ;
607
607
}
608
608
609
609
uint64_t AttributeSetNode::getDereferenceableBytes () const {
610
- for (iterator I = begin (), E = end (); I != E; ++I )
611
- if (I-> hasAttribute (Attribute::Dereferenceable))
612
- return I-> getDereferenceableBytes ();
610
+ for (Attribute I : * this )
611
+ if (I. hasAttribute (Attribute::Dereferenceable))
612
+ return I. getDereferenceableBytes ();
613
613
return 0 ;
614
614
}
615
615
616
616
uint64_t AttributeSetNode::getDereferenceableOrNullBytes () const {
617
- for (iterator I = begin (), E = end (); I != E; ++I )
618
- if (I-> hasAttribute (Attribute::DereferenceableOrNull))
619
- return I-> getDereferenceableOrNullBytes ();
617
+ for (Attribute I : * this )
618
+ if (I. hasAttribute (Attribute::DereferenceableOrNull))
619
+ return I. getDereferenceableOrNullBytes ();
620
620
return 0 ;
621
621
}
622
622
623
623
std::pair<unsigned , Optional<unsigned >>
624
624
AttributeSetNode::getAllocSizeArgs () const {
625
- for (iterator I = begin (), E = end (); I != E; ++I )
626
- if (I-> hasAttribute (Attribute::AllocSize))
627
- return I-> getAllocSizeArgs ();
625
+ for (Attribute I : * this )
626
+ if (I. hasAttribute (Attribute::AllocSize))
627
+ return I. getAllocSizeArgs ();
628
628
return std::make_pair (0 , 0 );
629
629
}
630
630
0 commit comments