diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-29 12:43:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-30 06:57:26 +0000 |
commit | 4d87443bf59c3242d58b56cc1583d73213ae1f2f (patch) | |
tree | c1f74fc569506299100b5063f14c09e46035a943 /compilerplugins | |
parent | 8e812b87ff7f8c5bf2c6f8858646c55effd2eea3 (diff) |
loplugin:constantparam
Change-Id: Idbe8c8e6b3d44cacce296ec8c79b2b244281057c
Reviewed-on: https://gerrit.libreoffice.org/29321
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rwxr-xr-x | compilerplugins/clang/constantparam.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/compilerplugins/clang/constantparam.py b/compilerplugins/clang/constantparam.py index ed5acc449968..2f930187666f 100755 --- a/compilerplugins/clang/constantparam.py +++ b/compilerplugins/clang/constantparam.py @@ -35,13 +35,24 @@ for callInfo, callValues in callDict.iteritems(): callValue = next(iter(callValues)) if "unknown" in callValue: continue + sourceLoc = callInfo[4] + functionSig = callInfo[0] + " " + callInfo[1] + # try and ignore setter methods if ("," not in nameAndParams) and (("::set" in nameAndParams) or ("::Set" in nameAndParams)): continue - v0 = callInfo[4] - v1 = callInfo[0] + " " + callInfo[1] + # ignore code that follows a common pattern + if sourceLoc.startswith("sw/inc/swatrset.hxx"): continue + if sourceLoc.startswith("sw/inc/format.hxx"): continue + # template generated code + if sourceLoc.startswith("include/sax/fshelper.hxx"): continue + # debug code + if sourceLoc.startswith("include/oox/dump"): continue + # part of our binary API + if sourceLoc.startswith("include/LibreOfficeKit"): continue + v2 = callInfo[3] + " " + callInfo[2] + " " + callValue - tmp1list.append((v0,v1,v2)) + tmp1list.append((sourceLoc, functionSig, v2)) # sort results by filename:lineno def natural_sort_key(s, _nsre=re.compile('([0-9]+)')): |