summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/unusedmethods.cxx
AgeCommit message (Collapse)Author
2022-06-14better solution for ignoreLocation for tree-wide pluginsNoel Grandin
Change-Id: I7336003e038781d4ef50380fa49f66b5ff19379f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-17Bump compiler plugins Clang baseline to 12.0.1Stephan Bergmann
...as discussed in the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2020-November/086234.html> "Bump --enable-compiler-plugins Clang baseline?" (and now picked up again at <https://lists.freedesktop.org/archives/libreoffice/2022-February/088459.html> "Re: Bump --enable-compiler-plugins Clang baseline?"), and clean up compilerplugins/clang/ accordingly Change-Id: I5e81c6fdcc363aeefd6227606225b526fdf7ac16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129989 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-18make FORCE_COMPILE_ALL more flexible than all or nothingLuboš Luňák
Rename it to FORCE_COMPILE and it takes the --enable-symbols specification of what to include, for example FORCE_COMPILE="all -sw/ -Library_sc". Change-Id: I92afd8e0abc75d3566285c197d6640c26c03db36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122248 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-05-18loplugin:unusedmethodsNoel Grandin
Change-Id: I8191f4a9eb25b12242354813303fb7d30489d2c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115752 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-06loplugin:unusedmethodsNoel Grandin
plugin code needed some updating because it was interacting badly with PCH code in pluginhandler::ignoreLocation Change-Id: I228f94a4e285747bd1d5b8536010f8617118cafa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115212 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-30loplugin:unusedmethodsNoel Grandin
and tweak the plugin a little to speed it up Change-Id: Ia59456232602184c4f1b5d1d75ad94a9a2e2d0be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-20loplugin:unusedmethodsNoel Grandin
Remove a filtering step in the python script that was hiding some results Change-Id: Id94268f150902405ab197c077f18aaedf98845fc Reviewed-on: https://gerrit.libreoffice.org/83256 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08better name for a function in compilerpluginsLuboš Luňák
The function is not just about a spelling location. Change-Id: I96e9e9ef7e27a9763397b4b86473c1c30d0e3eeb Reviewed-on: https://gerrit.libreoffice.org/80381 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-07do not use compiler.getSourceManager().getFilename()Luboš Luňák
This is a continuation of ff002524c12471668e63837a804b6006f9136a34. When compiling with icecream, its -frewrite-includes merges all #include's into one .cxx file and marks them with with line markers. But SourceManager::getFilename() doesn't take those into account and so it reports all of those as <stdin>. So use getFileNameOfSpellingLoc(), which explicitly handles this case. And we should probably never ever use SourceManager::getFilename(). Change-Id: Ia194c2e041578e1e199aee2df2f885922ef7e31a Reviewed-on: https://gerrit.libreoffice.org/80326 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-03Fix building compilerplugins with Clang trunk towards Clang 9Stephan Bergmann
...after <https://github.com/llvm/llvm-project/commit/ f19a8b05171a67a290e7d3bd6eba0c95c7b3259c> "Replace ad-hoc tracking of pattern for an instantiated class-scope" removed ASTContext::getClassScopeSpecializationPattern. None of the affected plugins are enabled by default (nor checked by solenv/CompilerTest_compilerplugins_clang.mk), so just make sure they still compile, leaving any potentially necessary adaptions to another commit. Change-Id: I7102851409e78eff284b50337f7ad0f721e1e548 Reviewed-on: https://gerrit.libreoffice.org/71702 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-23Bump compiler plugins Clang baseline to 5.0.2Stephan Bergmann
...as discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-November/081435.html> "minutes of ESC call ..." Change-Id: Ia053da171d59747984546f38e19da808825b4f79 Reviewed-on: https://gerrit.libreoffice.org/63832 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-21new loplugin:methodcyclesNoel Grandin
look for closed cycles of methods i.e. unused code that would not otherwise be found by the unusedmethods loplugin Change-Id: I3fb052132d97aabca573bb8e9fc424201b1e2042 Reviewed-on: https://gerrit.libreoffice.org/60875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11fix loplugin:unusedmethodsNoel Grandin
revert the part of commit 9f4d23c15115d64febd6bf01f870cc157badd350 Date: Mon Aug 13 17:24:26 2018 +0200 filter out some of the AST in the plugins that applied to this plugin. Turns out it really needs to see __all__ the code in order to produce good results. Change-Id: If580a701049d2570f2a833327b2189641090079b Reviewed-on: https://gerrit.libreoffice.org/60279 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14filter out some of the AST in the pluginsNoel Grandin
by checking if the current namespace decl is in our code, so we have to scan less stuff, which results in a 10% perf improvement for me Change-Id: Idf0e30d57b6d0dcd13daa9ed679c28b9d233d387 Reviewed-on: https://gerrit.libreoffice.org/58942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-10put the loplugin output files in the workdirNoel Grandin
so that the next time I accidentally leave one turned on, and commit it, the buildbots will clean up naturally the next time they run 'make clean' Change-Id: Ia09dea9c272c322c7e2773c5458cb54aceb50dd1
2017-12-19Bump --enable-compiler-plugins to Clang 3.8.0Stephan Bergmann
<https://lists.freedesktop.org/archives/libreoffice/2017-December/079107.html> "Clang baseline bump" Change-Id: I18fca8794ea34118fc6308458064d0c28cf5caf7 Reviewed-on: https://gerrit.libreoffice.org/46557 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-30some global loplugin improvementsNoel Grandin
for some reason we're hitting more template AST nodes now? Anyhow, updated singlevalfields and unusedenumconstants to cope. For unusedfields, ignore field access inside Clone() methods, since it's like a constructor. Similarly for unusedmethods. Change-Id: Icb2f76fb2f06ae5df21f9d75312e42a2800befb9 Reviewed-on: https://gerrit.libreoffice.org/45470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-28Add back UnusedMethods::TraverseCXXDeductionGuideDecl, properly ifdef'edStephan Bergmann
...as is already done in 65d6c642590bd5f51c04228d941608322a85f1ac "loplugin:casttovoid". (This reverts 5eec6db4addd7cc665222e1a4d05c35b13719847 "fix loplugin unusedmethods".) Change-Id: Ibe6a7d9ce58aa70707538854ac64ad07022ea7b6 Reviewed-on: https://gerrit.libreoffice.org/45388 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-28fix loplugin unusedmethodsNoel Grandin
VisitCXXDeductionGuide is not part of our baseline clang Change-Id: I354a992456949975384d8ae1a81a07de9e886061
2017-11-28loplugin:unusedmethods ignore recursive callsNoel Grandin
Change-Id: I651a7bf0c705acc5580af8b7742d2d035ec64388
2017-11-10loplugin:unusedmethods new analysisNoel Grandin
look for classes containing protected methods where we can convert them all to private Change-Id: I4a448341943e0a613cde30501c4012da61dba713 Reviewed-on: https://gerrit.libreoffice.org/44588 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-10loplugin:unusedmethodsNoel Grandin
Change-Id: I543b0943f0bc918d59debc8ee051f88c29d18454 Reviewed-on: https://gerrit.libreoffice.org/44553 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-07Clean away temporarily added using declarationsStephan Bergmann
Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
2017-10-27rename loplugin::Plugin::parentStmtNoel Grandin
to getParentStmt and rename parentFunctionDecl to getParentFunctionDecl, so I don't keep using accidentally naming my variables the same as the functions. Change-Id: I66f9452458c8b439e5132191ac5219fb6d420708
2017-06-20reformat some loplugin codeNoel Grandin
to match our more normal conventions. Also drop the 'using std' and some other cruft Change-Id: I02ef81c5427188bc03a20b157a57a900a9d7bf0d
2016-11-22can-be-private analysis needs to ignore virtual methodsNoel Grandin
Change-Id: I1e2f28ed550ff9751912f70e3eec511ddc5b75cf
2016-11-16update couple of loplugins for move constructorsNoel Grandin
Change-Id: I82140569a3e09225065d721e4aeac5c5fe93bc45
2016-10-18-Werror=unused-functionStephan Bergmann
Change-Id: I9e0585460d908024f75a1134bc1cd20d12ea3b4e
2016-10-18loplugins: extract some common functionalityNoel Grandin
Change-Id: If470e1d9b481c9eda0829aa985152baf8fb46d7a
2016-10-18some cleanups to the unusedmethods lopluginNoel Grandin
- 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-09-27clang plugins: do "dotdot" normalisationNoel Grandin
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-22loplugin:unusedmethods unused returnsNoel Grandin
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-07-25loplugins: more consistent naming of output filesNoel Grandin
Change-Id: Ia26f697cb16078f235c94e4cff449a60c1bbd74e
2016-06-28Adapt to Clang 3.4 (in preparation of a buildbot on CentOS 7)Stephan Bergmann
Change-Id: Ie2859f03b31c57deb7fd0deba3285f782e33b239
2016-06-28loplugin: move parentFunctionDecl() into common codeNoel Grandin
Change-Id: Ia10a76a98a63c6ea3b516d9146281f672b213ab3
2016-06-24Adpat to <https://llvm.org/svn/llvm-project/cfe/trunk@273647>Stephan Bergmann
"Use more ArrayRefs" Change-Id: Ied0ab11dd9366b3f499100b2627f4919cca52c9c
2016-06-02I assume these special plugins were not intended to be enabled unconditionallyStephan Bergmann
...with fa135fd0e05fc4ba784b4349d65f2e5ed26c0f55 "remove unused SID constants and associated code" Change-Id: I51b2a9e3c8ce13401818bca0c40167a4364212f1
2016-06-01remove unused SID constants and associated codeNoel Grandin
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-05-18update unusedmethods plugin to ignore externC and copy constructorsNoel Grandin
Change-Id: Idf7a9403d313ba6a0e031c59601e20c880b6118b
2016-05-18update unusedmethods plugin to deal with constructorsNoel Grandin
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-02-26These version checks are about the Clang the plugins are built /against/Stephan Bergmann
...not the (Clang) compiler they are being built /with/. (Also simplifies the checking #if code.) Change-Id: I416321be4ef4478785be40571f81500fd3b6feb8
2016-02-25new loplugin:unuseddefaultparamsNoel Grandin
Change-Id: I2c3e7d66be9e3883ea2801ff394948cc580d1e44
2016-02-05Fix typosAndrea Gelmini
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-01new loplugin to find public methods that can be privateNoel Grandin
based on the unusedmethods plugin, which I should probably rename at some point Change-Id: If197423c59d4350ea1fdc69e99d24b631d9751b9
2016-01-18loplugin: unused return valuesNoel Grandin
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-11update unusedmethods loplugin to update unused return valuesNoel Grandin
Change-Id: I825d022d09282bc9b6cffd9178e40e4090d335da
2015-12-21loplugin:unusedmethodsNoel Grandin
Change-Id: Ifafdaf6da0225f244853a0042a6458643b570623
2015-10-27loplugin:unusedmethodsNoel Grandin
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-27loplugin:unusedmethodsNoel Grandin
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-06loplugin:unusedmethodsNoel Grandin
Change-Id: I150baadc442e57ee604563bc52965daa9d2e41af