<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Jul 25, 2017 at 11:15 PM Vassil Vassilev 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"><div bgcolor="#FFFFFF" text="#000000">
    <div class="m_7636952234924209838moz-cite-prefix"><br>
      On 20/07/17 09:55, Dániel Krupp via cfe-dev wrote:<br>
    </div>
    <blockquote type="cite">
      
      
      
      <div class="m_7636952234924209838WordSection1">
        <p class="MsoNormal"><span lang="EN-US">Hi,<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">this is the patch with the new library:<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Add preliminary Cross Translation Unit support
            library<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><a href="https://reviews.llvm.org/D34512" target="_blank">https://reviews.llvm.org/D34512</a><u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">we are blocked until this is not approved.</span></p>
      </div>
    </blockquote></div><div bgcolor="#FFFFFF" text="#000000">
    One generic question maybe not very related to this patch. Have you
    guys considered using the module index infrastructure to express the
    cross-TU mappings?<br>
    <br>
    IIRC its original idea was to return information about which module
    declares a decl. That works well for C/ObjC and I am not sure what's
    its state for C++.</div></blockquote><div><br></div><div>This is an abstraction level higher, though; we need an interface to get cross-TU information regardless of how the code is compiled (most C++ is compiled without modules).</div><div>                                        </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><blockquote type="cite"><div class="m_7636952234924209838WordSection1">
        <p class="MsoNormal"><span lang="EN-US">Thanks & Regards,<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Daniel<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <div>
          <div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> <a class="m_7636952234924209838moz-txt-link-abbreviated" href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a> [<a class="m_7636952234924209838moz-txt-link-freetext" href="mailto:ganna@apple.com" target="_blank">mailto:ganna@apple.com</a>]
                <br>
                <b>Sent:</b> 2017. július 20. 8:40<br>
                <b>To:</b> Dániel Krupp
                <a class="m_7636952234924209838moz-txt-link-rfc2396E" href="mailto:daniel.krupp@ericsson.com" target="_blank"><daniel.krupp@ericsson.com></a><br>
                <b>Cc:</b> Manuel Klimek <a class="m_7636952234924209838moz-txt-link-rfc2396E" href="mailto:klimek@google.com" target="_blank"><klimek@google.com></a>;
                Gábor Horváth <a class="m_7636952234924209838moz-txt-link-rfc2396E" href="mailto:xazax.hun@gmail.com" target="_blank"><xazax.hun@gmail.com></a>; Richard Smith
                <a class="m_7636952234924209838moz-txt-link-rfc2396E" href="mailto:richard@metafoo.co.uk" target="_blank"><richard@metafoo.co.uk></a>; <a class="m_7636952234924209838moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
                <b>Subject:</b> Re: [cfe-dev] Cross Translation Unit
                Support in Clang<u></u><u></u></span></p>
          </div>
        </div>
        <p class="MsoNormal"><u></u> <u></u></p>
        <div>
          <p class="MsoNormal">Hi Daniel,<u></u><u></u></p>
        </div>
        <div>
          <p class="MsoNormal"><u></u> <u></u></p>
        </div>
        <div>
          <div>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <div>
                <p class="MsoNormal">On Jul 17, 2017, at 7:02 AM, Dániel
                  Krupp via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>
                  wrote:<u></u><u></u></p>
              </div>
              <p class="MsoNormal"><u></u> <u></u></p>
              <div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US">Hi Richard,</span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US">as you
                      suggested we factored out the Cross Translation
                      Unit feature into a separate library:</span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US"><a href="https://reviews.llvm.org/D30691" target="_blank"><span style="color:purple">https://reviews.llvm.org/D30691</span></a></span><u></u><u></u></p>
                </div>
              </div>
            </blockquote>
            <div>
              <p class="MsoNormal"><u></u> <u></u></p>
            </div>
            <p class="MsoNormal">Is the addition of the separate library
              done in its own patch? The link above just points to the
              Cross TU static analyzer patch.<u></u><u></u></p>
          </div>
          <div>
            <p class="MsoNormal"><br>
              <br>
              <u></u><u></u></p>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US">called
                      “CrossTU”.</span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
                </div>
              </div>
            </blockquote>
          </div>
          <div>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US">We are waiting
                      for your approval for the name of the library.</span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US">This is
                      blocking our work on upstreaming the Cross TU
                      function in Clang Static Analyzer (<a href="https://reviews.llvm.org/D30691" target="_blank"><span style="color:purple">https://reviews.llvm.org/D30691</span></a>).</span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US">Could you
                      please take a look?</span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US">Thanks,</span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US">Daniel</span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span class="m_7636952234924209838apple-converted-space"><span lang="EN-US"> </span></span><span lang="EN-US">cfe-dev [<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">mailto:cfe-dev-bounces@lists.llvm.org</a>]<span class="m_7636952234924209838apple-converted-space"> </span><b>On
                        Behalf Of<span class="m_7636952234924209838apple-converted-space"> </span></b>Manuel
                      Klimek via cfe-dev<br>
                      <b>Sent:</b><span class="m_7636952234924209838apple-converted-space"> </span>2017.
                      július 6. 11:34<br>
                      <b>To:</b><span class="m_7636952234924209838apple-converted-space"> </span>Gábor
                      Horváth <<a href="mailto:xazax.hun@gmail.com" target="_blank">xazax.hun@gmail.com</a>>;
                      Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>><br>
                      <b>Cc:</b><span class="m_7636952234924209838apple-converted-space"> </span>Clang
                      Dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br>
                      <b>Subject:</b><span class="m_7636952234924209838apple-converted-space"> </span>Re:
                      [cfe-dev] Cross Translation Unit Support in Clang</span><u></u><u></u></p>
                </div>
                <div>
                  <p class="MsoNormal"> <u></u><u></u></p>
                </div>
                <div>
                  <div>
                    <div>
                      <div>
                        <p class="MsoNormal">On Thu, Jul 6, 2017 at
                          10:57 AM Gábor Horváth <<a href="mailto:xazax.hun@gmail.com" target="_blank"><span style="color:purple">xazax.hun@gmail.com</span></a>>
                          wrote:<u></u><u></u></p>
                      </div>
                    </div>
                    <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                      <div>
                        <div>
                          <div>
                            <div>
                              <p class="MsoNormal">On 5 July 2017 at
                                23:09, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank"><span style="color:purple">richard@metafoo.co.uk</span></a>>
                                wrote:<u></u><u></u></p>
                            </div>
                            <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                              <div>
                                <div>
                                  <div>
                                    <div>
                                      <p class="MsoNormal">On 26 June
                                        2017 at 07:16, Manuel Klimek
                                        <<a href="mailto:klimek@google.com" target="_blank"><span style="color:purple">klimek@google.com</span></a>>
                                        wrote:<u></u><u></u></p>
                                    </div>
                                    <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                      <div>
                                        <div>
                                          <div>
                                            <div>
                                              <p class="MsoNormal">On
                                                Mon, Jun 26, 2017 at
                                                4:08 PM Gábor Horváth
                                                via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank"><span style="color:purple">cfe-dev@lists.llvm.org</span></a>>
                                                wrote:<u></u><u></u></p>
                                            </div>
                                          </div>
                                          <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                            <div>
                                              <div>
                                                <p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<u></u><u></u></p>
                                              </div>
                                              <div>
                                                <p class="MsoNormal">Some
                                                  benchmarks of the
                                                  binary size after
                                                  introducing the
                                                  libTooling dependency
                                                  to clang (using static
                                                  linking on Linux):<u></u><u></u></p>
                                              </div>
                                              <div>
                                                <div>
                                                  <div>
                                                    <p class="MsoNormal"><br>
                                                      Release:<u></u><u></u></p>
                                                  </div>
                                                  <div>
                                                    <div>
                                                      <p class="MsoNormal">85457072
                                                        -> 85505864<u></u><u></u></p>
                                                    </div>
                                                  </div>
                                                  <div>
                                                    <p class="MsoNormal" style="margin-bottom:12.0pt">Debug:<br>
                                                      1777932672 ->
                                                      1779938696<u></u><u></u></p>
                                                  </div>
                                                  <div>
                                                    <div>
                                                      <p class="MsoNormal">The
                                                        increase is less
                                                        than 1% in both
                                                        cases. So, in my
                                                        opinion, the
                                                        binary size is
                                                        not really a
                                                        problem here.<u></u><u></u></p>
                                                    </div>
                                                  </div>
                                                  <div>
                                                    <div>
                                                      <p class="MsoNormal">Of
                                                        course, the link
                                                        times might
                                                        increase a bit
                                                        as well.<span class="m_7636952234924209838apple-converted-space"> </span><u></u><u></u></p>
                                                    </div>
                                                  </div>
                                                  <div>
                                                    <div>
                                                      <p class="MsoNormal"> <u></u><u></u></p>
                                                    </div>
                                                  </div>
                                                  <div>
                                                    <div>
                                                      <p class="MsoNormal">A
                                                        question is, who
                                                        should make the
                                                        call whether
                                                        this penalty is
                                                        ok or not?<u></u><u></u></p>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </blockquote>
                                          <div>
                                            <div>
                                              <p class="MsoNormal"> <u></u><u></u></p>
                                            </div>
                                          </div>
                                          <div>
                                            <div>
                                              <p class="MsoNormal">(after
                                                replying on the patch
                                                without noticing that
                                                this thread is not part
                                                of the patch, here it
                                                goes again :) <u></u><u></u></p>
                                            </div>
                                          </div>
                                          <div>
                                            <div>
                                              <p class="MsoNormal"><span style="font-size:10.0pt;color:#212121">Richard (cc'ed) usually owns
                                                  decisions around clang
                                                  itself. Writing an
                                                  email to cfe-dev with
                                                  the numbers and wait
                                                  for whether others
                                                  have concerns would
                                                  probably also be good
                                                  (many will probably
                                                  not continue reading
                                                  this thread).</span><u></u><u></u></p>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </blockquote>
                                    <div>
                                      <div>
                                        <p class="MsoNormal"> <u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal">I'm a bit
                                          lost as to what's actually
                                          being proposed here. It seems
                                          that there are at least three
                                          separate questions:<u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal"> <u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal">1) Does
                                          some kind of support for a
                                          database of multiple
                                          translation units belong in
                                          Clang? (The exact design of
                                          that database can be discussed
                                          separately.)<u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal">2) Should
                                          it be a separate library or
                                          part of libTooling?<u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal">3) Is it
                                          acceptable for the clang
                                          static analyser (and thus the
                                          clang binary) to link against
                                          that library?<u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal"> <u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal">My
                                          thoughts:<u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal"> <u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal">1: Yes,
                                          this seems like a sensible
                                          thing to have within the clang
                                          repository, particularly if
                                          there would be in-tree users
                                          of it. The clang static
                                          analyser would be one
                                          justification for this;
                                          another would be support of
                                          exported templates (if we ever
                                          want to be C++98
                                          feature-complete). We'll need
                                          to discuss what the model is
                                          for this layer (multiple
                                          ASTContexts? one ASTContext
                                          modeling multiple TUs?), and
                                          how it fits in with other
                                          parts of Clang that solve
                                          similar problems (particularly
                                          ExternalASTSources, the
                                          serialization layer,
                                          ASTImporter).<u></u><u></u></p>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </blockquote>
                            <div>
                              <div>
                                <p class="MsoNormal"> <u></u><u></u></p>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>
                                <p class="MsoNormal">This functionality
                                  basically using the serialization
                                  layer and ASTImporter, and provides
                                  the user with an easy interface to
                                  import function definitions from other
                                  TU and merge into the current one.
                                  This could be extended to any kinds of
                                  definitions once users need that.<span class="m_7636952234924209838apple-converted-space"> </span><u></u><u></u></p>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>
                                <p class="MsoNormal"> <u></u><u></u></p>
                              </div>
                            </div>
                            <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                              <div>
                                <div>
                                  <div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal"> <u></u><u></u></p>
                                      </div>
                                    </div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal">2: I
                                          haven't seen anyone provide
                                          good justification for merging
                                          this library with libTooling,
                                          and the fact that the static
                                          analyser wants to use this and
                                          doesn't want tooling support
                                          strongly suggests to me that
                                          it should be separate.<u></u><u></u></p>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </blockquote>
                            <div>
                              <div>
                                <p class="MsoNormal"> <u></u><u></u></p>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <p class="MsoNormal" style="margin-bottom:12.0pt">Once we add
                                on demand reparsing instead of loading
                                AST files, the libTooling will be a
                                dependency of this code. Moreover it
                                does nothing static analyzer specific,
                                this is the reason why we was thinking
                                that libTooling is a good place for this
                                functionality.<u></u><u></u></p>
                            </div>
                            <div>
                              <div>
                                <p class="MsoNormal">The currently
                                  proposed (libTooling) functionality
                                  can load certain interesting function
                                  definitions from external source into
                                  the current AST, so existing single TU
                                  tools can operate on the AST with more
                                  available information as if they had
                                  cross TU capabilities.<span class="m_7636952234924209838apple-converted-space"> </span><u></u><u></u></p>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                    <div>
                      <div>
                        <p class="MsoNormal"> <u></u><u></u></p>
                      </div>
                    </div>
                    <div>
                      <div>
                        <p class="MsoNormal">I think we can generally
                          break everything that deals with running clang
                          out of libtooling into an extra library.<u></u><u></u></p>
                      </div>
                    </div>
                    <div>
                      <div>
                        <p class="MsoNormal"> <u></u><u></u></p>
                      </div>
                    </div>
                    <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                      <div>
                        <div>
                          <div>
                            <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                              <div>
                                <div>
                                  <div>
                                    <div>
                                      <div>
                                        <p class="MsoNormal">3: The
                                          above binary size increases
                                          seem acceptable for a
                                          significant feature that the
                                          static analyser needs.<u></u><u></u></p>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </blockquote>
                            <div>
                              <div>
                                <p class="MsoNormal"> <u></u><u></u></p>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <p class="MsoNormal" style="margin-bottom:12.0pt">Great news,
                                thanks!<u></u><u></u></p>
                            </div>
                            <div>
                              <div>
                                <p class="MsoNormal">Regards,<u></u><u></u></p>
                              </div>
                            </div>
                            <div>
                              <div>
                                <p class="MsoNormal">Gábor<u></u><u></u></p>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>
                                <p class="MsoNormal"> <u></u><u></u></p>
                              </div>
                            </div>
                            <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                              <div>
                                <div>
                                  <div>
                                    <div>
                                      <div>
                                        <div>
                                          <div>
                                            <p class="MsoNormal"> <u></u><u></u></p>
                                          </div>
                                        </div>
                                        <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                          <div>
                                            <div>
                                              <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                                <div>
                                                  <div>
                                                    <div>
                                                      <div>
                                                        <div>
                                                          <div>
                                                          <p class="MsoNormal">On
                                                          23 June 2017
                                                          at 22:06, Anna
                                                          Zaks <<a href="mailto:ganna@apple.com" target="_blank"><span style="color:purple">ganna@apple.com</span></a>>
                                                          wrote:<u></u><u></u></p>
                                                          </div>
                                                          <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">On
                                                          Jun 23, 2017,
                                                          at 12:39 PM,
                                                          Gábor Horváth
                                                          <<a href="mailto:xazax.hun@gmail.com" target="_blank"><span style="color:purple">xazax.hun@gmail.com</span></a>>
                                                          wrote:<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">This
                                                          is a
                                                          dependency for
                                                          the Static
                                                          Analyzer
                                                          component
                                                          within clang
                                                          (to another
                                                          component,
                                                          which is in
                                                          clang as
                                                          well).<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">OK.
                                                          This means
                                                          that we are
                                                          talking about
                                                          adding a
                                                          dependency on
                                                          libTooling to
                                                          clang. This
                                                          would not only
                                                          effect the
                                                          static
                                                          analyzer, so
                                                          we’d need an
                                                          OK from a
                                                          greater clang
                                                          community.<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal"><br>
                                                          <br>
                                                          <br>
                                                          <u></u><u></u></p>
                                                          </div>
                                                          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">It
                                                          is a similar
                                                          dependency to
                                                          this:<span class="m_7636952234924209838apple-converted-space"> </span><a href="https://github.com/llvm-mirror/clang/commit/a994aad333a56b8c9dd49bcfb5090a393d193387" target="_blank"><span style="color:purple">https://github.com/llvm-mirror/clang/commit/a994aad333a56b8c9dd49bcfb5090a393d193387</span></a><u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">There
                                                          are 2
                                                          differences
                                                          from the
                                                          dependency on
                                                          ASTMatchers:<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> -
                                                          Nothing that
                                                          is presently
                                                          in libTooling
                                                          us used by
                                                          clang.<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                    <div>
                                                      <div>
                                                        <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">This
                                                          is actually
                                                          not a
                                                          difference.
                                                          When the
                                                          commit above
                                                          was excepted,
                                                          it was the
                                                          first use of
                                                          ASTMatchers in
                                                          the clang
                                                          binary.<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                    <div>
                                                      <div>
                                                        <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> -
                                                          The new
                                                          component that
                                                          the analyzer
                                                          will depend on
                                                          will be
                                                          supporting a
                                                          very
                                                          experimental
                                                          feature.<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">The
                                                          other
                                                          expedient
                                                          options that I
                                                          can see are:<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> -
                                                          Adding a
                                                          separate
                                                          library with
                                                          just the
                                                          functionality
                                                          that this
                                                          feature needs.<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> -
                                                          Making the
                                                          dependency
                                                          conditional,
                                                          following the
                                                          same style as
                                                          Z3 support,
                                                          and keeping it
                                                          that way until
                                                          the feature is
                                                          fully
                                                          implemented.
                                                          This solution
                                                          definitely has
                                                          downsides.<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">Yet
                                                          another
                                                          solution is to
                                                          pull the
                                                          analyzer out
                                                          of clang, but
                                                          unfortunately
                                                          that is
                                                          non-trivial,
                                                          so I am not
                                                          sure if there
                                                          are volunteers
                                                          for the task.<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                    <div>
                                                      <div>
                                                        <div>
                                                          <div>
                                                          <p class="MsoNormal" style="margin-bottom:12.0pt">I agree that pulling the analyzer out is a
                                                          big task and
                                                          would also
                                                          break the
                                                          backward
                                                          compatibility
                                                          of the command
                                                          line. So it is
                                                          not the best
                                                          solution for
                                                          the users.<u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">Regards,<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">Gábor<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                    <div>
                                                      <div>
                                                        <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"><span style="color:#888888">Anna.</span><u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">On
                                                          23 June 2017
                                                          at 19:48, Anna
                                                          Zaks <<a href="mailto:ganna@apple.com" target="_blank"><span style="color:purple">ganna@apple.com</span></a>>
                                                          wrote:<u></u><u></u></p>
                                                          </div>
                                                          <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">On
                                                          Jun 23, 2017,
                                                          at 1:40 AM,
                                                          Gábor Horváth
                                                          <<a href="mailto:xazax.hun@gmail.com" target="_blank"><span style="color:purple">xazax.hun@gmail.com</span></a>>
                                                          wrote:<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal" style="margin-bottom:12.0pt">Anna,<u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal">Are
                                                          you ok having
                                                          libTooling as
                                                          a dependency
                                                          of the Static
                                                          Analyzer?<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">Are
                                                          we talking
                                                          about
                                                          introducing
                                                          dependency for
                                                          scan-build or
                                                          clang itself?<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal" style="margin-bottom:12.0pt">I think this is not a bad direction since
                                                          it has other
                                                          good utilities
                                                          that the
                                                          Static
                                                          Analyzer could
                                                          use in the
                                                          future such as
                                                          Replacements,
                                                          FixIts.<u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal">Regards,<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal">Gábor<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">On
                                                          22 June 2017
                                                          at 12:10,
                                                          Manuel Klimek
                                                          <<a href="mailto:klimek@google.com" target="_blank"><span style="color:purple">klimek@google.com</span></a>>
                                                          wrote:<u></u><u></u></p>
                                                          </div>
                                                          <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">For
                                                          clang tooling,
                                                          I don't really
                                                          expect us to
                                                          do cross-TU
                                                          AST loading
                                                          outside of
                                                          what modules
                                                          will provide,
                                                          as that
                                                          inherently
                                                          doesn't scale.
                                                          Instead, we
                                                          usually design
                                                          pipelined
                                                          approaches
                                                          where the
                                                          first "scan"
                                                          over the
                                                          codebase
                                                          provides data
                                                          which are
                                                          reduced to the
                                                          information
                                                          needed for the
                                                          tool.<u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">That
                                                          said, I can't
                                                          predict the
                                                          future, and
                                                          people have
                                                          expressed
                                                          interest in
                                                          that
                                                          functionality,
                                                          so<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">a)
                                                          I agree it's a
                                                          good idea to
                                                          add and <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">b)
                                                          I think it's a
                                                          good fit for
                                                          libtooling<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">Cheers,<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">/Manuel<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p class="MsoNormal">On
                                                          Thu, Jun 22,
                                                          2017 at 11:58
                                                          AM Aleksei
                                                          Sidorin <<a href="mailto:a.sidorin@samsung.com" target="_blank"><span style="color:purple">a.sidorin@samsung.com</span></a>> wrote:<u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
                                                          <p class="MsoNormal" style="margin-bottom:12.0pt">Hello Gabor,<br>
                                                          <br>
                                                          Internally, we
                                                          have created
                                                          XTU module
                                                          inside clang
                                                          (lib/XTU). I
                                                          think<br>
                                                          it is the best
                                                          way because
                                                          importing is
                                                          not related to
                                                          analyzer<br>
                                                          directly.
                                                          We're not
                                                          going to use
                                                          it outside of
                                                          CSA but I
                                                          think future<br>
                                                          users should
                                                          have such
                                                          possibility.<br>
                                                          <br>
                                                          22.06.2017
                                                          12:41, Gábor
                                                          Horváth пишет:<br>
                                                          > Hi!<br>
                                                          ><br>
                                                          > It looks
                                                          like there is
                                                          a consensus to
                                                          accept the
                                                          cross
                                                          translation<br>
                                                          > unit
                                                          analysis patch
                                                          into the clang
                                                          static
                                                          analyzer:<br>
                                                          ><span class="m_7636952234924209838apple-converted-space"> </span><a href="https://reviews.llvm.org/D30691" target="_blank"><span style="color:purple">https://reviews.llvm.org/D30691</span></a><br>
                                                          ><br>
                                                          > There is
                                                          one part of
                                                          the patch that
                                                          is independent
                                                          of the static<br>
                                                          > analyzer.
                                                          The logic
                                                          which can look
                                                          up a function
                                                          in an index
                                                          and load<br>
                                                          > a
                                                          serialized AST
                                                          that contains
                                                          the definition
                                                          of the
                                                          function.<br>
                                                          > The
                                                          lookup is
                                                          cached, and
                                                          after the AST
                                                          is loaded, the
                                                          function<br>
                                                          >
                                                          definition
                                                          will be merged
                                                          into the
                                                          original AST.<br>
                                                          ><br>
                                                          > Right
                                                          now, in the
                                                          current patch,
                                                          this
                                                          functionality
                                                          is in the<br>
                                                          >
                                                          ASTContext.
                                                          This is
                                                          definitely not
                                                          the right
                                                          place to put
                                                          this. So the<br>
                                                          > question
                                                          is, do you
                                                          plan to
                                                          utilize
                                                          similar
                                                          functionality
                                                          in Clang<br>
                                                          > tooling
                                                          or clang tidy?<br>
                                                          ><br>
                                                          > If yes,
                                                          we might end
                                                          up creating a
                                                          new module for
                                                          that (or add
                                                          it to<br>
                                                          > an
                                                          existing
                                                          commonly used
                                                          one like
                                                          libtooling?).
                                                          If no, we will
                                                          move<br>
                                                          > the
                                                          corresponding
                                                          code to the
                                                          static
                                                          analyzer.<br>
                                                          ><br>
                                                          > What do
                                                          you think?<br>
                                                          ><br>
                                                          > In case
                                                          you are
                                                          interested in
                                                          how it works,
                                                          you can check
                                                          out the<br>
                                                          > EuroLLVM
                                                          talk:<br>
                                                          ><span class="m_7636952234924209838apple-converted-space"> </span><a href="http://llvm.org/devmtg/2017-03/2017/02/20/accepted-sessions.html#7" target="_blank"><span style="color:purple">http://llvm.org/devmtg/2017-03//2017/02/20/accepted-sessions.html#7</span></a><br>
                                                          ><br>
                                                          > Regards,<br>
                                                          > Gábor<br>
                                                          <br>
                                                          <br>
                                                          --<br>
                                                          Best regards,<br>
                                                          Aleksei
                                                          Sidorin,<br>
                                                          SRR, Samsung
                                                          Electronics<u></u><u></u></p>
                                                          </blockquote>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          <div>
                                                          <p class="MsoNormal"> <u></u><u></u></p>
                                                          </div>
                                                          </div>
                                                          </blockquote>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                                <div>
                                                  <p class="MsoNormal">_______________________________________________<br>
                                                    cfe-dev mailing list<br>
                                                    <a href="mailto:cfe-dev@lists.llvm.org" target="_blank"><span style="color:purple">cfe-dev@lists.llvm.org</span></a><br>
                                                    <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank"><span style="color:purple">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</span></a><u></u><u></u></p>
                                                </div>
                                              </blockquote>
                                            </div>
                                          </div>
                                        </blockquote>
                                      </div>
                                    </div>
                                  </div>
                                  <div>
                                    <p class="MsoNormal"> <u></u><u></u></p>
                                  </div>
                                </div>
                              </div>
                            </blockquote>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                </div>
                <p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">_______________________________________________<br>
                    cfe-dev mailing list<br>
                  </span><a href="mailto:cfe-dev@lists.llvm.org" target="_blank"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:purple">cfe-dev@lists.llvm.org</span></a><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><br>
                  </span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:purple">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</span></a><u></u><u></u></p>
              </div>
            </blockquote>
          </div>
          <p class="MsoNormal"><u></u> <u></u></p>
        </div>
      </div>
      <br>
      <fieldset class="m_7636952234924209838mimeAttachmentHeader"></fieldset>
      <br>
      <pre>_______________________________________________
cfe-dev mailing list
<a class="m_7636952234924209838moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>
<a class="m_7636952234924209838moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </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>