mips16/nomips16 attributes - please review

Reed Kotler rkotler at mips.com
Tue Mar 12 17:39:36 PDT 2013


Maybe you meant:

To Function add:

   void addFnAttr(StringRef Kind);


On 03/12/2013 04:10 PM, Bill Wendling wrote:
> Hi Reed,
>
> This is a lot of code just to add one function attribute (not your fault, but mine). Instead of generating an AttrBuilder etc., could you add a convenience function to the Function and AttributeSet objects that add a string attribute --- it would be very similar to how Attribute::AttrKinds are currently added. That would clean up this code quite nicely. Of course, if you end up adding a lot of attributes in this method, then you'll want to revert to using the "AttrBuilder" for that.
>
> As for the code itself, you might want to use an early exit like this:
>
>    const FunctionDecl *FD = dyn_cast<FunctionDecl>(D);
>    if (!FD) return;
>
>    // Code that sets the attributes ...
>
> -bw
>
> On Mar 12, 2013, at 1:44 PM, Reed Kotler <rkotler at mips.com> wrote:
>
>> Use the new attribute scheme to pass mips16/nomips16 attributes from clang to llvm
>>
>>
>> <mips16_attrn.txt>





More information about the cfe-commits mailing list