New loplugin:unusedmember

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 5 December 2019 12:30 EST

- See comment at head of compilerplugins/clang/unusedmember.cxx for description.

- Moved isAllRelevantCodeDefined from loplugin:fakebool to PluginHandler for reuse. (Made it a member function so that it can reuse its two RecordCompleteMap instances across different loplugins. Probably safer lifecycle-wise to have them as PluginHandler members than to have them as static local variables in function isAllRelevantCodeDefined.)

- Need Plugin::ignoreLocation overload for TypeLoc now, thanks to UnusedMember::VisitElaboratedTypeLoc.

- UETT_PreferredAlignOf was split off UETT_AlignOf with "PR26547: alignof should return ABI alignment, not preferred alignment".

- RecursiveASTVisitor::TraverseAlignedAttr traverses into the attribute's argument only since "Do not look through pack expansions when looking for unexpanded parameter packs".

Change-Id: Ic2702b03d4567fa2533333766de7920f3c524a69 Reviewed-on: https://gerrit.libreoffice.org/84416

6a10149c5fef New loplugin:unusedmember
compilerplugins/clang/fakebool.cxx | 114 +-------
compilerplugins/clang/plugin.hxx | 9 +
compilerplugins/clang/pluginhandler.cxx | 106 +++++++
compilerplugins/clang/pluginhandler.hxx | 11 +
compilerplugins/clang/test/unusedmember.cxx | 158 ++++++++++
compilerplugins/clang/unusedmember.cxx | 416 +++++++++++++++++++++++++++
solenv/CompilerTest_compilerplugins_clang.mk | 1 +
7 files changed, 704 insertions(+), 111 deletions(-)

Upstream: cgit.freedesktop.org


  • Share