summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang/unusedfields.py
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-29 10:42:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-29 11:00:57 +0200
commit4cc2fc6cef4f76c1d203666cb5e47b5d70ec7be5 (patch)
tree76ef278f39f717bf89ec109ac4704d5f9ddf3dc5 /compilerplugins/clang/unusedfields.py
parentSmartArt: undo diagram elements' size change (diff)
downloadcore-4cc2fc6cef4f76c1d203666cb5e47b5d70ec7be5.tar.gz
core-4cc2fc6cef4f76c1d203666cb5e47b5d70ec7be5.zip
unusedfields loplugin writeonly analysis improvements
(1) ignore reads inside copy/move constructors/operator= (2) fix false+ when assigning to array field (3) ignore reference ("&") fields Change-Id: I69a1a1c567a0b28a783e605982e5150811b6cc4a
Diffstat (limited to 'compilerplugins/clang/unusedfields.py')
-rwxr-xr-xcompilerplugins/clang/unusedfields.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/compilerplugins/clang/unusedfields.py b/compilerplugins/clang/unusedfields.py
index 5d15b84ba528..0baf4c738cff 100755
--- a/compilerplugins/clang/unusedfields.py
+++ b/compilerplugins/clang/unusedfields.py
@@ -125,6 +125,9 @@ for d in definitionSet:
continue
if "::sfx2::sidebar::ControllerItem" in fieldType:
continue
+ # ignore reference fields, because writing to them actually writes to another field somewhere else
+ if fieldType.endswith("&"):
+ continue
writeonlySet.add((clazz + " " + definitionToTypeMap[d], srcLoc))