[llvm] [IR][Attribute] Add support for intersecting AttributeLists; NFC (PR #109719)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 09:08:17 PDT 2024


================
@@ -208,8 +212,15 @@ class Attribute {
   /// Return true if the target-dependent attribute is present.
   bool hasAttribute(StringRef Val) const;
 
+  /// Returns true if the attribute's kind can be represented as an enum (Enum,
+  /// Integer, Type, ConstantRange, or ConstantRangeList attribute).
+  bool hasKindAsEnum() const {
+    return isEnumAttribute() || isIntAttribute() || isTypeAttribute() ||
+           isConstantRangeAttribute() || isConstantRangeListAttribute();
----------------
nikic wrote:

This is `!isStringAttribute()`.

https://github.com/llvm/llvm-project/pull/109719


More information about the llvm-commits mailing list