[LLVMdev] [Patch] Metadata nodes and C API
antjbryant at gmail.com
Wed Sep 12 08:52:51 PDT 2012
On 4 September 2012 13:44, Anthony Bryant <antjbryant at gmail.com> wrote:
> I'm relatively new to using LLVM, and I'm working on a front end for a
> language I'm designing. I have a couple of questions about metadata:
> 1. I'd like to be able to store some high level program structure in
> bitcode files, to be imported by future runs of my compiler, in order
> to keep everything in one place (so my bitcode files become something
> akin to Java's class files). I was thinking of using named metadata to
> store that structure. I read in an old blog post that "use of metadata
> is only safe if the program retains its semantics when the metadata is
> silently dropped". Since it doesn't change the actual function of any
> of the code (and the metadata nodes don't reference the code at all),
> would this be a safe/practical way to store that high level structure
> in the long term?
> 2. I couldn't find any way to extract data from (non-named) metadata
> nodes from the C API. Is the attached patch an acceptable way to add
> that functionality? If so, could someone commit it?
> Anthony Bryant.
Could someone take a look at this patch please? It only adds a couple
of short functions to the C bindings.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1691 bytes
Desc: not available
More information about the llvm-dev