[analyzer] CastValueChecker: Model casts
authorCsaba Dabis <dabis.csaba98@gmail.com>
Tue, 9 Jul 2019 23:33:23 +0000 (23:33 +0000)
committerCsaba Dabis <dabis.csaba98@gmail.com>
Tue, 9 Jul 2019 23:33:23 +0000 (23:33 +0000)
commit27cf6664437efd640bb6db5594bafcce68fa2854
tree6f6b345ad05324a6f921ca201db85e30e26a27c3
parentabce8c457dd3de6b156756e547cc0eefb7653c79
[analyzer] CastValueChecker: Model casts

Summary:
It models the LLVM casts:
- `cast<>`
- `dyn_cast<>`
- `cast_or_null<>`
- `dyn_cast_or_null<>`

It has a very basic support without checking the `classof()` function.

Reviewed By: NoQ

Tags: #clang

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

llvm-svn: 365582
clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp [new file with mode: 0644]
clang/test/Analysis/cast-value.cpp [new file with mode: 0644]
clang/test/Analysis/return-value-guaranteed.cpp