summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-05-24 23:37:08 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2019-05-24 23:37:08 +0000
commit192a7474d6bc93918043d6f47cf1ad294c711dde (patch)
treeede226dcf74054d750143ffa1c429f40d1f3ae34 /clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp
parentfd42079255d04742e60954e98205a9212e2685ff (diff)
downloadbcm5719-llvm-192a7474d6bc93918043d6f47cf1ad294c711dde.tar.gz
bcm5719-llvm-192a7474d6bc93918043d6f47cf1ad294c711dde.zip
[CFG] Add branch to skip vbase inits when they're handled by superclass.
This patch adds the run-time CFG branch that would skip initialization of virtual base classes depending on whether the constructor is called from a superclass constructor or not. Previously the Static Analyzer was already skipping virtual base-class initializers in such constructors, but it wasn't skipping their arguments and their potential side effects, which was causing pr41300 (and was generally incorrect). The previous skipping behavior is now replaced with a hard assertion that we're not even getting there due to how our CFG works. The new CFG element is under a CFG build option so that not to break other consumers of the CFG by this change. Static Analyzer support for this change is implemented. Differential Revision: https://reviews.llvm.org/D61816 llvm-svn: 361681
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp b/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp
index 2e69c2c43b6..95f2b703cdd 100644
--- a/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp
+++ b/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp
@@ -35,7 +35,9 @@ AnalysisManager::AnalysisManager(ASTContext &ASTCtx, DiagnosticsEngine &diags,
Options.ShouldConditionalizeStaticInitializers,
/*addCXXNewAllocator=*/true,
Options.ShouldIncludeRichConstructorsInCFG,
- Options.ShouldElideConstructors, injector),
+ Options.ShouldElideConstructors,
+ /*addVirtualBaseBranches=*/true,
+ injector),
Ctx(ASTCtx), Diags(diags), LangOpts(ASTCtx.getLangOpts()),
PathConsumers(PDC), CreateStoreMgr(storemgr),
CreateConstraintMgr(constraintmgr), CheckerMgr(checkerMgr),
OpenPOWER on IntegriCloud