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] Thanks, Omair -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100528/3c394347/attachment.html>
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