The analyzer uses heuristic that assumes that functions that were analyzed in some context will not be called out of some context. While it helps to suppress false positives, it also may lead to loss of some TPs. So, I think it is a good idea to allow user enabling of analysis of all functions. This behaviour is enabled via a specific option, default behaviour remains unchanged.
Details
Diff Detail
Event Timeline
Thanks. This is exactly what I needed. Very useful.
(If approved, needs a description in IPA.txt)
Thanks! I'll take a look.
Please, include context in the patch as described in http://llvm.org/docs/Phabricator.html.
We already do something similar for ObjC methods by default (we re-analyze them, but in a more shallow mode) but decided not to reanalyze the other functions as top level. Do you have any data on how many more issues are found with this option on on real codebases?
The better option name (and term to use) is "analyze externally visible functions as top-level" because they are analyzed but just not in all possible contexts or not as top-level.
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | ||
---|---|---|
444 | Could you wrap this in a helper just like the rest of the options are done in AnalyzerOptions.cpp? |
Could you wrap this in a helper just like the rest of the options are done in AnalyzerOptions.cpp?