summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang/unusedmethods.py
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-09-22 13:12:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-09-22 13:13:05 +0000
commit1c15a20df81fef594ef8fa887247aef9f2248c28 (patch)
treec2308bf3962efdc44d0391b26eaddb3b1155ae1f /compilerplugins/clang/unusedmethods.py
parentsw: Clean up forward declarations (diff)
downloadcore-1c15a20df81fef594ef8fa887247aef9f2248c28.tar.gz
core-1c15a20df81fef594ef8fa887247aef9f2248c28.zip
loplugin:unusedmethods unused returns
Change-Id: I4da3374e31d3c7407b401d66275da7f56ae83d30 Reviewed-on: https://gerrit.libreoffice.org/29178 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/unusedmethods.py')
-rwxr-xr-xcompilerplugins/clang/unusedmethods.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/compilerplugins/clang/unusedmethods.py b/compilerplugins/clang/unusedmethods.py
index 6f679449172e..fb9412b20e13 100755
--- a/compilerplugins/clang/unusedmethods.py
+++ b/compilerplugins/clang/unusedmethods.py
@@ -154,7 +154,7 @@ with io.open("loplugin.unusedmethods.log", "rb", buffering=1024*1024) as txt:
returnType = tokens[1]
nameAndParams = tokens[2]
usedReturnSet.add((normalizeTypeParams(returnType), normalizeTypeParams(nameAndParams)))
- elif tokens[0] == "calledFromOutsideSet:":
+ elif tokens[0] == "outside:":
returnType = tokens[1]
nameAndParams = tokens[2]
calledFromOutsideSet.add((normalizeTypeParams(returnType), normalizeTypeParams(nameAndParams)))
@@ -315,7 +315,22 @@ for d in definitionSet:
# ignore the SfxPoolItem CreateDefault methods for now
if d[1].endswith("::CreateDefault()"):
continue
- tmp2set.add((method, definitionToSourceLocationMap[d]))
+ # ignore UNO constructor functions
+ if (d[0] == "class com::sun::star::uno::Reference<class com::sun::star::uno::XInterface>" and
+ d[1].endswith("_createInstance(const class com::sun::star::uno::Reference<class com::sun::star::lang::XMultiServiceFactory> &)")):
+ continue
+ if (d[0] == "class com::sun::star::uno::Reference<class com::sun::star::uno::XInterface>" and
+ d[1].endswith("_CreateInstance(const class com::sun::star::uno::Reference<class com::sun::star::lang::XMultiServiceFactory> &)")):
+ continue
+ # debug code
+ if d[1] == "writerfilter::ooxml::OOXMLPropertySet::toString()":
+ 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
+ tmp2set.add((method, location))
# print output, sorted by name and line number
with open("loplugin.unusedmethods.report-returns", "wt") as f: