<div dir="ltr"><div><div><div>Hi!<br><br></div>Do you have some updates? I checked the repository, and there are python scripts indicating cross TU analysis support (and there were also some ASTImporter work). I was wondering what is the state of this? What is the approach you are using? Does that approach work, when the unified AST possibly not fit into the memory?<br><br></div>Best Regards,<br></div>Gábor<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 26 October 2015 at 16:31, Artem Dergachev via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear All,<br>
<br>
We've published a snapshot of one of our development branches, which contains the Summary IPA prototype preview. As we mentioned, there are a lot of problems with it, including,<br>
<br>
  - it's branched from clang-3.4,<br>
  - it includes quite a bit of unrelated changes, including our inter-unit draft, in a single blob;<br>
<br>
so even though it's in no way ready for any sort of review, i guess it could help a bit as a temporary reference in discussing issues.<br>
<br>
We deeply apologize for the mess; of course the code will be changed significantly if/once we decide to put it on actual review for accepting into the base clang repo, but at least we got it at least somehow working and got a chance to make properly :)<br>
<br>
<br>
The github branch with a single blob for everything is at:<br>
<br>
  <a href="https://github.com/haoNoQ/clang/tree/summary-ipa-draft" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/tree/summary-ipa-draft</a><br>
<br>
<br>
<br>
=== Places to look at, with necessary pre-cautions :) ===<br>
<br>
<br>
  * ExprEngine::inlineCall()<br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp#L468" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp#L468</a><br>
<br>
<br>
Most of the calling bureaucracy is coded there, such as storing summaries, creating auxiliary ExprEngine's for constructing ExplodedGraphs for summaries, etc.<br>
<br>
-----<br>
<br>
  * include/clang/StaticAnalyzer/Core/PathSensitive/FunctionCallSummary.h<br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionCallSummary.h" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionCallSummary.h</a><br>
<br>
  * lib/StaticAnalyzer/Core/FunctionCallSummary.cpp<br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Core/FunctionCallSummary.cpp" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Core/FunctionCallSummary.cpp</a><br>
<br>
    These files include the alpha-renaming stuff (the "Summarizer" object and its "compose***()" methods), and the procedure of applying the summary ("CallFunction()"). The latter includes summary-apply procedures for store bindings (TODO - move to ***StoreManager.cpp, fix the necessary abstractions, fix HandleBinding() accordingly), return values, and calling checkers. TODO - the procedure for alpha-renaming CXXTempObjectRegion will be fixed, do not look there yet :)<br>
<br>
-----<br>
<br>
  * RangeConstraintManager::applyCallBranchSummary(),<br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp#L1337" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp#L1337</a><br>
<br>
  *                         handleSummaryRange()<br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp#L1295" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp#L1295</a><br>
<br>
    The procedure of applying the summary for range constraints, which includes finding pre-conditions for the summary and handling unreachable branches.<br>
<br>
-----<br>
<br>
  * lib/StaticAnalyzer/Checkers/IntegerOverflowChecker.cpp<br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Checkers/IntegerOverflowChecker.cpp" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Checkers/IntegerOverflowChecker.cpp</a><br>
<br>
  * lib/StaticAnalyzer/Checkers/ConstModifiedChecker.cpp<br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Checkers/ConstModifiedChecker.cpp" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/StaticAnalyzer/Checkers/ConstModifiedChecker.cpp</a><br>
<br>
    The two checkers, with necessary modifications for running under summary IPA, which were used for gathering experimental data. The IntegerOverflow checker was also discussed in <a href="http://reviews.llvm.org/D4066" rel="noreferrer" target="_blank">http://reviews.llvm.org/D4066</a> , authored by Julia Trofimovich, another colleague of ours, and the ConstModified checker was created by Alexey, also corresponding to one of the items in the list of potential checkers.<br>
<br>
-----<br>
<br>
  * test/Analysis/summary-ipa*<br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa.cpp" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa.cpp</a><br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa.c" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa.c</a><br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa-temporaries.cpp" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa-temporaries.cpp</a><br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa-symranges.cpp" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa-symranges.cpp</a><br>
<a href="https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa-xfail.cpp" rel="noreferrer" target="_blank">https://github.com/haoNoQ/clang/blob/summary-ipa-draft/test/Analysis/summary-ipa-xfail.cpp</a><br>
<br>
    Some fancy tests which we pass. They don't cover everything (TODO - we'd have to cover most of the paths during the refactoring, of course), but these tests already have some fancy examples we had to dig through.<br>
_______________________________________________<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><br></div>