This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add project-level analysis support to misc-discarded-return-value
Needs ReviewPublic

Authored by bahramib on Apr 26 2022, 4:51 AM.

Details

Summary

This enables calculating the consumed/discarded distribution of function
calls for the entire project, resulting in more meaningful diagnostics.

Diff Detail

Event Timeline

bahramib created this revision.Apr 26 2022, 4:51 AM
bahramib requested review of this revision.Apr 26 2022, 4:51 AM
martong added inline comments.May 5 2022, 2:07 AM
clang-tools-extra/clang-tidy/misc/DiscardedReturnValueCheck.cpp
132

Please spell out the type instead of auto.

132–142

This could be split out nicely in a member function, e.g. findFunctionID.

204

How is it emitting dianoses then in the singleTU mode?

365

?

clang-tools-extra/clang-tidy/misc/DiscardedReturnValueCheck.h
70

Some docs could be useful here.