43 Commits

Author SHA1 Message Date
Noel Grandin
6f9cdf0814 can-be-private analysis needs to ignore virtual methods
Change-Id: I1e2f28ed550ff9751912f70e3eec511ddc5b75cf
2016-11-22 08:34:16 +02:00
Noel Grandin
92da39d5f9 update couple of loplugins for move constructors
Change-Id: I82140569a3e09225065d721e4aeac5c5fe93bc45
2016-11-16 14:16:09 +02:00
Stephan Bergmann
7eea236a24 -Werror=unused-function
Change-Id: I9e0585460d908024f75a1134bc1cd20d12ea3b4e
2016-10-18 09:12:27 +02:00
Noel Grandin
40fd53a238 loplugins: extract some common functionality
Change-Id: If470e1d9b481c9eda0829aa985152baf8fb46d7a
2016-10-18 08:51:07 +02:00
Noel Grandin
281fa6ac6a some cleanups to the unusedmethods loplugin
- publicDefinitionSet is unnecessary, the python post-processor does not
need it
- remove the traversing of templates, clang will do that for us since we
have set the shouldVisitTemplateInstantiations() method

Change-Id: I0e96dad0b1cc941fe6c4a2e9227e86d8c3f1d85a
2016-10-18 08:51:07 +02:00
Noel Grandin
3468dab9ff clang plugins: do "dotdot" normalisation
which fixes some false positives

Change-Id: I555349180b5ca819f29695789f1545ba2177bd09
Reviewed-on: https://gerrit.libreoffice.org/29320
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-27 12:08:52 +00:00
Noel Grandin
1c15a20df8 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>
2016-09-22 13:13:05 +00:00
Noel Grandin
98c90acdfc loplugins: more consistent naming of output files
Change-Id: Ia26f697cb16078f235c94e4cff449a60c1bbd74e
2016-07-25 13:23:10 +02:00
Stephan Bergmann
9308f35318 Adapt to Clang 3.4 (in preparation of a buildbot on CentOS 7)
Change-Id: Ie2859f03b31c57deb7fd0deba3285f782e33b239
2016-06-28 16:26:33 +02:00
Noel Grandin
442dd6a153 loplugin: move parentFunctionDecl() into common code
Change-Id: Ia10a76a98a63c6ea3b516d9146281f672b213ab3
2016-06-28 14:53:17 +02:00
Stephan Bergmann
f8a18a464e Adpat to <https://llvm.org/svn/llvm-project/cfe/trunk@273647>
"Use more ArrayRefs"

Change-Id: Ied0ab11dd9366b3f499100b2627f4919cca52c9c
2016-06-24 16:46:55 +02:00
Stephan Bergmann
2712fc0869 I assume these special plugins were not intended to be enabled unconditionally
...with fa135fd0e05fc4ba784b4349d65f2e5ed26c0f55 "remove unused SID constants
and associated code"

Change-Id: I51b2a9e3c8ce13401818bca0c40167a4364212f1
2016-06-02 23:46:46 +02:00
Noel Grandin
fa135fd0e0 remove unused SID constants and associated code
found with a python script that looks like:

process = subprocess.Popen(
  "git ls-files *.hrc | xargs grep -hE '#define +SID_' | cut -d ' ' -f 2 | sort -u",
  shell=True, stdout=subprocess.PIPE)
for line in iter(process.stdout.readline, b''):
  line = line.strip()
  if line.startswith("//"): continue
  if line.startswith("sfx"): continue
  if len(line) < 10: continue
  i = subprocess.check_output("git grep -nP \"#define +" + line + " \"",
                              shell=True)
  if i.count("#define") < 2: continue
  print line + "
" + i

Change-Id: I40eac2569c2b5b129d9459cb723a9d6f26d09264
Reviewed-on: https://gerrit.libreoffice.org/25715
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-01 06:48:13 +00:00
Noel Grandin
d59125638b update unusedmethods plugin to ignore externC and copy constructors
Change-Id: Idf7a9403d313ba6a0e031c59601e20c880b6118b
2016-05-18 16:38:23 +02:00
Noel Grandin
2c8fe2e737 update unusedmethods plugin to deal with constructors
and fix the operator< implementations in some of the other
plugins too.

Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035
Reviewed-on: https://gerrit.libreoffice.org/25057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18 10:03:44 +00:00
Stephan Bergmann
01f3b95884 These version checks are about the Clang the plugins are built /against/
...not the (Clang) compiler they are being built /with/.  (Also simplifies the
checking #if code.)

Change-Id: I416321be4ef4478785be40571f81500fd3b6feb8
2016-02-26 14:34:29 +01:00
Noel Grandin
4fbf95deba new loplugin:unuseddefaultparams
Change-Id: I2c3e7d66be9e3883ea2801ff394948cc580d1e44
2016-02-25 11:42:35 +02:00
Andrea Gelmini
534b2a4b58 Fix typos
Change-Id: Ice72f8d9971e15dd6ef365e64cd567b8581a92d3
Reviewed-on: https://gerrit.libreoffice.org/21797
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-05 06:48:38 +00:00
Noel Grandin
d34d792230 new loplugin to find public methods that can be private
based on the unusedmethods plugin, which I should probably rename at
some point

Change-Id: If197423c59d4350ea1fdc69e99d24b631d9751b9
2016-02-01 14:53:19 +02:00
Noel Grandin
a7f6efc68b loplugin: unused return values
Change-Id: I9c61a46c57894bc63a57740206c0bcb4a16553af
Reviewed-on: https://gerrit.libreoffice.org/21571
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-18 12:50:09 +00:00
Noel Grandin
86bb6fdf9c update unusedmethods loplugin to update unused return values
Change-Id: I825d022d09282bc9b6cffd9178e40e4090d335da
2016-01-11 10:49:24 +02:00
Noel Grandin
e18b08363a loplugin:unusedmethods
Change-Id: Ifafdaf6da0225f244853a0042a6458643b570623
2015-12-21 10:20:31 +02:00
Noel Grandin
644487a115 loplugin:unusedmethods
Change-Id: I161cd52606c11b6008f5d8b1d8ee391692f91861
Reviewed-on: https://gerrit.libreoffice.org/19231
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-27 08:20:43 +00:00
Noel Grandin
3ce9af420a loplugin:unusedmethods
Change-Id: I73180266c0af98dbd8d29bd3b11850996b94def9
Reviewed-on: https://gerrit.libreoffice.org/19195
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-10-27 02:33:18 +00:00
Noel Grandin
7e776c0027 loplugin:unusedmethods
Change-Id: I150baadc442e57ee604563bc52965daa9d2e41af
2015-10-06 10:17:02 +02:00
Noel Grandin
58aea3f36c loplugin:unusedmethods
- improvements to the plugin to find more method calls
- improvements to python script to remove more false+
- fix the FORCE_COMPILE_ALL build flag to include code in
  the $WORKDIR

Change-Id: I4d6015dcb9b9d60c26f0bcee8abad807177a7836
Reviewed-on: https://gerrit.libreoffice.org/19064
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-01 10:43:24 +00:00
Noel Grandin
34180700b2 loplugin:removeunusedmethods, remove unused stuff
Change-Id: I35456b2a3ad2a84a1d045f09cdfb29e4c19b8350
2015-09-29 15:08:43 +02:00
Noel Grandin
403c13487c loplugin:unusedmethods
Change-Id: I6801618efb5a66d24156fa429e026acb6ca03aba
Reviewed-on: https://gerrit.libreoffice.org/17506
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-05 09:39:22 +00:00
Noel Grandin
38023af6c1 loplugin:unusedmethods
Change-Id: If5090c330e12d6e537766bf4a9be0a2360381a7a
Reviewed-on: https://gerrit.libreoffice.org/17312
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-24 10:36:20 +00:00
Noel Grandin
96d44c9b07 loplugin:unusedmethods sc
Change-Id: I7bdb1889a942d63370731764a58f4ab524dedd8a
Reviewed-on: https://gerrit.libreoffice.org/17287
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-22 13:02:57 +00:00
Noel Grandin
f3872352b3 fix my previous commit
Change-Id: I287d99a46eda90718a3c4ec2c92f7b063babeb24
2015-07-21 14:43:01 +02:00
Noel Grandin
07645b443a workaround clang-3.5 issue in unusedmethods loplugin
Change-Id: Ie67518536932e24e9cff7a8b75b42e90e9f67673
2015-07-21 14:39:35 +02:00
Noel Grandin
e103bf6cfd loplugin:unusedmethods dbaccess
Change-Id: Ifa16acc6d90ebd4f56c5662959010f6228228cb5
Reviewed-on: https://gerrit.libreoffice.org/17209
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-20 11:56:11 +00:00
Noel Grandin
9f4f237a38 loplugin:unusedmethods svl
Change-Id: If86cc43fda4d138cf7f678d81fa2b35f68f3c03b
Reviewed-on: https://gerrit.libreoffice.org/17162
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-20 06:33:44 +00:00
Noel Grandin
5a7bf1b32c loplugin:unusedmethods slideshow
Change-Id: I66b6cddb638a9fc1228d3ea9df5d112300a00eb3
Reviewed-on: https://gerrit.libreoffice.org/17128
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-17 06:49:23 +00:00
Noel Grandin
4ca2cf1b7e loplugin:unusedmethods sfx2
Change-Id: I98c455d89f76fbcacf74929a4e8775b4da697f62
Reviewed-on: https://gerrit.libreoffice.org/17069
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-16 05:47:52 +00:00
Noel Grandin
06ea347b93 loplugin:unusedmethods svtools
Change-Id: I04ad31055c04a247faddf4311943ca769051473c
Reviewed-on: https://gerrit.libreoffice.org/17032
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-14 10:21:55 +00:00
Noel Grandin
a04354ecb3 improve the unusedmethods plugin
to find stuff called from 2 levels+ inside template methods

Change-Id: I4ba308a992e64a091e5364b8aa89e44d6772dcb0
2015-07-14 09:43:57 +02:00
Noel Grandin
a6fed7a19b loplugin:unusedmethods vcl
Change-Id: I53c66b7898f4e0a66e6172d22c6f782dadaf6589
Reviewed-on: https://gerrit.libreoffice.org/16975
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-13 09:56:16 +00:00
Noel Grandin
449d272daf loplugin:unusedmethods vcl
Change-Id: I98b88ca3369a2c888fd63796e39d42376d513002
2015-07-08 09:51:27 +02:00
Noel Grandin
e546ed01e6 loplugin:unusedmethods package
Change-Id: I19d6bbb9288d72b99d1023b4983b1c3fff7570e8
Reviewed-on: https://gerrit.libreoffice.org/16811
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-07 11:01:11 +00:00
Noel Grandin
9d7727737b loplugin:unusedmethods ucb
Change-Id: Idc0ca78da8ebbdfe8489eee92a1167eb1bd9722f
Reviewed-on: https://gerrit.libreoffice.org/16794
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-07 06:52:52 +00:00
Noel Grandin
52099a7ad3 new loplugin: unusedmethods
Change-Id: I72574e354aadf357d6d8181a514efb4783e79e28
2015-07-06 09:20:08 +02:00