<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.m-7319533834293648873m2411873673979389581m-1270824421744607859m-2006125352813471392gmail-
        {mso-style-name:m-7319533834293648873m2411873673979389581m-1270824421744607859m-2006125352813471392gmail-;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="HU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">this is the patch with the new library:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Add preliminary Cross Translation Unit support library<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><a href="https://reviews.llvm.org/D34512">https://reviews.llvm.org/D34512</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">we are blocked until this is not approved.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">                          
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Thanks & Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Daniel<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></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"> ganna@apple.com [mailto:ganna@apple.com]
<br>
<b>Sent:</b> 2017. július 20. 8:40<br>
<b>To:</b> Dániel Krupp <daniel.krupp@ericsson.com><br>
<b>Cc:</b> Manuel Klimek <klimek@google.com>; Gábor Horváth <xazax.hun@gmail.com>; Richard Smith <richard@metafoo.co.uk>; cfe-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [cfe-dev] Cross Translation Unit Support in Clang<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Daniel,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></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">cfe-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi Richard,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></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><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><a href="https://reviews.llvm.org/D30691"><span style="color:purple">https://reviews.llvm.org/D30691</span></a></span><o:p></o:p></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">called “CrossTU”.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></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><o:p></o:p></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"><span style="color:purple">https://reviews.llvm.org/D30691</span></a>).</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Could you please take a look?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Thanks,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Daniel</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span class="apple-converted-space"><span lang="EN-US"> </span></span><span lang="EN-US">cfe-dev [<a href="mailto:cfe-dev-bounces@lists.llvm.org">mailto:cfe-dev-bounces@lists.llvm.org</a>]<span class="apple-converted-space"> </span><b>On
 Behalf Of<span class="apple-converted-space"> </span></b>Manuel Klimek via cfe-dev<br>
<b>Sent:</b><span class="apple-converted-space"> </span>2017. július 6. 11:34<br>
<b>To:</b><span class="apple-converted-space"> </span>Gábor Horváth <<a href="mailto:xazax.hun@gmail.com">xazax.hun@gmail.com</a>>; Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>><br>
<b>Cc:</b><span class="apple-converted-space"> </span>Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
<b>Subject:</b><span class="apple-converted-space"> </span>Re: [cfe-dev] Cross Translation Unit Support in Clang</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></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"><span style="color:purple">xazax.hun@gmail.com</span></a>> wrote:<o:p></o:p></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:<o:p></o:p></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:<o:p></o:p></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:<o:p></o:p></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,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Some benchmarks of the binary size after introducing the libTooling dependency to clang (using static linking on Linux):<o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><br>
Release:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">85457072 -> 85505864<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Debug:<br>
1777932672 -> 1779938696<o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Of course, the link times might increase a bit as well.<span class="apple-converted-space"> </span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">A question is, who should make the call whether this penalty is ok or not?<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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 :) <o:p></o:p></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><o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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:<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.)<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">2) Should it be a separate library or part of libTooling?<o:p></o:p></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?<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">My thoughts:<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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).<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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="apple-converted-space"> </span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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"> <o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.<o:p></o:p></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="apple-converted-space"> </span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Great news, thanks!<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Gábor<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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"> <o:p></o:p></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:<o:p></o:p></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"> <o:p></o:p></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:<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></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).<o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></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="apple-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><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">There are 2 differences from the dependency on ASTMatchers:<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> - Nothing that is presently in libTooling us used by clang.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">The other expedient options that I can see are:<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> - Adding a separate library with just the functionality that this feature needs.<o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Gábor<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:#888888">Anna.</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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:<o:p></o:p></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"> <o:p></o:p></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:<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Anna,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Are you ok having libTooling as a dependency of the Static Analyzer?<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Are we talking about introducing dependency for scan-build or clang itself?<o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">Gábor<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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:<o:p></o:p></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.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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<o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal">a) I agree it's a good idea to add and <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">b) I think it's a good fit for libtooling<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">/Manuel<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"> <o:p></o:p></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:<o:p></o:p></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="apple-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="apple-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<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></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><o:p></o:p></p>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></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"><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"><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><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>