[PATCH] D86744: [Attributes] Add a method to check if an Attribute has AttrKind None. Use instead of hasAttribute(Attribute::None)
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 17:34:32 PDT 2020
jdoerfert added a comment.
In D86744#2243395 <https://reviews.llvm.org/D86744#2243395>, @efriedma wrote:
> Maybe worth adding asserts to ensure we can't create an AttributeImpl for None?
>
> Checking for isNone() is a little unintuitive; maybe something like `hasAttribute()` that checks for a non-None attribute would be better? As it is, it's a double-negative in most places it's used.
`hasAttribute()` or `isAttribute()` or either with `AttrKind`? Naming things is hard.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86744/new/
https://reviews.llvm.org/D86744
More information about the llvm-commits
mailing list