[NFC][AttributeList] Replace index_begin/end with an iterator

We expose the fact that we rely on unsigned wrapping to iterate through
all indexes. This can be confusing. Rather, keeping it as an
implementation detail through an iterator is less confusing and is less
code.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D110885
This commit is contained in:
Arthur Eubanks
2021-09-30 13:57:55 -07:00
parent 31c92d515d
commit a7b4ce9cfd
7 changed files with 32 additions and 11 deletions

View File

@@ -835,7 +835,7 @@ void ModuleBitcodeWriter::writeAttributeTable() {
SmallVector<uint64_t, 64> Record;
for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
AttributeList AL = Attrs[i];
for (unsigned i = AL.index_begin(), e = AL.index_end(); i != e; ++i) {
for (unsigned i : AL.indexes()) {
AttributeSet AS = AL.getAttributes(i);
if (AS.hasAttributes())
Record.push_back(VE.getAttributeGroupID({i, AS}));