<div dir="ltr">On Wed, Jul 31, 2013 at 8:07 PM, Anna Zaks <span dir="ltr"><<a href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br><div><div><div class="h5"><div>On Jul 30, 2013, at 2:37 PM, Aditya Kumar <<a href="mailto:hiraditya@codeaurora.org" target="_blank">hiraditya@codeaurora.org</a>> wrote:</div><br>
<blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
I was looking at the same problem and planning to work on it.<u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">What I’m planning to do is having a compiler flag which enables a user to perform compilation as well as static analysis at the same time,<u></u><u></u></div>
<div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">and make relevant changes in the clang driver to build a set of ‘Actions’ in the pipeline such that static analysis and compilation takes place simultaneously.</div>
</div></div></blockquote><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
This will have an overhead on the overall compilation time which is often not the desirable thing. But there is an advantage that this flag can be incorporated in the build-system of software.<u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Since the build systems are really good at tracking the files which have changed and compiling only the minimal set of required files,<u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
the overall turnaround time of static analysis will be very small and user can afford to run static analyzer with every build.<u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
</div></div></div></blockquote><div><br></div></div></div><div>Have you looked at how scan-build currently works? It does compile and analyze the source files (clang is called twice). It is also driven by the build system, so we are not reanalyzing files that the build system would not recompile.</div>
<div><br></div><div>The main advantage of keeping the scan-build-like interface is that, in the future, we plan to extend the analyzer to perform cross-file(translation unit) analysis. This is why we encourage the use of a single entry point (scan-build) when analyzing a project.</div>
<div><br></div><div>Said that, the current implementation of scan-build is hacky and could be improved (see <a href="http://clang-analyzer.llvm.org/open_projects.html" target="_blank">http://clang-analyzer.llvm.org/open_projects.html</a>).</div>
</div></div></blockquote><div><br></div><div>For what it's worth, I think the way to do large scale static analysis is to run over each TU in isolation, and output all the information needed to do the global analysis. Then, run the global analysis as a post-processing step, after sharding the information from that first step into parallelizable pieces.</div>
<div><br></div><div>Note that I'm not trying to contradict what you said :) Just wanted to throw in some experience. We are currently starting to run the analyzer on our internal code base (see Pavel's work) based on the Tooling/ stuff (clang-check has grown a --analyze flag) and would be very interested in having a system that allows full codebase analysis and still works on ~100MLOC codebases... ;)</div>
<div><br></div><div>Cheers,</div><div>/Manuel</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>
<br></div><div>Cheers,</div><div>Anna.</div><br><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div></div></div></blockquote><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div class="im"><div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">I wanted some feedback if this is a good idea or not.<u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<u></u> <u></u></div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">-Aditya<u></u><u></u></div></div></div>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" style="color:purple;text-decoration:underline" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" style="color:purple;text-decoration:underline" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote></div><br></div><br>_______________________________________________<br>

cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>