Age | Commit message (Collapse) | Author |
|
...for better precision
Change-Id: I5f273b7c66ba931647805c415622b5ac767ff987
|
|
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>
|
|
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>
|
|
<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>
|
|
...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>
|
|
...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
|
|
...even if they implement PPCallbacks, so filtering them out in
HandleTranslationUnit was ineffective.
Change-Id: I9df8103a50739f3176e6d63accfd0334da7faa9a
Reviewed-on: https://gerrit.libreoffice.org/43575
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
|
|
This works at least with a recent Clang trunk (towards Clang 6.0).
In order for the plugin.dll to find the LLVM/Clang symbols, it needs to be
loaded into clang.exe not clang-cl.exe, so set CC/CXX to 'clang.exe
--driver-mode=cl ...'.
Buidling the plugin requires some linker flags that must go at the very end of
the COMPILER_PLUGINS_CXX command line, after a /link switch, so introduce
another COMPILER_PLUGINS_CXX_LINKFLAGS variable for that. Also, clang.lib is
not installed as part of LLVM's 'cmake --build ... --target install' step, so
is not available under CLANGDIR and needs to be taken from the build tree
instead, so introduce another CLANGLIBDIR variable for that. autogen.input
settings that work for me on Windows 8.1 with Microsoft Visual Studio 14.0 are:
> CLANGDIR=C:/llvm/inst
> CLANGLIBDIR=C:/llvm/build/lib
> COMPILER_PLUGINS_CXX=C:/PROGRA~2/MICROS~3.0/VC/bin/amd64/cl.exe /IC:\PROGRA~2\MICROS~3.0\VC\INCLUDE /IC:\PROGRA~2\MICROS~3.0\VC\ATLMFC\INCLUDE /IC:\PROGRA~2\WI3CF2~1\10\include\100102~1.0\ucrt /IC:\PROGRA~2\WI3CF2~1\NETFXSDK\46D346~1.1\include\um /IC:\PROGRA~2\WI3CF2~1\8.1\include\shared /IC:\PROGRA~2\WI3CF2~1\8.1\include\um /IC:\PROGRA~2\WI3CF2~1\8.1\include\winrt
> COMPILER_PLUGINS_CXX_LINKFLAGS=/LIBPATH:C:/PROGRA~2/MICROS~3.0/VC/LIB/amd64 /LIBPATH:C:/PROGRA~2/MICROS~3.0/VC/ATLMFC/LIB/amd64 /LIBPATH:C:/PROGRA~2/WI3CF2~1/10/lib/100102~1.0/ucrt/x64 /LIBPATH:C:/PROGRA~2/WI3CF2~1/NETFXSDK/46D346~1.1/lib/um/x64 /LIBPATH:C:/PROGRA~2/WI3CF2~1/8.1/lib/winv6.3/um/x64
(The last two are "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/
amd64/cl.exe" and translations of %INCLUDE% and %LIB% as set in the "VS2015 x64
Native Tools Command Prompt" shell.
AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h, ...) in configure.ac wouldn't
like CXX to start with INCLUDE=... LIB=... environment variable settings, so it
wouldn't work to instead pass %INCLUDE% and %LIB% to cl.exe that way. See
<https://wiki.documentfoundation.org/Development/clang-cl> for general
information about building with clang-cl on Windows.)
There's still some room for improvement marked "TODO". (And some of the unused*
plugins, which are not run by default anyway, use Unix-style functionality, so
have been disabled for now.)
Change-Id: I6c28bdeb801af39ce2bae03111f455e2338d66c9
Reviewed-on: https://gerrit.libreoffice.org/42931
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
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>
|
|
tell the plugin code when we are unit-testing it, so we can suppress all
the warnings except for the plugin we are currently testing
Change-Id: I240c8e37eba90c219e53c29531a3a43bc841a1c8
|
|
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca
Reviewed-on: https://gerrit.libreoffice.org/36896
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
|
|
...in a somewhat hacked-up way for now (see the TODO comment)
Change-Id: Ida89fb8257b876cfca05b3048ce15996091c5703
|
|
Change-Id: Ibfb52800cdde99298431dab9da1cb8109658c425
|
|
Change-Id: I94c9676e52a3c60ad70567396a8484e844176c6e
|
|
-Werror is generally suppressed in Bison-generated C/C++ code (as in all other
generated code) to silence warnings from the Bison skeleton code. And the Clang
plugins suppress warnings in generated WORKDIR code based on the presumed source
location (i.e., taking #line directives into account). So introduce a new
PLUGIN_WARNINGS_AS_ERRORS mode where warnings from Clang plugins are reported as
errors even if -Werror is suppressed. That way, any warnings in the Bison
skeleton code still do not lead to compilation errors, while (at least plugin-
emitted) warnings in the genuine source code do.
Unfortunately this cannot also be enabled for Flex source code, as at least
Flex 2.5.39 generates poor code that does not properly prefix all skeleton code
with appropriate #line directives, so that some skeleton code would be mistaken
for genunie source code, and compilation would fail due to errors.
Also, %glr-parser Bison input appears to generate no #line directives at all (at
least with Bison 3.0.4), so all of connectivity/source/parse/sqlbison.y is
considered generated code and plugin warnings are still suppressed throughout.
Change-Id: Id746e81cbfa5f77628b0a34c7b82780948e7db08
|
|
...not the (Clang) compiler they are being built /with/. (Also simplifies the
checking #if code.)
Change-Id: I416321be4ef4478785be40571f81500fd3b6feb8
|
|
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
|
|
... input, which breaks because a) isInUnoIncludeFile() will not
recognize the paths (which is actually fixable if it used
getPresumedLoc() to get the path), and b) the isMacroBodyExpansion()
check in salbool.cxx (which doesn't look fixable).
So instead of printing lots of spurious warnings just abort.
Change-Id: I77fd77b4986d2b099453309ecdf31be9cf93ceec
Reviewed-on: https://gerrit.libreoffice.org/19693
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I81b8bed175527bab02ffdd2fa17fa6a66c243d95
|
|
Change-Id: I0b7be1616a3e4206982f9f925de141ed9d53b96e
|
|
Change-Id: Ibfed0b64bd60804fa377b5e25e5f197a7772d605
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: Ife39abda6b5274ae196dcbf591d02fa3f36f6072
|
|
...at least on trunk r202077.
Change-Id: Ieb59cc7ac70e2a57ac13eefdfcbb6bfa42e25218
|
|
...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: I8262091c52522c54f84c0fac5fd180871d4a3a9f
|
|
...at least in trunk 200400 towards Clang 3.5.
Change-Id: Ibe956a7f28c16510506bd354582b3fe5a72582e5
|
|
...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
|
|
... 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>
|
|
Change-Id: Id1e74f18c90e69d1a781c8f02e30dc3c005ed4fd
|
|
Change-Id: I97519c2fb08efa2c694c9fb91a4cc402a6347c2c
|
|
...with recent Clang trunk towards 3.4
Change-Id: Ie0991c7bd560c30551aeaada426382a889b46391
|
|
Change-Id: I6af5236358a51a51514d646c809147db56b2464b
|
|
If the class is based on PPCallbacks too, Clang internals will delete
the instance.
Change-Id: I6dd83d800e6cca17eb0b5de23c8994f11c087fd5
|
|
It's possible to get the latter from the former, and the former
is useful for other things too (access to the preprocessor, for example).
Change-Id: I708d709129fd3a35bf7c63da4de09c2e696b382d
|
|
Change-Id: I246dcf1d2c099c510435d21f0dd47e3c098456f2
|
|
Change-Id: I4e3e8f5ca5e5b5b59b1bd067281f90940dd893b1
|
|
Make sure / is appended, otherwise /foo might match /foobar/file .
Change-Id: I36469916b72b407c8f0c9c255099ee671039cf17
|
|
Change-Id: I0fa791733407199db5be2cc9606ac9be1da64188
|
|
Change-Id: I2f98622f152ae0c7ac8d1113d6380f686ac7234c
|
|
Change-Id: I2966fdb5bd98b1ddf718079584acf90a3e3a3700
|
|
It's mostly there already anyway, no need to duplicate it.
Change-Id: I5b066f90725a064fb0746e1411900e835e3f66c3
|
|
Now each one registers in its .cxx file.
Change-Id: I811c0d4400c2bdccc1c287269378d7e8ad8743ce
|
|
Change-Id: Ifa1af34121bda9ca3250d09a3b8a46ea226795ed
|