[llvm-dev] Missing attribute kind check in AttrBuilder?

Johannes Doerfert via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 20 13:39:51 PST 2020


Looks like an oversight. Can you fix it and provide a test?

~ Johannes


On 11/20/20 2:42 PM, Jonathan Smith via llvm-dev wrote:
> Greetings everyone,
>
> I have some code that checks for a number of different attributes
> assigned to a particular function parameter via
> `llvm::AttrBuilder::hasAttributes`; one of these attributes is the
> `byval` attribute. Prior to the addition of type attributes, this
> worked fine. Since upgrading to 11, I'm getting an assertion failure.
>
> I think the issue is here:
>
> https://github.com/llvm/llvm-project/blob/9211da4215b6d48c8b9186b78274946789c559e9/llvm/lib/IR/Attributes.cpp#L1841
>
> There is no check for `isTypeAttribute()`. If I add that check to the
> if-statement, everything works fine again.
>
> The trouble is I don't know if this is a real bug or if there is a
> legitimate reason for omitting this check (and, therefore, I'm doing
> something I shouldn't be.)
>
> I was just wondering if I can get a second set (or sets) of eyes for a
> confirmation/denial of my suspicions.
>
> - Jon
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list