How to add LLVM IR metadata from a Clang Plugin?

I want to pass some AST information from Clang to LLVM and extensible
metadata (
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
I'd like to know if it's possible (and not very difficult) to do it
with current infrastructure.


It’s not possible currently.


Thanks Nico.