[llvm-dev] Adding comments to LLVM IR during code generation

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 23 14:03:35 PDT 2017


Today, you can use inline asm with side effects to emit comments bracketing
the code you care about. Of course, optimizations will move instructions
past these markers as normal, but presumably that's working as intended.

On Sun, Oct 22, 2017 at 12:49 AM, (IIIT) Siddharth Bhat via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello all,
>
> this is "frivolous", and I understand that there are good reasons as to
> why the IR representation does not have a representation for comments
> (unless I am mistaken).
>
> However, I would really like to have the ability to generate comments
> along with LLVM IR from my compiler backend.
>
> It would greatly help in debugging LLVM.
>
> Since I cannot generate comments, what alternatives to I have to allow me
> to quickly add info the the IR that is easy to scan over?
>
> Cheers,
> ~Siddhart.
> --
> Sending this from my phone, please excuse any typos!
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171023/f9b33af5/attachment.html>


More information about the llvm-dev mailing list