[llvm] 6459031 - [AttrBuilder] Remove non-const td_attrs()
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 15 09:13:14 PST 2022
Author: Nikita Popov
Date: 2022-01-15T18:13:06+01:00
New Revision: 64590312d4b84e13345a98b9d7d7bbc4e2b0c166
URL: https://github.com/llvm/llvm-project/commit/64590312d4b84e13345a98b9d7d7bbc4e2b0c166
DIFF: https://github.com/llvm/llvm-project/commit/64590312d4b84e13345a98b9d7d7bbc4e2b0c166.diff
LOG: [AttrBuilder] Remove non-const td_attrs()
Mutations should happen through appropriate APIs that uphold the
sorting invariant. Exposing a mutable iterator is not necessary.
Added:
Modified:
llvm/include/llvm/IR/Attributes.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index 84e497724036..d5fe55652179 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -1208,20 +1208,12 @@ class AttrBuilder {
AttrBuilder &addVScaleRangeAttrFromRawRepr(uint64_t RawVScaleRangeRepr);
// Iterators for target-dependent attributes.
- using td_type = decltype(TargetDepAttrs)::value_type;
- using td_iterator = decltype(TargetDepAttrs)::iterator;
using td_const_iterator = decltype(TargetDepAttrs)::const_iterator;
- using td_range = iterator_range<td_iterator>;
using td_const_range = iterator_range<td_const_iterator>;
- td_iterator td_begin() { return TargetDepAttrs.begin(); }
- td_iterator td_end() { return TargetDepAttrs.end(); }
-
td_const_iterator td_begin() const { return TargetDepAttrs.begin(); }
td_const_iterator td_end() const { return TargetDepAttrs.end(); }
- td_range td_attrs() { return td_range(td_begin(), td_end()); }
-
td_const_range td_attrs() const {
return td_const_range(td_begin(), td_end());
}
More information about the llvm-commits
mailing list