summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang/unreffun.cxx
Commit message (Collapse)AuthorAgeFilesLines
* make (some) clang plugins share the same RecursiveASTVisitorLuboš Luňák2019-03-121-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each plugin currently uses its own recursive AST run, which adds up. This patch adds another shared plugin which internally contains all (suitable) plugins and dispatches to them from the same one recursive run. This patch converts ~25 plugins and for starmath's accessibility.cxx reduces clang build time from 5.43s to 5.14s (and it's 4.39s without any plugins). As there are almost 50 more plugins to go, this can theoretically result in 4.56s final time, although probably not all plugins can be that easily converted, if at all. This mostly requires very little change in many plugins (see e.g. BadStatics), some even work without any functionality change (e.g. CharRightShift). Traverse* calls require some changes but are often not that difficult. WalkUp* probably can't be supported, although some plugins can(?) possibly be adjusted to not rely on them. And of course some plugins can be left as they are, using their own recursive run. See description at the top of generator.cxx for description of how to convert a plugin. The sharedvisitor.cxx source is generated based on scanning relevant plugin sources using a clang-based scanner/generator. The generated source is intentionally included instead of getting always generated, as the generating currently takes some time, so it should get updated in git whenever a change in a plugin triggers a source change in it. Change-Id: Ia0d2e3a5a464659503dbb4ed6c20b6cc89b4de01 Reviewed-on: https://gerrit.libreoffice.org/68026 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
* filter out some of the AST in the pluginsNoel Grandin2018-08-141-2/+2
| | | | | | | | | | 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>
* Prevent loplugin:unreffun on explicitly defaulted special membersStephan Bergmann2018-07-281-0/+21
| | | | | | | | | | | | | | | | ...as started to appear (with sufficiently recent Clang versions only, it appears) after c5fcb476ac8eab18152a7f6d0487daa56231fcf8 "toolkit: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)": > [CXX] toolkit/source/controls/spinningprogress.cxx > toolkit/source/controls/spinningprogress.cxx:38:5: error: Unreferenced externally invisible function definition [loplugin:unreffun] > SpinningProgressControlModel(SpinningProgressControlModel &&) = default; > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Id78cd2d801e9760dde9e0a594e2b62ec20840204 Reviewed-on: https://gerrit.libreoffice.org/58180 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Improve loplugin:unreffunStephan Bergmann2018-06-011-0/+18
| | | | | | | | | | | | | | | ...to avoid a false positive in --enable-qt5 > [build CXX] vcl/qt5/Qt5Widget.cxx > /home/sbergman/lo/core/vcl/qt5/Qt5Widget.cxx:466:21: error: Unreferenced function declaration [loplugin:unreffun] > friend QWidget* createQt5Widget(Qt5Frame& rFrame, QWidget* parent, Qt::WindowFlags f); > ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 error generated. Change-Id: I01e47bc5f5147916737d62fe18ce5312a0221a3f Reviewed-on: https://gerrit.libreoffice.org/55189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Clean away temporarily added using declarationsStephan Bergmann2017-11-071-1/+1
| | | | Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
* Adapt loplugin:unreffun to clang-cl (uses of DllMain and wmain)Stephan Bergmann2017-09-291-1/+1
| | | | | | | Change-Id: I6ef1c55ce0fb8fa350559612780a1091d8627d3e Reviewed-on: https://gerrit.libreoffice.org/42915 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
* Fix typosAndrea Gelmini2017-03-251-1/+1
| | | | | | | Change-Id: If92860597a44ee79b513d255ce3f21112485a97e Reviewed-on: https://gerrit.libreoffice.org/35617 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
* Plugin::isInUnoIncludeFile should not cover WORKDIRStephan Bergmann2016-10-191-0/+8
| | | | | | | ...that got in, for no apparent reason, when various, slightly different implementations of isInUnoIncludeFile got consolidated into one. Change-Id: I64a9eb62703d57a0b7b57720ec9f251ffa780691
* loplugins: extract some common functionalityNoel Grandin2016-10-181-3/+1
| | | | Change-Id: If470e1d9b481c9eda0829aa985152baf8fb46d7a
* Remove support for Clang < 3.4Stephan Bergmann2016-06-291-10/+3
| | | | Change-Id: I81e97c5f720535b33dd3ce72d01151765e4e93a0
* Remove support for Clang < 3.3Stephan Bergmann2016-06-291-10/+4
| | | | Change-Id: I185852a738bac10dc6d331afccfcbc7ae1225cb1
* These version checks are about the Clang the plugins are built /against/Stephan Bergmann2016-02-261-2/+2
| | | | | | | ...not the (Clang) compiler they are being built /with/. (Also simplifies the checking #if code.) Change-Id: I416321be4ef4478785be40571f81500fd3b6feb8
* Fix typosAndrea Gelmini2016-01-101-1/+1
| | | | | | | Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86 Reviewed-on: https://gerrit.libreoffice.org/21209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
* loplugin:unreffun: workaround for visibility-adding redeclsStephan Bergmann2015-06-091-0/+11
| | | | Change-Id: Ic18b44942f4fe02083c0e8167e8c8d4205e66abf
* loplugin:unreffun: also warn about redundant redeclarationsStephan Bergmann2014-06-271-0/+33
| | | | Change-Id: I9a812220b58cf6da00d854e65794f7c673ab239d
* loplugin:unreffun: also warn about unused function templatesStephan Bergmann2014-06-271-9/+14
| | | | Change-Id: I4a6280f47ca3c4a77b4e42fe05d79ded7fc30ef1
* compilerplugins: move isUnoIncludeFile to base classNoel Grandin2014-06-241-22/+0
| | | | | | to reduce copy-pasted code Change-Id: I7728d85dea7d0161998c326d6648ca681a8250d0
* Flag unreferrenced functions only declared in the main file, not an includeStephan Bergmann2014-04-151-0/+148
...which appears to be a good heuristic to identify functions that are either unused or should better be declared just once in an include file. (It also filters out SAL_DLLPUBLIC extern "C" function definitions, which are most likely meant to be referenced dynamically via dlsym.) Change-Id: I7fb78cb836b971791704851535dcfbda2b2f5bc0