[LLVMdev] How to associate extra comments to a MachineInstruction ?

Jeroen Dobbelaere Jeroen.Dobbelaere at synopsys.com
Thu May 30 14:16:32 PDT 2013


> From: Eric Christopher
> Subject: Re: [LLVMdev] How to associate extra comments to a
> MachineInstruction ?
> 
> Should be spelled like this yes?
> 
> Asm->OutStreamer.AddComment("foo")
> Asm->EmitFoo();
> 
> -eric


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).

Greetings,

Jeroen

> 
> On Thu, May 30, 2013 at 1:44 PM, Jeroen Dobbelaere
> <Jeroen.Dobbelaere at synopsys.com> wrote:
> > Hi,
> >
> > 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 ?
> >
> > Greetings,
> >
> > Jeroen Dobbelaere
> >
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list