[CFG] NFC: Refactor ConstructionContext into a finite set of cases.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 27 Feb 2018 20:03:35 +0000 (20:03 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 27 Feb 2018 20:03:35 +0000 (20:03 +0000)
commit4068481bdb115194fe02c88f6b6dc12ebb4c9ddd
treefb634591e544128733b75f68d4f72c2f88ce1987
parent301991080e24ac402793ca6684daa2fc70647f8a
[CFG] NFC: Refactor ConstructionContext into a finite set of cases.

ConstructionContext is moved into a separate translation unit and is separated
into multiple classes. The "old" "raw" ConstructionContext is renamed into
ConstructionContextLayer - which corresponds to the idea of building the context
gradually layer-by-layer, but it isn't easy to use in the clients. Once
CXXConstructExpr is reached, layers that we've gathered so far are transformed
into the actual, "new-style" "flat" ConstructionContext, which is put into the
CFGConstructor element and has no layers whatsoever (until it actually needs
them, eg. aggregate initialization). The new-style ConstructionContext is
instead presented as a variety of sub-classes that enumerate different ways of
constructing an object in C++. There are 5 of these supported for now,
which is around a half of what needs to be supported.

The layer-by-layer buildup process is still a little bit weird, but it hides
all the weirdness in one place, that sounds like a good thing.

Differential Revision: https://reviews.llvm.org/D43533

llvm-svn: 326238
clang/include/clang/Analysis/CFG.h
clang/include/clang/Analysis/ConstructionContext.h [new file with mode: 0644]
clang/lib/Analysis/CFG.cpp
clang/lib/Analysis/CMakeLists.txt
clang/lib/Analysis/ConstructionContext.cpp [new file with mode: 0644]
clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp