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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 12:49:26 PDT 2024


================
@@ -775,6 +793,12 @@ class AttributeList {
   addAllocSizeParamAttr(LLVMContext &C, unsigned ArgNo, unsigned ElemSizeArg,
                         const std::optional<unsigned> &NumElemsArg);
 
+  /// Try to intersect this AttributeList with Other. Returns std::nullopt if
+  /// the two lists are inherently incompatible (imply different behavior, not
+  /// just analysis).
+  [[nodiscard]] std::optional<AttributeList>
+  intersectAttributes(LLVMContext &C, AttributeList Other) const;
----------------
nikic wrote:

```suggestion
  intersectWith(LLVMContext &C, AttributeList Other) const;
```
For consistency with the AttributeSet method? Or is there a reason they have different names?

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


More information about the llvm-commits mailing list