This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by vsavchenko on Mar 16 2021, 3:58 AM.

Details

Summary

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

Diff Detail

Event Timeline

vsavchenko created this revision.Mar 16 2021, 3:58 AM
vsavchenko requested review of this revision.Mar 16 2021, 3:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2021, 3:58 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
NoQ accepted this revision.Mar 16 2021, 8:56 PM

LGTM!

This revision is now accepted and ready to land.Mar 16 2021, 8:56 PM