instruction names

I want to be able to name all instructions for debugging purposes. However, it appears that instructions that have a void type can not be named. Is there any good way to get around that limitation?

"Ryan M. Lefever" <lefever@illinois.edu> writes:

I want to be able to name all instructions for debugging purposes.
However, it appears that instructions that have a void type can not be
named. Is there any good way to get around that limitation?

You can name objects that may be referenced elsewhere on the LLVM IR
listing. Instructions like StoreInst can not be referenced, so they do
not support naming.

Maybe `metadata' is useful for you:

http://llvm.org/docs/LangRef.html#metadata

"Ryan M. Lefever" <lefever@illinois.edu> writes:

Thank you. That is exactly what I want. Is there any more detailed
documentation on how to use metadata?

I guess that clang is using metadata for debug info so looking at its
code can be useful. And there is this document explaining how LLVM
implements debug information:

http://llvm.org/docs/SourceLevelDebugging.html

If that is not enough, you'll better ask on the mailing list.