<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, 11 Oct 2018 at 13:55, Kareem Kareem via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;color:#00000"><div>Thanks for the suggestions Richard. And thanks for the heads-up Nicolas :).<br></div><div><br></div><div>I am interested to take on the pack expansion in lambda init-capture paper. I will come back to this thread with my questions later on. But as a start, it would be great if you can point me to the relevant parts in the code base so that I can start exploring at the right place.</div></div></div></blockquote><div><br></div><div>Sure!</div><div><br></div><div>lambda-introducers (including init-captures) are parsed in Parser::ParseLambdaIntroducer (in lib/Parse/ParseExprCXX.cpp). That code is slightly complicated by the need to disambiguate between a lambda-expression and an Objective-C message send expression, both of which begin with a left square bracket followed by similar-looking things, but I don't think that should introduce any new complications here.</div><div><br></div><div>Semantic analysis of init-captures is handled by lib/Sema/SemaLambda.cpp; you'll need to decide how to represent a parsed and not-yet-expanded init-capture pack there. (Perhaps modeling the type of the init-capture in Sema::buildLambdaInitCaptureInitialization as a PackExpansionType in this case would make sense.)</div><div><br></div><div>In TreeTransform::TransformLambdaExpr (in lib/Sema/TreeTransform.h), you'll need to perform the actual pack expansion, when necessary. You should be able to find other examples of how to do that elsewhere in that file.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;color:#00000"><div class="m_3384757221086929187zmail_extra"><div id="m_3384757221086929187Zm-_Id_-Sgn1"><div>Best,<br></div><div>Kareem<br></div><div><br></div><div>---- On Wed, 10 Oct 2018 22:41:42 +0200 <b>Richard Smith via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></b> wrote ----<br></div></div><div><br></div><blockquote style="border-left:1px solid #cccccc;padding-left:6px;margin:0 0 0 5px"><div><div dir="ltr"><div class="m_3384757221086929187x_2079039250gmail_quote"><div dir="ltr">On Wed, 10 Oct 2018 at 12:32, Nicolas Lesser via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote style="margin:0 0 0 0.8ex;border-left:1px rgb(204,204,204) solid;padding-left:1ex" class="m_3384757221086929187x_2079039250gmail_quote"><div dir="ltr"><div dir="ltr"><div class="m_3384757221086929187x_2079039250gmail_quote"><div dir="ltr">On Wed, Oct 10, 2018 at 9:24 PM Richard Smith via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="m_3384757221086929187x_2079039250gmail_quote"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Kareem!<br></div><div><br></div><div><div>This sounds great, and we'd be happy to have more people helping out.<br></div><div><div><br></div><div class="m_3384757221086929187x_2079039250gmail_quote"><div dir="ltr">On Tue, 9 Oct 2018 at 06:49, Kareem Kareem via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="m_3384757221086929187x_2079039250gmail_quote"><div><u></u><br></div><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">Hello,<br></div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><br></div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">My name is Kareem and I am a C++ software engineer at TomTom. I would like to gain more experience in compilers by contributing to the implementation of experimental C++2a features as detailed on the Clang website [4].<br></div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><br></div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">===<br></div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><br></div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">Here is my relevant background:<br></div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><br></div></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">1 - I implemented a library for a research language called Impala. Impala is implemented on top of a compiler framework called AnyDSL [1]. Specifically, I implemented a number of parallel primitives in Impala (e.g. map, reduce, radix sort). The library is inspired by Nvidia's CUB library [2].<br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">2 - I participated in a research project to extend LLVM IR to natively support fork-join parallelism. In particular, I implemented an OpenMP frontend and backend to translate to and from Parallel-IR. The frontend and backend supported simple parallel loops.<br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">3 - I did some tiny bug fixes in LLVM to properly propagate DebugInfo in some passes [3]. Nothing so fancy though :).<br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">===<br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">It would great if an experienced member of the community is able to guide me through this by choosing a (somewhat beginner friendly) proposal that I can start looking into and probably point me to relevant literature.<br></div></div></div></div></div></blockquote><div><br></div><div>Here's a selection of smaller C++20 papers you could choose from:<br></div><div><br></div><div> * template-parameter-list for generic lambdas (<a href="http://wg21.link/p04282r2" target="_blank">http://wg21.link/p04282r2</a>) -- this would involve parsing support and a few updates through various parts of the compiler to correctly deal with explicit template parameter lists (eg, AST pretty-printing)<br></div></div></div></div></div></div></div></div></div></blockquote><div><br></div><div>There is already patch for this in review: <a href="https://reviews.llvm.org/D36527" target="_blank">https://reviews.llvm.org/D36527</a> . Might want to check that out before you duplicate work :)<br></div></div></div></div></blockquote><div><br></div><div>Oops, sorry! :)<br></div><div> <br></div><blockquote style="margin:0 0 0 0.8ex;border-left:1px rgb(204,204,204) solid;padding-left:1ex" class="m_3384757221086929187x_2079039250gmail_quote"><div dir="ltr"><div dir="ltr"><div class="m_3384757221086929187x_2079039250gmail_quote"><div><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="m_3384757221086929187x_2079039250gmail_quote"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><div class="m_3384757221086929187x_2079039250gmail_quote"><div><br></div><div> * designated initializers (<a href="http://wg21.link/p0329r4" target="_blank">http://wg21.link/p0329r4</a>) -- we already support most of this, but we do not have support for some of the syntax yet, and we accept things that are not part of the C++20 feature: we should add syntactic support for the new parts and produce appropriate "extension" warnings based on the current language mode<br></div><div> * [[likely]] and [[unlikely]] attributes (<a href="http://wg21.link/p0479r5" target="_blank">http://wg21.link/p0479r5</a>) -- adding the attributes themselves should be straightforward, but you'll also need to figure out how best to express the effects of these attributes in LLVM IR (whether by existing intrinsics and metadata or by adding a new construct that LLVM can lower at an appropriate moment)<br></div><div> * pack expansion in lambda init-capture (<a href="http://wg21.iink/p0780r2" target="_blank">http://wg21.iink/p0780r2</a>) -- this'd be a good choice if you want to learn your way around the way Clang represents and instantiates templates<br></div><div> <br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="m_3384757221086929187x_2079039250gmail_quote"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">I can commit to a GSoC-style partnership if any experienced member would be willing to do so.<br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">[1] <a style="color:rgb(17,85,204)" href="https://anydsl.github.io/" target="_blank">https://anydsl.github.io/</a><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">[2] <a style="color:rgb(17,85,204)" href="https://nvlabs.github.io/cub/" target="_blank">https://nvlabs.github.io/cub/</a><br></div><div style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:small;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)">[3] <a style="color:rgb(17,85,204)" href="https://reviews.llvm.org/p/ergawy/" target="_blank">https://reviews.llvm.org/p/ergawy/</a><br></div><div>[4] <a href="https://clang.llvm.org/cxx_status.html#ts" target="_blank">https://clang.llvm.org/cxx_status.html</a><br></div><div><br></div><div>Best,<br></div><div>Kareem<br></div></div></div></div><div><br></div></div><div>_______________________________________________<br></div><div> cfe-dev mailing list<br></div><div> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br></div><div> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br></div></blockquote></div></div></div></div></div></div></div></div><div>_______________________________________________<br></div><div> cfe-dev mailing list<br></div><div> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br></div><div> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br></div></blockquote></div></div></div><div>_______________________________________________<br></div><div> cfe-dev mailing list<br></div><div> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br></div><div> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br></div></blockquote></div></div><div>_______________________________________________<br></div><div>cfe-dev mailing list<br></div><div><a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br></div><div><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br></div></div></blockquote></div><div><br></div></div><br></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>