<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi Joel,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Yes, both are correct. However, clang already has support for serializing the result as source (actually, it's more like applying your patch to the original source) so that's pretty easy. We're also planning to work on making that process of rerunning clang smoother and more efficient (e.g. some form of incremental recompilation to AST), but that's still off in the future.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 23, 2019 at 6:24 PM Joel E. Denny <<a href="mailto:jdenny.ornl@gmail.com">jdenny.ornl@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi <font face="arial, helvetica, sans-serif">Yitzhak,</font></div><br><div class="gmail_quote"><div dir="ltr" class="gmail-m_-5205083994935240970gmail_attr">On Fri, Nov 16, 2018 at 10:22 AM Yitzhak Mandelbaum via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">Hi all,</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I have a proposal for a framework that makes it easier to write source to source transformations with the clang::Tooling libraries, including clang-tidy checks.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">The full proposal is in this doc:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><a href="https://docs.google.com/document/d/1ppw0RhjwsrbBcHYhI85pe6ISDbA6r5d00ot3N8cQWeQ/edit?usp=sharing" target="_blank">https://docs.google.com/document/d/1ppw0RhjwsrbBcHYhI85pe6ISDbA6r5d00ot3N8cQWeQ/edit?usp=sharing</a></font></div></div></div></div></blockquote><div><br></div><div>I just took a quick pass on this document, and it looks interesting. However, I'm not very familiar with this area of clang, and I have a few high-level questions to be sure I understand the objectives of your tool.<br></div><div><br></div><div>My understanding is that the input of a transformation using your tool is a clang AST and the output is new source code. Is that correct?</div><div><br></div><div>If so, it seems your tool is optimized for (but not functionally limited to) transformations involving a single pass where the ultimate product is source code. That is, after running a transformation pass, if you want to either run additional transformation passes or perform LLVM IR codegen, you would need to serialize the output as source code and run clang again to get the new AST. Is that correct?<br></div><br></div><div class="gmail_quote">Thanks.<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Joel</div><div class="gmail_quote"> <br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">From the doc:</font></div><div><font face="arial, helvetica, sans-serif">Transformer is a framework that aims to simplify development of clang-based source-to-source transformations. It focuses on the particular class of transformations that act only locally — that is, use local information about the code and make local changes (like a syntax-aware “find-and-replace”); and at scale — that is, will be carried out on many source files. The target audience is users that are comfortable with, or willing to become comfortable with, the clang AST matchers library.<br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I have a working prototype of this library which I've used on small examples inside Google. I plan to put together a patch for reference next week, although the doc should stand on its own.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks!</font></div><div><font face="arial, helvetica, sans-serif">Yitzhak Mandelbaum</font></div></div></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>
</blockquote></div>