[cfe-dev] IR metadata code generation

Eli Bendersky eliben at google.com
Wed Feb 20 10:05:59 PST 2013


On Tue, Feb 19, 2013 at 9:34 AM, Giacomo Tagliabue
<giacomo.tag at gmail.com> wrote:
> Hello,
> Which files of libcodegen take care of generating llvm metadata nodes? which
> methods in particular? I am talking of metadata like that:
>
> ; Some unnamed metadata nodes, which are referenced by the named metadata.
> !0 = metadata !{metadata !"zero"}
> !1 = metadata !{metadata !"one"}
> !2 = metadata !{metadata !"two"}
> ; A named metadata.
> !name = !{!0, !1, !2}
>

There are different uses for metadata. grep the clang sources for
getOrInsertNamedMetadata, which is a llvm::Module method. Debug
metadata (the thing Clang generates with -g) is created by using the
DIBuilder class (for example in lib/CodeGen/CGDebugInfo.cpp).

Eli



More information about the cfe-dev mailing list