[LLVMdev] Metadata for Argument, BasicBlock

Duncan Sands baldrick at free.fr
Sun May 6 09:12:58 PDT 2012


Hi Ralf,

> Is there a clean way to attach metadata nodes to Arguments and/or
> BasicBlocks?

not at the moment.  Feel free to work on adding this functionality!

> It looks to me like one can directly attach metadata only to instructions.
> My current workaround is to insert a call to a dummy function that holds
> metadata for its parent block - pretty ugly, but manageable. The same
> problem arises when I want to store specific information about the
> arguments of a function.
>
> Does anybody have a suggestion how I could do this more elegantly?

Maybe you could take the address of the basic block (using blockaddress), and
use that as an argument for a module level metadatum.

Ciao, Duncan.



More information about the llvm-dev mailing list