[LLVMdev] [proposal] Extensible IR metadata

Devang Patel devang.patel at gmail.com
Tue Sep 15 22:24:24 PDT 2009

On Fri, Sep 11, 2009 at 1:20 PM, Jeffrey Yasskin <jyasskin at google.com> wrote:
> I've got a suggestion for a refinement:
> Right now, we have classes like DILocation that wrap an MDNode* to
> provide more convenient access to it. It would be more convenient for
> users if instead of
>  MDNode *DbgInfo = Inst->getMD(MDKind::DbgTag);
>  Inst2->setMD(MDKind::DbgTag, DbgInfo);
> they could write:
>  DILocation DbgInfo = Inst->getMD<DILocation>();
>  inst2->setMD(DbgInfo);
> we'd use TheContext->RegisterMDKind<MyKindWrapper>() or
> ...Register<MyKindWrapper>("name"); to register a new kind. (I prefer
> the first.)

Right now, I am preparing a very simple implementation that allows us
to make progress on debug info front. And the same time, it'd be
possible for someone to extend it for other uses.

More information about the llvm-dev mailing list