[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
Chris Lattner
clattner at apple.com
Thu Nov 22 09:05:58 PST 2012
On Nov 22, 2012, at 8:53 AM, Justin Holewinski <justin.holewinski at gmail.com> wrote:
> 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?
I'm not saying I'm opposed to it - I'm saying that it is a completely different topic than what Bill is proposing.
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121122/10232439/attachment.html>
More information about the llvm-dev
mailing list