This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] RetainCount: Add support for OSRequiredCast().
ClosedPublic

Authored by NoQ on Jun 10 2019, 7:56 PM.

Details

Summary

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

Historically, RetainCountChecker is responsible for modeling OSDynamicCast, so i simply extend this functionality.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ created this revision.Jun 10 2019, 7:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2019, 7:56 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 19 2019, 4:30 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2019, 4:30 PM