[llvm] 7cbbef5 - [AttrBuilder] Remove unused hasAttributes() overload
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 16 12:01:21 PST 2022
Author: Nikita Popov
Date: 2022-01-16T21:00:18+01:00
New Revision: 7cbbef5bbc35edb1324408deb418516fb9fadcf4
URL: https://github.com/llvm/llvm-project/commit/7cbbef5bbc35edb1324408deb418516fb9fadcf4
DIFF: https://github.com/llvm/llvm-project/commit/7cbbef5bbc35edb1324408deb418516fb9fadcf4.diff
LOG: [AttrBuilder] Remove unused hasAttributes() overload
This is unused, and doesn't make a lot of sense as an API. The
usual pattern would be to combine the AttrBuilder(AttributeSet)
constructor with the overlaps() method.
Added:
Modified:
llvm/include/llvm/IR/Attributes.h
llvm/lib/IR/Attributes.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index 5f20b82a62cdd..0156fd91e37e2 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -1074,10 +1074,6 @@ class AttrBuilder {
/// Return true if the builder has IR-level attributes.
bool hasAttributes() const;
- /// Return true if the builder has any attribute that's in the
- /// specified attribute.
- bool hasAttributes(AttributeList A, uint64_t Index) const;
-
/// Return true if the builder has an alignment attribute.
bool hasAlignmentAttr() const;
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index c680f9fc56153..0960e5db289a7 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -1805,22 +1805,6 @@ bool AttrBuilder::hasAttributes() const {
return !Attrs.none() || !TargetDepAttrs.empty();
}
-bool AttrBuilder::hasAttributes(AttributeList AL, uint64_t Index) const {
- AttributeSet AS = AL.getAttributes(Index);
-
- for (const auto &Attr : AS) {
- if (Attr.isEnumAttribute() || Attr.isIntAttribute()) {
- if (contains(Attr.getKindAsEnum()))
- return true;
- } else {
- assert(Attr.isStringAttribute() && "Invalid attribute kind!");
- return contains(Attr.getKindAsString());
- }
- }
-
- return false;
-}
-
bool AttrBuilder::hasAlignmentAttr() const {
return getRawIntAttr(Attribute::Alignment) != 0;
}
More information about the llvm-commits
mailing list