<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>This thread also discusses options on working with multiple TUs:</div><div><br></div><div><a href="http://clang-developers.42468.n3.nabble.com/C-analysis-with-Clang-td4024252.html">http://clang-developers.42468.n3.nabble.com/C-analysis-with-Clang-td4024252.html</a></div><div><br><div><div>On Jun 11, 2012, at 8:24 PM, Anna Zaks wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Jun 11, 2012, at 6:23 PM, Alexandros Tzannes wrote:<br><br><blockquote type="cite">Hi all,<br></blockquote><blockquote type="cite">I am interested in using Clang to write a checker that reads in custom annotations (we are considering using attributes rather than pragmas) to guarantee the absence of some types of bugs. The next step after this is done would be to try and infer as many of the annotations as possible, but this will require whole program analysis. I know that clang works per translation unit (TU), so I was wondering if there is some advice on how to go about it. Perhaps serialize the AST of different TUs, merge them and analyze the whole program offline (after compilation) to prove the desired safety guarantees.<br></blockquote><br>Are you planning to write a static analyzer checker? In general, we are interested in adding whole program analyzes to the analyzer, but it's an ambitious project.<br><br><blockquote type="cite">It may actually be possible to perform inference per TU, as long as any cyclic call-graph dependencies are within a single TU.<br></blockquote><blockquote type="cite"><br></blockquote><br>Scalability wise, developing summary based analyzes is better than serializing the AST. (Very simply put, you'd analyze each function separately, store their summaries, and re-analyze all the functions again taking into account the generated info. If you have cyclic dependencies, you could consider repeating the process more than once.)<br><br><br><blockquote type="cite">Any feedback/brainstorming will be greatly appreciated!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Cheers!<br></blockquote><blockquote type="cite">Alex<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">cfe-dev mailing list<br></blockquote><blockquote type="cite"><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br></blockquote><blockquote type="cite"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></div></blockquote></div><br></div></body></html>