This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Add the type of the leaked object to the diagnostic message
ClosedPublic

Authored by george.karpenkov on Nov 28 2018, 2:51 PM.

Details

Summary

If the object is a temporary, and there is no variable it binds to, let's at least print out the object type in order to help differentiate it from other temporaries.

rdar://45175098

Diff Detail

Repository
rC Clang

Event Timeline

NoQ added inline comments.Nov 29 2018, 1:00 PM
clang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
3837 ↗(On Diff #175774)

Should we drop the * here? I.e., MyObj sounds more like a type of an object than MyObj *.

george.karpenkov edited the summary of this revision. (Show Details)
NoQ added inline comments.Nov 29 2018, 5:59 PM
clang/test/Analysis/osobject-retain-release.cpp
64 ↗(On Diff #176005)

"OSObject of type OSArray" sounds redundant. Maybe "object of type OSArray"?

Also this warning has always violated the rule of dropping all articles from the message (:

NoQ accepted this revision.Nov 29 2018, 6:03 PM

These aren't critical, feel free to address later :)

This revision is now accepted and ready to land.Nov 29 2018, 6:03 PM
This revision was automatically updated to reflect the committed changes.