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

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 14:25:53 PDT 2024


================
@@ -117,10 +118,21 @@ void Attributes::emitAttributeProperties(raw_ostream &OS) {
   OS << "static const uint8_t AttrPropTable[] = {\n";
   for (StringRef KindName : {"EnumAttr", "TypeAttr", "IntAttr",
                              "ConstantRangeAttr", "ConstantRangeListAttr"}) {
+    bool AllowIntersectAnd = KindName == "EnumAttr";
+    bool AllowIntersectMin = KindName == "IntAttr";
     for (auto *A : Records.getAllDerivedDefinitions(KindName)) {
       OS << "0";
-      for (Init *P : *A->getValueAsListInit("Properties"))
+      for (Init *P : *A->getValueAsListInit("Properties")) {
+        if (!AllowIntersectAnd &&
+            cast<DefInit>(P)->getDef()->getName() == "IntersectAnd")
+          PrintFatalError(
+              "'IntersectAnd' only compatible with 'EnumAttr' or 'TypeAttr'");
----------------
goldsteinn wrote:

Oh yes, in initial version thought we would support it but then realized its not applicable.

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


More information about the llvm-commits mailing list