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

Duncan Sands baldrick at free.fr
Thu Oct 2 01:48:02 PDT 2008


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.

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?

Ciao,

Duncan.



More information about the llvm-commits mailing list