From a7b4ce9cfd110db56d89fa8d76b39023d038de11 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Thu, 30 Sep 2021 13:57:55 -0700 Subject: [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 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index a915d47..23d6132 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -835,7 +835,7 @@ void ModuleBitcodeWriter::writeAttributeTable() { SmallVector 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})); -- cgit v1.1