compilerplugins/clang/unusedmethods.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
New commits: commit 430fffdd64af4ae09bbc49328c5188fc2dd4e185 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jun 10 12:18:15 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jun 11 14:58:39 2021 +0200 loplugin:unusedmethods improve filtering Change-Id: I75771dbcecd58259bffdd2ddb0df631205aa8d93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117032 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/compilerplugins/clang/unusedmethods.py b/compilerplugins/clang/unusedmethods.py index 803b0b87733b..1a04e81809d2 100755 --- a/compilerplugins/clang/unusedmethods.py +++ b/compilerplugins/clang/unusedmethods.py @@ -227,19 +227,30 @@ for d in definitionSet: # debug code if d[1] == "writerfilter::ooxml::OOXMLPropertySet::toString()": continue + # ignore lambdas + if "::__invoke(" in d[1]: + continue; + if "::operator " in d[1] and "(*)(" in d[1]: + continue; location = definitionToSourceLocationMap[d]; # windows only if location.startswith("include/svl/svdde.hxx"): continue # fluent API (return ref to self) if location.startswith("include/tools/stream.hxx"): continue + if location.startswith("include/oox/helper/refvector.hxx"): continue + if location.startswith("include/oox/drawingml/chart/modelbase.hxx"): continue + # templates + if location.startswith("include/vcl/vclptr.hxx"): continue + # external API + if location.startswith("include/LibreOfficeKit/LibreOfficeKit.hxx"): continue tmp2set.add((method, location)) #Disable this for now, not really using it # print output, sorted by name and line number -#with open("compilerplugins/clang/unusedmethods.unused-returns.results", "wt") as f: -# for t in sort_set_by_natural_key(tmp2set): -# f.write(t[1] + "\n") -# f.write(" " + t[0] + "\n") +with open("compilerplugins/clang/unusedmethods.unused-returns.results", "wt") as f: + for t in sort_set_by_natural_key(tmp2set): + f.write(t[1] + "\n") + f.write(" " + t[0] + "\n") # -------------------------------------------------------------------------------------------- _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits