[all-commits] [llvm/llvm-project] 903773: [analyzer] Support allocClassWithName in OSObjectC...

Valeriy Savchenko via All-commits all-commits at lists.llvm.org
Tue Mar 30 05:58:35 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 90377308de6cac8239bc1a1dcd32b57b9ec91444
      https://github.com/llvm/llvm-project/commit/90377308de6cac8239bc1a1dcd32b57b9ec91444
  Author: Valeriy Savchenko <vsavchenko at apple.com>
  Date:   2021-03-30 (Tue, 30 Mar 2021)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp
    M clang/test/Analysis/os_object_base.h
    M clang/test/Analysis/osobjectcstylecastchecker_test.cpp

  Log Message:
  -----------
  [analyzer] Support allocClassWithName in OSObjectCStyleCast checker

`allocClassWithName` allocates an object with the given type.
The type is actually provided as a string argument (type's name).
This creates a possibility for not particularly useful warnings
from the analyzer.

In order to combat with those, this patch checks for casts of the
`allocClassWithName` results to types mentioned directly as its
argument.  All other uses of this method should be reasoned about
as before.

rdar://72165694

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




More information about the All-commits mailing list