mips16/nomips16 attributes - please review
rkotler at mips.com
Tue Mar 12 16:53:54 PDT 2013
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.
Not sure exactly what you mean byt how AttrKinds are added.
You want just something like:
+ llvm::AttributeSet::FunctionIndex, CGM.getLLVMContext(), "mips")
> 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 ...
> 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
More information about the cfe-commits