]> granicus.if.org Git - clang/commit
[analyzer] Support modeling no-op BaseToDerived casts in ExprEngine.
authorArtem Dergachev <artem.dergachev@gmail.com>
Wed, 29 Aug 2018 22:43:31 +0000 (22:43 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Wed, 29 Aug 2018 22:43:31 +0000 (22:43 +0000)
commit0d516dba5ecd1008c998e89ada9a2d53a482da8c
tree2b9d9437295a30758d4c8606a5b6222bbc439a38
parent19ada6cb9bf6b625bfd756e126d50e7418ead4dc
[analyzer] Support modeling no-op BaseToDerived casts in ExprEngine.

Introduce a new MemRegion sub-class, CXXDerivedObjectRegion, which is
the opposite of CXXBaseObjectRegion, to represent such casts. Such region is
a bit weird because it is by design bigger than its super-region.
But it's not harmful when it is put on top of a SymbolicRegion
that has unknown extent anyway.

Offset computation for CXXDerivedObjectRegion and proper modeling of casts
still remains to be implemented.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340984 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def
lib/StaticAnalyzer/Core/MemRegion.cpp
lib/StaticAnalyzer/Core/RegionStore.cpp
lib/StaticAnalyzer/Core/Store.cpp
test/Analysis/casts.cpp