[LLVMdev] [RFC] Passing Options to Different Parts of the Compiler Using Attributes
Bill Wendling
wendling at apple.com
Mon Nov 26 11:24:26 PST 2012
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).
>
> "-G num
> Put definitions of externally-visible data in a small data section if that data is no bigger than num bytes. GCC can then access the data more efficiently; see -mgpopt for details."
>
> So we'll probably want to put attributes on all top level entities and not just functions.
>
That's not a bad idea. It may be better to have that as a future expansion, though. Just to get the more incremental development done... But on the whole, I don't see anything wrong with it though.
-bw
More information about the llvm-dev
mailing list