I'm using createPrintModulePass to produce the IR of a created Module. I'm wondering if there is some way to insert/attach comments to the generated output. That is, prior to a given command, or block, emit a comment. I see the ability to add meta/debug data. Could that somehow be used to get comments into the generated IR? Or is there some other mechanism? I want to do this to help me diagnose problems in the IR that I am generating. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 259 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121101/9af0c317/attachment.sig>
Hi edA-qa mort-ora-y, On 01/11/12 09:03, edA-qa mort-ora-y wrote:> I'm using createPrintModulePass to produce the IR of a created Module. > I'm wondering if there is some way to insert/attach comments to the > generated output. That is, prior to a given command, or block, emit a > comment. > > I see the ability to add meta/debug data. Could that somehow be used to > get comments into the generated IR? Or is there some other mechanism? > > I want to do this to help me diagnose problems in the IR that I am > generating.check out AssemblyAnnotationWriter.h Ciao, Duncan.
On 01/11/12 09:16, Duncan Sands wrote:>> I see the ability to add meta/debug data. Could that somehow be used to >> get comments into the generated IR? Or is there some other mechanism? > > check out AssemblyAnnotationWriter.hHmm, this might work, but I can't get it to compile. Since I use RTTI and LLVM does not, deriving from this class now causes GCC to look for typeinfo and it doesn't find it. Until I find a solution there I can't actually experiment with the annotation writer. Perhaps this RTTI/typeinfo thing a common problem that you, or somebody, already knows how to solve? -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 259 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121101/15137275/attachment.sig>
On 01/11/12 09:16, Duncan Sands wrote:> check out AssemblyAnnotationWriter.hI've got some static data being output, but now I'm unsure on how I should structure the actual strings I wish to write. For example, on the emitFunctionAnnot I get a Function object, but I don't see any API which we set/get user or meta data for a function. (Note, obviously I can just do my own mapping of the Function pointer and lookup what I want at this point. It just doesn't seem correct.) -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 259 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121101/bc3f25d3/attachment.sig>