[LLVMdev] adding comments to the generated code...

Chris Lattner clattner at apple.com
Fri May 28 15:15:13 PDT 2010


On May 28, 2010, at 3:08 PM, omair Abbasi wrote:

>  
> Is there a way to add any arbitrary comment to the LLVM generated code during code generation? I would like to add comment that I could see when I do a dump. I could not find anything in builder class that supports this.E.g. I want to generate code that looks something like this;
>  
> ; add some arbitrary comment here
> %22 = bitcast i8* %20 to i32*                   ; <i32*> [#uses=1]
> %23 = load i32* %22                             ; <i32> [#uses=1]
>  
>  

Yep, check out the llvm/Assembly/AsmAnnotationWriter.h API,

-Chris





More information about the llvm-dev mailing list