Age | Commit message (Collapse) | Author |
|
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>
|
|
the old EvaluateAsInt method has been dropped as from current clang
Change-Id: Ie30d1547ad8de777badff4b380d2fc9fb261e8fe
Reviewed-on: https://gerrit.libreoffice.org/64107
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...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>
|
|
Change-Id: Ib50583289afd6212d5d5aedd3d6b7ede75902052
Reviewed-on: https://gerrit.libreoffice.org/60277
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
There are some problems here, this should fix one of them: the
getFilename function returns "<stdin>" for spelling locations, because
the input to clang is sort of preprocessed via -frewrite-includes if
icecream is used and the file is built on a remote host (whereas it's
apparently not preprocessed if the file is compiled locally by icecream).
Using getPresumedLoc() uses the #line directives in the preprocessed
input, which avoids the problem but is more expensive, so try to use it
only when necessary.
The getFileEntry(getMainFileID())->getName() pattern will also result
in "<stdin>", but fortunately icecream passes -main-file-name,
which oddly enough isn't used by the SourceManager's spelling locations,
but is available separately via CodeGenOptions.
This builds everything successfully with clang version 6.0.0:
ICECC_PREFERRED_HOST=myremote make check gb_SUPPRESS_TESTS=t
Change-Id: Ic121511683e5302d7b9d85186c8b9c4a5443fa1b
Reviewed-on: https://gerrit.libreoffice.org/54993
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
|
|
This reverts commit b39e627be45f847554f11fdac040b6f4da4054ba. The assumed (see
comment at <https://gerrit.libreoffice.org/#/c/46769/4/compilerplugins/clang/
plugin.cxx@633>) performance bottleneck of isSamePathname -> getAbsolutePath
does show up in Flamegraph inspections of LO builds. But changing (non-member
function) isSamePathname to only call getAbsolutePath if (PluginHandlder member
function) isLOOLMode is true would need some code reorg, and Online development
doesn't seem to make too much actual use of the plugin, so conclusion on IRC was
to revert.
Change-Id: I0f04fdcc87087dac516630ed5e48361f5ea332ca
Reviewed-on: https://gerrit.libreoffice.org/51774
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
- use AdjustFoo variants of methods on Rect/Size/Point
- ignore double assignments
- improve error messages
- handle expressions that include macros by using getExpansionLoc
- replace ++X() with X() + 1
Change-Id: Ida6b06b2a92e9226168aff6b1b8031f5867687b4
|
|
after
commit 94ab8e4360a2a7a932656e99f718244321d0f923
Date: Fri Feb 9 15:28:41 2018 +0200
improve loplugin rewriter double source modification detection
Change-Id: Ibf0a64fe4cc3dd6bf5ae16672b3d748a842196e4
|
|
because my new rewriter easily generates overlapping rewriting.
Move the code from flatten and salcall up into the pluginhandler, and
drop the simpler detection logic.
Change-Id: I3da51ac510954a5d4276cee0924cc5dc1fc9a734
Reviewed-on: https://gerrit.libreoffice.org/49493
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I8e45936ef5675d531be71496e8894b90eaf2f6e2
Reviewed-on: https://gerrit.libreoffice.org/46769
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
|
|
...to enable debug-only code in the plugins. Some situations in the plugin code
should never happen, yet must not by default report errors or trigger
assertions, as some newly written LO code could trigger them nevertheless (in
which case the plugin code will likely need to be adapted, to cater for these
presumed-impossible situations).
Such code can now be included in the plugins behind an if(isDebugMode()) guard,
and can explicitly be enabled with --enable-compiler-plugins=debug.
I deliberately made this a runtime rather than a compile time option (using
some #ifdef guards in the plugin code, say), as it IMO keeps the code more
readable, and also allows overridding COMPILER_PLUGINS_DEBUG=... on the make
command line.
Change-Id: Iea4f0c2783ad968a0de097fa710b3be1a248de73
Reviewed-on: https://gerrit.libreoffice.org/46096
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
...by structurally comparing complex constexpr exprs that use template functions
that happen to not have been instantiated, so Expr::EvaluateAsRValue et al would
fail. (Which happened with SFX_PRINTER_ALL in SfxViewShell::SetPrinter,
include/sfx2/viewsh.hxx.)
Now all of the LO code base should compile without causing
checkIdenticalDefaultArguments to return Maybe.
Change-Id: I2b103418c2c68f6d2242535c9cca3222a2508778
Reviewed-on: https://gerrit.libreoffice.org/44773
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
...introduced with cab6e6836973a9ddfc5ed9df757e07138328c1c3 "Make
checkIdenticalDefaultArguments more precise", causing older Clang to hang when
compiling specific LO source files.
Change-Id: I99cfcad2f0cd9adccd5aa84d21502f586762217f
|
|
...when creating objects involves copy/move constructors
Change-Id: I0c7ccb85b7dcb584502a48817d7d2abfde25aaf2
Reviewed-on: https://gerrit.libreoffice.org/44733
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
...when creating objects of the same derived type
Change-Id: I109b614473a2fb5b08dddd07a4fbe757086141a1
Reviewed-on: https://gerrit.libreoffice.org/44716
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
...instead of blacklisting such cases. Reuses the
checkIdenticalDefaultArguments code that was originally in
loplugin:overrideparam (and appears to work reasonably well for the default
arguments that actually happen in practice).
Change-Id: I9cf2db17101beb135b2039a9b7ed335bd2af2c08
Reviewed-on: https://gerrit.libreoffice.org/44594
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
...which, according to callgrind, reduces instruction fetch count spent on
compiling sw/source/core/layout/paintfrm.cxx (randomly selected because it is
rather large) by 5% from 41,992,064,226 to 39,861,989,855 (function main() in
clang-6.0).
This is best done by forwarding ignoreLocation calls from Plugin to the
PluginHandler signleton, but due to the tight mutual coupling between plugin.hxx
and pluginhandler.hxx that unfortunately required some reorganization (and two
outstanding TODO clean-ups of temporarily introduced using declarations in
plugin.hxx).
Change-Id: Ia4270517d194def7db7ed80cb6894e9c473e9499
|
|
This can also call loplugin::isSamePathname with two paths that both contain
backslashes, so finally make it (and hasPathnamePrefix) symmetric in which
arguments my contain backslashes.
Change-Id: I0465988d9d41e21c5660cbdbd1558543860ae1ad
|
|
Change-Id: I2858c6cb74b96ffe6a799dc2ab02cbbe1c56abc7
|
|
lets just use the built in parents stuff
Change-Id: I7bb705acfcd6c8c18168676b0cdb13c26ba5b95a
|
|
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
|
|
...which is there for MSVC compatibility, but can cause getBody() to return null
even when doesThisDeclarationHaveABody() is true.
And in staticmethods.cxx we need to check doesThisDeclarationHaveABody() instead
of hasBody(): For some class template member functions that are only defined
outside their class definition, as is the case for
OSequenceIterator::hasMoreElements in include/comphelper/sequence.hxx, hasBody()
may be true for the original member function declaration inside the class (as
there is some later definition that does have a body), but
isLateTemplateParsed() is not (it is only true for the later definition). So
just skip any such declarations that are not definitions (which is sane anyway,
as otherwise such functions could pointlessly be inspected multiple times).
Change-Id: I724f652a8f060a931f8b5fc3e4feb5f307a922bf
Reviewed-on: https://gerrit.libreoffice.org/42914
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I8a9cf2c4b81b95bf654f7e90306328d72e3d3408
Reviewed-on: https://gerrit.libreoffice.org/40280
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
to match our more normal conventions.
Also drop the 'using std' and some other cruft
Change-Id: I02ef81c5427188bc03a20b157a57a900a9d7bf0d
|
|
When the field in question is read from inside a constructor
initializer.
In the process, create some needed infrastructure in the plugin classes.
Change-Id: I2f440efa6912801a236727c9fe3180404616958c
Reviewed-on: https://gerrit.libreoffice.org/38960
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...instead of merely getting a warning from PluginHandler::HandleTranslationUnit
after the fact. Such automatic rewriting should probably never be what one
wants.
Change-Id: I3829007224a197ebb4d55d24323b375cbbdf815c
|
|
Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5
|
|
Change-Id: I3bec4570149af50fad5eef33bafb9842ab598798
Reviewed-on: https://gerrit.libreoffice.org/34967
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
|
|
* Add GPG implementation of css::xml::crypto UNO interfaces (part of that is only stub atm)
* List gpg keys along with other certificates
* Viewing gpg certificates: Not all properties are implemented yet
Change-Id: I7f60b26efe949a94bf8fe1b8d4d428002c2995b1
Reviewed-on: https://gerrit.libreoffice.org/33843
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Siegmund Gorr <siegmund.gorr@cib.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
|
|
Change-Id: Iba3fae8bbecaf5782228be1fb99f196864d79e6b
|
|
...that got in, for no apparent reason, when various, slightly different
implementations of isInUnoIncludeFile got consolidated into one.
Change-Id: I64a9eb62703d57a0b7b57720ec9f251ffa780691
|
|
Change-Id: If470e1d9b481c9eda0829aa985152baf8fb46d7a
|
|
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>
|
|
1977b57bc9aaea71252358fa502110c348153c70 "vcl: loplugin:override" had only hit
in out-of-tree builds, where the #include in the generated
workdir/CustomTarget/vcl/unx/kde4/tst_exclude_socket_notifiers.moc is an
absolute path. For in-tree builds, the generated #include line is
"../../../../../vcl/unx/kde4/tst_exclude_socket_notifiers.hxx", so the returned
getFileName() is .../workdir/../../../../../vcl/..., so was erroneously
considered to be under WORKDIR.
Change-Id: I9abef04b90ecb4921087a53ff196b833940085e5
|
|
Change-Id: I81e97c5f720535b33dd3ce72d01151765e4e93a0
|
|
Change-Id: Ia10a76a98a63c6ea3b516d9146281f672b213ab3
|
|
Change-Id: Ie527703e9687a42bfc39439952b9d1a83d7cad24
|
|
Change-Id: I0f83939babacf92485420ee63f290a297d7cb717
Reviewed-on: https://gerrit.libreoffice.org/22498
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
|
|
Change-Id: I825d022d09282bc9b6cffd9178e40e4090d335da
|
|
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
|
|
Change-Id: Iad3417822b2ab3afb75da09c311a0bf07af5e2e4
|
|
Change-Id: I3ea2a0a6d8f54afcc1959b54c36f90bb849995b4
|
|
to reduce copy-pasted code
Change-Id: I7728d85dea7d0161998c326d6648ca681a8250d0
|
|
Change-Id: Ibfed0b64bd60804fa377b5e25e5f197a7772d605
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I8883649da31eabbc5a0f9780fb953ad58f154e1e
|
|
...that easily works around the problem that in a rewriter rewriting types of
VarDecls like
T x, y;
it would try to replace T twice. Also, keep the list of removals globally with
the (global) rewriter.
Change-Id: I55b8d11986c2a29e09ff40132fd114a0cc48dc90
|
|
Change-Id: I03815f33117a2927b1882d221f159a5de8d3ba78
|
|
...which can act as either a rewriter or a non-rewriter that emits warnings.
Also added COMPILER_PLUGIN_WARNINGS_ONLY=X to demote warnings from plugin X from
errors to warnings, even under --enable-werror.
Change-Id: I05361936240a890515c6bba2459565417c1746b7
|
|
...which is typically external or generated code and causes warnings that
we cannot easily fix.
Change-Id: If86ecd96c069ec23c6b3d7f5c32bf962397393e5
|
|
... it is an abbreviation of "Solar Version".
Since nobody can remember that:
remove OUTDIR OUTDIR_FOR_BUILD SOLARVER SOLARVERSION solarpath
and any mention thereof.
Change-Id: Idb3031c4f25a76ac05b22ec67e3ca3e1e8e512ad
Reviewed-on: https://gerrit.libreoffice.org/6515
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
|