[cfe-dev] How to add LLVM IR metadata from a Clang Plugin?

Guillem Marpons gmarpons at babel.ls.fi.upm.es
Wed Oct 19 11:56:11 PDT 2011


I want to pass some AST information from Clang to LLVM and extensible
metadata (http://blog.llvm.org/2010/04/extensible-metadata-in-llvm-ir.html)
seems the right way to do that. Is it possible to add metadata to the
generated IR from a "PrintFunctionNames"-like plugin? Some pointers or
code examples?

I'm aware that the plugin mechanism may improve in the near future
(http://comments.gmane.org/gmane.comp.compilers.clang.devel/17707),
I'd like to know if it's possible (and not very difficult) to do it
with current infrastructure.

Thanks,

-- 
Guillem Marpons
Universidad Polit├ęcnica de Madrid - Babel Group




More information about the cfe-dev mailing list