[LLVMdev] Rolling my own appending linkage

Talin viridia at gmail.com
Thu Jan 27 12:19:23 PST 2011


On Tue, Jan 25, 2011 at 9:14 AM, Devang Patel <dpatel at apple.com> wrote:

>
> On Jan 24, 2011, at 11:57 PM, Duncan Sands wrote:
>
> > Hi Talin,
> >
> >> Really, all I need to make this work is some way to 'mark' a global so
> that my
> >> custom pass can query for all marked globals. Any ideas on this?
> >
> > metadata maybe?
>
> A better approach would be to create an global array of strings to hold
> names of marked globals. You know the name of this special array and use it
> to query all marked globals. This is the trick llvm-gcc uses to support PCH.
>
> Actually, the ability to attach metadata nodes to globals would be a
cleaner way to do this - and it sounds like it would fit your use case as
well, plus others that I can think of, such as annotation processing.


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



-- 
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110127/d9a6b4db/attachment.html>


More information about the llvm-dev mailing list