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

Authored by vsavchenko on Mar 11 2021, 3:22 AM.


[-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


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