mark variables and functions to later get their address?

As a plugin I used the ASTConsumer and RecusiveASTVisitor class to find “interesting” variables and functions. Ultimately I want the address of these either in the object file or resulting elf.

From the IRC channel it sounds like this is currently impossible, if not Id love to hear how I could do this.

Now I would like to know what exactly would need to be edited so while in the AST so I could “flag” these interesting things(metadata), so when the codegen routines runs I could add something(like a comment maybe). Can anyone give me a hand with how to begin? After browsing these files for awhile now I’m not even sure what the key functions would be.

Thank you

Forgot mention, being able to see these flags at the IR level in a pass would also help me greatly.

Thanks again