]> granicus.if.org Git - clang/commit
[analyzer] RetainCount: Add support for OSRequiredCast().
authorArtem Dergachev <artem.dergachev@gmail.com>
Wed, 19 Jun 2019 23:33:34 +0000 (23:33 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Wed, 19 Jun 2019 23:33:34 +0000 (23:33 +0000)
commitdd80aeb14dc7261c585619e26fbfdde0ae003ecc
tree6edd78cc092d5c32d32731e50344d581fc5163dc
parent9d03c2af57de761edb619640c5e4219a3eded199
[analyzer] RetainCount: Add support for OSRequiredCast().

It's a new API for custom RTTI in Apple IOKit/DriverKit framework that is
similar to OSDynamicCast() that's already supported, but crashes instead of
returning null (and therefore causing UB when the cast fails unexpectedly).
Kind of like cast_or_null<> as opposed to dyn_cast_or_null<> in LLVM's RTTI.

Historically, RetainCountChecker was responsible for modeling OSDynamicCast.
This is simply an extension of the same functionality.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363891 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/RetainSummaryManager.cpp
test/Analysis/os_object_base.h
test/Analysis/osobject-retain-release.cpp