[llvm-commits] [llvm] r56939 - in /llvm/trunk: include/llvm/Attributes.h lib/VMCore/Verifier.cpp test/Assembler/2008-09-02-FunctionNotes2.ll

Devang Patel dpatel at apple.com
Thu Oct 2 10:08:33 PDT 2008


On Oct 2, 2008, at 1:48 AM, Duncan Sands wrote:

> Hi Devang,
>
>> +  Attributes RAttrs = Attrs.getRetAttributes();
>> +  for (unsigned i = 0;
>> +       i < array_lengthof(Attribute::MutuallyIncompatible); ++i) {
>> +    Attributes MutI = RAttrs & Attribute::MutuallyIncompatible[i];
>> +    Assert1(!(MutI & (MutI - 1)), "Attributes " +
>> +            Attribute::getAsString(MutI) + " are incompatible!", V);
>> +  }
>
> isn't this one checked already by the preceding loop
>
>  for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
>
> and this call
>
>    VerifyAttrs(Attr.Attrs, Ty, Attr.Index == 0, V);
>
> This is the case Attr.Index == 0.

Aha... I missed that.

>
>
> Also, shouldn't there be a check that the attributes set as
> FnAttrs are all actually valid as function attributes?  Or is
> it impossible to (for example) set "inreg" as a function attribute?


Yes, it is not possible to set "inreg" as a function attribute. Today  
for backward compatibility, asm parser and bitcode reader will accept  
"inreg" as a function attribute but they will immediately make it a  
return attribute.
-
Devang






More information about the llvm-commits mailing list