]> granicus.if.org Git - clang/commit
[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)
commitf524e7c6ff95cfc17f369c75beb7a13a67060634
treea98be1ea786cb4ee4c7da8d8e966636a56dc94c3
parentb4b42d682156c989482f9c03c0eb52e2c1b8aa90
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326238 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Analysis/CFG.h
include/clang/Analysis/ConstructionContext.h [new file with mode: 0644]
lib/Analysis/CFG.cpp
lib/Analysis/CMakeLists.txt
lib/Analysis/ConstructionContext.cpp [new file with mode: 0644]
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp