<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 30, 2013, at 2:53 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Thu, May 30, 2013 at 2:16 PM, Jeroen Dobbelaere<br><<a href="mailto:Jeroen.Dobbelaere@synopsys.com">Jeroen.Dobbelaere@synopsys.com</a>> wrote:<br><blockquote type="cite"><blockquote type="cite">From: Eric Christopher<br>Subject: Re: [LLVMdev] How to associate extra comments to a<br>MachineInstruction ?<br><br>Should be spelled like this yes?<br><br>Asm->OutStreamer.AddComment("foo")<br>Asm->EmitFoo();<br><br>-eric<br></blockquote><br><br>That should work at the moment that you are emitting the instructions.<br><br></blockquote><br>Yep.<br><br><blockquote type="cite">But what would you do when you are manipulating a MachineBasicBlock and want to<br>annotate some instructions there ? (way before the assembler jumps in)<br>The annotation belongs to the instruction and other manipulations that are performed later (like reordering of instructions)<br>should keep the annotation (iff the instruction itself is kept).<br><br></blockquote><br>Not really a way to do it so far. There's a set of specific comments<br>to put on, but...<br></div></blockquote><div dir="auto"><br></div><div dir="auto">It would be nice, but there’s no existing mechanism.</div><div dir="auto"><br></div><div dir="auto">I personally think it should be handled by adding an implicit operand to the machineinstr that holds a constant index into a table of annotations strings, or maybe an MDNode is more convenient. Unfortunately there’s target-specific code lurking out there that makes assumptions about the number of operands.</div><div dir="auto"><br></div><div dir="auto">-Andy</div><div dir="auto"><br></div><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite"><blockquote type="cite"><br>On Thu, May 30, 2013 at 1:44 PM, Jeroen Dobbelaere<br><<a href="mailto:Jeroen.Dobbelaere@synopsys.com">Jeroen.Dobbelaere@synopsys.com</a>> wrote:<br><blockquote type="cite">Hi,<br><br>is there a convenient way to associate/add a comment to a<br></blockquote>MachineInstruction, so that<br><blockquote type="cite">in the produced assembly file, the comment is added next to the<br></blockquote>instruction ?<br><blockquote type="cite"><br>Greetings,<br><br>Jeroen Dobbelaere<br><br><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></blockquote></blockquote>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></div></blockquote></div><br></body></html>