zaks.anna added a comment.

One approach would be to skip analyzing the functions which we model as top 
level.

- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp

+++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -688,6 +688,9 @@ void AnalysisConsumer::ActionExprEngine(Decl *D, bool 
ObjCGCEnabled,

  if (!Mgr->getAnalysisDeclContext(D)->getAnalysis<RelaxedLiveVariables>())
    return;
   

+  if (Mgr->getAnalysisDeclContext(D)->isBodyAutosynthesized())
+    return;
+

  ExprEngine Eng(*Mgr, ObjCGCEnabled, VisitedCallees, &FunctionSummaries,IMode);

The main downside is that we will not be analyzing the bodies of functions that 
are being modeled at all, so we won't find bugs in them. On the other hand, 
those definitions should be coming from system headers anyway.

Another approach is along the lines of changing the 
AnalysisDeclContext::getBody() so that it does not choose model over a real 
body depending on context. It might be less clean and maintainable.


Repository:
  rL LLVM

https://reviews.llvm.org/D24792



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to