<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 31, 2013, at 11:15 AM, Manuel Klimek <<a href="mailto:klimek@google.com">klimek@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr">On Wed, Jul 31, 2013 at 8:07 PM, Anna Zaks<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: 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 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></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 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></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<span class="Apple-converted-space"> </span><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></div></div></div></blockquote><div dir="auto"><br></div><div dir="auto">This makes perfect sense. Our current cross-function analysis assumes availability of the function implementations and we know that this approach definitely will not scale to cross-translation unit analysis.</div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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></div></div></div></blockquote><div><br></div><div>Very exciting. We'd be very interested to find out what you learn from this (good and bad)!</div><div><br></div><div>By the way, you can run the analyzer in "shallow" mode, which will turn off most of the interprocedural analysis and minimize the analysis time in other ways. This might be an option when the default analyzer mode does not scale.</div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Cheers,</div><div>/Manuel</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: 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 style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><u></u> <u></u></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 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>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank" style="color: purple; text-decoration: underline;">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank" style="color: purple; text-decoration: underline;">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></blockquote></div></div></div></div></blockquote></div><br></body></html>