[all-commits] [llvm/llvm-project] 9e64fc: [alpha.webkit.UnretainedCallArgsChecker] Add a che...

Ryosuke Niwa via All-commits all-commits at lists.llvm.org
Tue Mar 11 12:47:34 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e64fc6fb7d9a1ea9fe59d82380219508aee649f
      https://github.com/llvm/llvm-project/commit/9e64fc6fb7d9a1ea9fe59d82380219508aee649f
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M clang/docs/analyzer/checkers.rst
    M clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
    M clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
    M clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
    M clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefCallArgsChecker.cpp
    A clang/test/Analysis/Checkers/WebKit/unretained-call-args-arc.mm
    A clang/test/Analysis/Checkers/WebKit/unretained-call-args.mm

  Log Message:
  -----------
  [alpha.webkit.UnretainedCallArgsChecker] Add a checker for NS or CF type call arguments. (#130729)

This PR adds alpha.webkit.UnretainedCallArgsChecker by generalizing
RawPtrRefCallArgsChecker. It checks call arguments of NS or CF types are
backed by a RetainPtr or not. The new checker emits warnings for CF
types in Objective-C++ code regardless of ARC and it emits warning for
NS types when ARC is disabled.

Hard-code a few cases as safe: class and superclass properties on class
interfaces and constant dictionary or array literals as well as the
return value of NSClassFromString.

Finally, add the support for variadic function calls and selector
invocations.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list