]> granicus.if.org Git - clang/commit
[CFG] Add branch to skip vbase inits when they're handled by superclass.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 24 May 2019 23:37:08 +0000 (23:37 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 24 May 2019 23:37:08 +0000 (23:37 +0000)
commit46470dfbaea8fa183182b9213f8b5735cd2e23d3
tree44a8d727e04d92f29373b3ef9bdf98db7407fdbb
parentb6c8a1bb5f92d3b82365c19fbb8f8feda36bb446
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361681 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Analysis/AnalysisDeclContext.h
include/clang/Analysis/CFG.h
include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
lib/Analysis/AnalysisDeclContext.cpp
lib/Analysis/CFG.cpp
lib/StaticAnalyzer/Core/AnalysisManager.cpp
lib/StaticAnalyzer/Core/CoreEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
test/Analysis/initializer.cpp
test/Analysis/initializers-cfg-output.cpp