[LLVMdev] How to associate extra comments to a MachineInstruction ?
atrick at apple.com
Fri May 31 19:29:53 PDT 2013
On May 30, 2013, at 2:53 PM, Eric Christopher <echristo at gmail.com> wrote:
> On Thu, May 30, 2013 at 2:16 PM, Jeroen Dobbelaere
> <Jeroen.Dobbelaere at synopsys.com> wrote:
>>> From: Eric Christopher
>>> Subject: Re: [LLVMdev] How to associate extra comments to a
>>> MachineInstruction ?
>>> Should be spelled like this yes?
>> That should work at the moment that you are emitting the instructions.
>> But what would you do when you are manipulating a MachineBasicBlock and want to
>> annotate some instructions there ? (way before the assembler jumps in)
>> The annotation belongs to the instruction and other manipulations that are performed later (like reordering of instructions)
>> should keep the annotation (iff the instruction itself is kept).
> Not really a way to do it so far. There's a set of specific comments
> to put on, but...
It would be nice, but there’s no existing mechanism.
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.
>>> On Thu, May 30, 2013 at 1:44 PM, Jeroen Dobbelaere
>>> <Jeroen.Dobbelaere at synopsys.com> wrote:
>>>> is there a convenient way to associate/add a comment to a
>>> MachineInstruction, so that
>>>> in the produced assembly file, the comment is added next to the
>>> instruction ?
>>>> Jeroen Dobbelaere
>>>> LLVM Developers mailing list
>>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev