(IIIT) Siddharth Bhat via llvm-dev
2017-Oct-22 07:49 UTC
[llvm-dev] Adding comments to LLVM IR during code generation
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! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171022/c1c5003f/attachment.html>
Reid Kleckner via llvm-dev
2017-Oct-23 21:03 UTC
[llvm-dev] Adding comments to LLVM IR during code generation
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>