[llvm] r185408 - IRVerifier: Correctly check attribute types

Nick Lewycky nicholas at mxc.ca
Tue Jul 2 00:34:38 PDT 2013


Tobias Grosser wrote:
> On 07/01/2013 08:28 PM, Tobias Grosser wrote:
>> Author: grosser
>> Date: Mon Jul 1 22:28:10 2013
>> New Revision: 185408
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=185408&view=rev
>> Log:
>> IRVerifier: Correctly check attribute types
>>
>> Add missing parenthesis such that all and not only the very first
>> attribute
>> is checked.
>>
>> Testing this piece of code is not possible with an LLVM-IR test file,
>> as the
>> LLVM-IR parser has a similar check such that the wrong IR does not
>> even arrive
>> at the verifier.
>
> This addresses a typo introduced in:
>
> Author: Bill Wendling <isanbard at gmail.com>
> Date: Thu Apr 18 20:15:25 2013 +0000
>
> This patch addresses two cleanup issues:
>
> [...]
>
> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179790
>
> The fix seems obvious, but I still would appreciate a post-commit review.

Post-commit LGTM. Thanks!

>
> Also, llvm.org/PR7555 proposes a clang warning that would have saved us
> here.
>
> Cheers,
> Tobias
>
>
>> @@ -695,10 +695,11 @@ void Verifier::VerifyAttributeTypes(Attr
>> I->getKindAsEnum() == Attribute::Builtin ||
>> I->getKindAsEnum() == Attribute::NoBuiltin ||
>> I->getKindAsEnum() == Attribute::Cold) {
>> - if (!isFunction)
>> + if (!isFunction) {
>> CheckFailed("Attribute '" + I->getAsString() +
>> "' only applies to functions!", V);
>> return;
>> + }
>> } else if (isFunction) {
>> CheckFailed("Attribute '" + I->getAsString() +
>> "' does not apply to functions!", V);
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list