[LLVMdev] Inserting comments

Scott Graham scott.llvm at h4ck3r.net
Tue Nov 4 10:30:01 PST 2008


On Tue, Nov 4, 2008 at 10:18 AM, Scott Graham <scott.llvm at h4ck3r.net> wrote:
> On Tue, Nov 4, 2008 at 9:39 AM, Devang Patel <dpatel at apple.com> wrote:
>>
>>> Anyone have any clever way of inserting a comment (or
>>> comment-ish-thing) that will make it to an .ll that's generated at the
>>> same time as writing out the bitcode?
>>> ...
>>
>> Try using llvm.var.annotation intrinsic.
>
> ...
>
> ... Oh, but llvm.annotation.* is workable (ignoring the unique-ing
> append of "14"):
>
>        %"------- my comment here14" = call i8 @llvm.annotation.i8( i8 0, i8*
> null, i8* null, i32 0 )         ; <i8> [#uses=0]
>

Oops, that was poorly tested. llc (targeting x86) dies with "Cannot
yet select: intrinsic %llvm.annotation". Is that because I'm using it
strangely with 0/nulls, or just some unfinished code? (I'm on 2.3
still)



More information about the llvm-dev mailing list