[all-commits] [llvm/llvm-project] 4a7afc: [-Wcalled-once-parameter] Fix false positives for ...

Valeriy Savchenko via All-commits all-commits at lists.llvm.org
Thu Mar 18 02:32:45 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a7afc9a8843f4793296a260f7153fd2ef4ec497
      https://github.com/llvm/llvm-project/commit/4a7afc9a8843f4793296a260f7153fd2ef4ec497
  Author: Valeriy Savchenko <vsavchenko at apple.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M clang/lib/Analysis/CalledOnceCheck.cpp
    M clang/test/SemaObjC/warn-called-once.m

  Log Message:
  -----------
  [-Wcalled-once-parameter] Fix false positives for cleanup attr

Cleanup attribute allows users to attach a destructor-like functions
to variable declarations to be called whenever they leave the scope.
The logic of such functions is not supported by the Clang's CFG and
is too hard to be reasoned about.  In order to avoid false positives
in this situation, we assume that we didn't see ALL of the executtion
paths of the function and, thus, can warn only about multiple call
violation.

rdar://74441906

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




More information about the All-commits mailing list