[all-commits] [llvm/llvm-project] 239c53: [analyzer] Track runtime types represented by Obj-...

Valeriy Savchenko via All-commits all-commits at lists.llvm.org
Wed Apr 29 03:37:27 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 239c53b72b18d6fd6c5ad9a6d27cd09b950dc97a
      https://github.com/llvm/llvm-project/commit/239c53b72b18d6fd6c5ad9a6d27cd09b950dc97a
  Author: Valeriy Savchenko <vsavchenko at apple.com>
  Date:   2020-04-29 (Wed, 29 Apr 2020)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
    M clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
    M clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp
    M clang/lib/StaticAnalyzer/Core/CallEvent.cpp
    M clang/lib/StaticAnalyzer/Core/DynamicType.cpp
    M clang/lib/StaticAnalyzer/Core/ProgramState.cpp
    M clang/test/Analysis/cast-value-state-dump.cpp
    A clang/test/Analysis/class-object-state-dump.m
    M clang/test/Analysis/inlining/InlineObjCClassMethod.m
    M clang/test/Analysis/inlining/ObjCDynTypePopagation.m
    M clang/test/Analysis/retain-release-inline.m

  Log Message:
  -----------
  [analyzer] Track runtime types represented by Obj-C Class objects

Summary:
Objective-C Class objects can be used to do a dynamic dispatch on
class methods. The analyzer had a few places where we tried to overcome
the dynamic nature of it and still guess the actual function that
is being called. That was done mostly using some simple heuristics
covering the most widespread cases (e.g. [[self class] classmethod]).
This solution introduces a way to track types represented by Class
objects and work with that instead of direct AST matching.

rdar://problem/50739539

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




More information about the All-commits mailing list