aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2021-09-30 13:57:55 -0700
committerArthur Eubanks <aeubanks@google.com>2021-10-01 10:17:41 -0700
commita7b4ce9cfd110db56d89fa8d76b39023d038de11 (patch)
treed98b67823f4b047105d76f76694aab9f3ad485da /llvm/lib/IR/Attributes.cpp
parent31c92d515dd21c49a2b3bcedd991fffb3b6dfd55 (diff)
downloadllvm-a7b4ce9cfd110db56d89fa8d76b39023d038de11.zip
llvm-a7b4ce9cfd110db56d89fa8d76b39023d038de11.tar.gz
llvm-a7b4ce9cfd110db56d89fa8d76b39023d038de11.tar.bz2
[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
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 2abd1fe..c43be77 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -1527,7 +1527,7 @@ unsigned AttributeList::getNumAttrSets() const {
void AttributeList::print(raw_ostream &O) const {
O << "AttributeList[\n";
- for (unsigned i = index_begin(), e = index_end(); i != e; ++i) {
+ for (unsigned i : indexes()) {
if (!getAttributes(i).hasAttributes())
continue;
O << " { ";