summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-06-10 12:18:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-11 14:58:39 +0200
commit430fffdd64af4ae09bbc49328c5188fc2dd4e185 (patch)
treeaf8f7a1bb532fca74b9dacba2c90c299ff0dd345
parent39b8ce7081888b5d5e73ba0b49396b09ca7f3b61 (diff)
loplugin:unusedmethods improve filtering
Change-Id: I75771dbcecd58259bffdd2ddb0df631205aa8d93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117032 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rwxr-xr-xcompilerplugins/clang/unusedmethods.py19
1 files changed, 15 insertions, 4 deletions
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")
# --------------------------------------------------------------------------------------------