[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes

Justin Holewinski justin.holewinski at gmail.com
Thu Nov 22 08:53:54 PST 2012


On Thu, Nov 22, 2012 at 11:24 AM, Chris Lattner <clattner at apple.com> wrote:

>
> On Nov 19, 2012, at 1:49 PM, Eric Christopher <echristo at gmail.com> wrote:
>
>
>
> Querying
>> --------
>>
>> The attributes are attached to the function. It's therefore trivial to
>> access
>> the attributes within the middle- and the back-ends. Here's an example of
>> how
>> attributes are queried:
>>
>
> Just had a thought, what about compile options that change
> alignment/layout/section placement of globals etc? For example the -G <num>
> option in gcc that the mips guys will want to support some day (there are
> probably better options but this was the first the came to mind).
>
>
> All of those can be directly represented in LLVM IR today, but if there
> were a good reason to, I can see extending attributes to work on globals
> someday.
>

I'm a bit worried about this creating an arbitrary line between annotations
that are defined as attributes and annotations that are first-class
keywords in the IR language.  It may become a source of confusion for
people.  If attributes are only applied to functions, the obvious questions
for users is "why do I need to do things differently for functions vs.
globals?"  I'm not saying it's a big issue, but it does seem a bit
inconsistent.  If we're implementing these attributes anyway, why not unify
the handling of annotations on functions and global variables?



>
> -Chris
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>


-- 

Thanks,

Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121122/93557b08/attachment.html>


More information about the llvm-dev mailing list