<div dir="ltr">On 31 January 2013 14:30, Giacomo Tagliabue <span dir="ltr"><<a href="mailto:giacomo.tag@gmail.com" target="_blank">giacomo.tag@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello, to understand the whole process of transformation from C to IR that clang does, we are trying to preserve the comments from the C form /*comment*/ to the output IR written with as ";comment"<br>


Which part of the CLANG source code should be modified in order to do that? Is there a library that allows that? Thank you very much!</div></blockquote><div><br></div><div style>LLVM does not support comments in its in-memory representation or its bitcode file format, and the .ll parser does nothing with comments but discard them. There is a way to get .ll files to be emitted with custom comments using the llvm::AssemblyAnnotationWriter class, but I think you'll find that your goal of preserving comments in a language which does not have a concept of comments is a non-starter without significant engineering effort to add comments as a part of llvm ir.</div>

<div style><br></div><div style>Nick</div></div></div></div>