summaryrefslogtreecommitdiffstats
path: root/compilerplugins
Commit message (Collapse)AuthorAgeFilesLines
...
* new loplugin:unoqueryNoel Grandin2019-03-252-0/+106
| | | | | | | | | | | | | look for places we are doing code like: Reference<XProperty>(model, css::uno::UNO_QUERY)->getAsProperty() which might result in a SIGSEGV is the query fails Change-Id: I5cbdbc9e64bd0bed588297c512bf60cbacb9442e Reviewed-on: https://gerrit.libreoffice.org/69044 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Resolves: tdf#122114 remove support for ~/.recently-used fileArkadiy Illarionov2019-03-243-11/+0
| | | | | | | Change-Id: Ie91f0bf21e6f5c3f7a7aa4ae3d1dff6cc8e15a86 Reviewed-on: https://gerrit.libreoffice.org/69597 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Consistently make generator invocation $(QUIET) tooStephan Bergmann2019-03-231-1/+1
| | | | | | | Change-Id: I5251f130aafdebdb4698ef4513b1dcf9f3bdf454 Reviewed-on: https://gerrit.libreoffice.org/69571 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Allow to pass additional options into generator's clang::toolingStephan Bergmann2019-03-222-7/+23
| | | | | | | | | | | | | | | In my macOS build, that clang::tooling::runToolOnCodeWithArgs invocation failed to find headers like cassert and assert.h, which works now with COMPILER_PLUGINS_TOOLING_ARGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -isystem /Users/stephan/Software/llvm/inst/include/c++/v1 added to my autogen.input (I build against my Clang trunk libc++ whose headers are at /Users/stephan/Software/llvm/inst/include/c++/v1). Change-Id: Idbffa39c9fd4a88743fd498b8f7b6c9c56d7630d Reviewed-on: https://gerrit.libreoffice.org/69538 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* It is building the generator exe that depends on $(CLANGOUTDIR)/sharedvisitorStephan Bergmann2019-03-181-3/+2
| | | | | | | | | | | | | | | | | ...or else -MF $(CLANGOUTDIR)/sharedvisitor/generator.d in the command line for building the generator exe could produce a failure because the dir does not exist yet. (The dependency of compilerplugins-build on $(CLANGOUTDIR)/sharedvisitor had been added with adb08e892b37ea9e155abbdee4e0c9951a1d163b "make (some) clang plugins share the same RecursiveASTVisitor" for reasons that are not clear to me.) Change-Id: I124b95be5e8ba36dc5d7502208c61ccf045516f5 Reviewed-on: https://gerrit.libreoffice.org/69307 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Fix typoAndrea Gelmini2019-03-171-2/+2
| | | | | | | Change-Id: I6f86a9f44e6d0044b66a6552fb9c1dbf21a1803c Reviewed-on: https://gerrit.libreoffice.org/69359 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
* pahole changes in variousNoel Grandin2019-03-162-94/+38
| | | | | | | | | | | | | | | | | I'm not seeing as much as I would expect here, mostly because pahole seems to be having trouble parsing quite a few of our structures, and consequently producing useless data than I then ignore. XDash 24bytes -> 20bytes vcl::font::FeatureDefinition 64bytes -> 56bytes SvXMLTokenMapEntry 16bytes -> 12bytes SvXMLItemMapEntry 16bytes -> 12bytes SwContentAtPos 40bytes -> 32bytes Change-Id: I74c8b93f74b8352f48ef552d7d4239aa7f4237d4 Reviewed-on: https://gerrit.libreoffice.org/69304 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* new pahole-all-classes script, and update a couple of sc/ structsNoel Grandin2019-03-152-0/+189
| | | | | | | | | | | | Create a new script to scan our codebase for holes in our structures. Implemented a couple of the things I found ScSortKeyState 12bytes -> 8bytes sc::MultiDataCellState 12bytes -> 8bytes Change-Id: I139dda36aedf02b7f19be121eb312e5552142b87
* loplugin:unusedmethodsNoel Grandin2019-03-142-122/+86
| | | | | | | Change-Id: Ief7cdb14e2c0fe4b0332cd90e063d649065bf3b6 Reviewed-on: https://gerrit.libreoffice.org/69171 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:unusedfieldsNoel Grandin2019-03-144-82/+64
| | | | | | | Change-Id: Id6792f0955a25533d33f6da6ed8c3e993f578c3f Reviewed-on: https://gerrit.libreoffice.org/69170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* warn if sharedvisitor generator cannot find code in a source fileLuboš Luňák2019-03-131-0/+11
| | | | | | | | | | | Just in case there's a typo or something, without this that source would not be compiled but shared visitor would not include that functionality either. Change-Id: I5d9fad129b83f24fed2613bc071cb33e149c1db3 Reviewed-on: https://gerrit.libreoffice.org/69093 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
* make (some) clang plugins share the same RecursiveASTVisitorLuboš Luňák2019-03-1236-81/+1860
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* change some clang plugins to FilteringPluginsLuboš Luňák2019-03-114-10/+8
| | | | | | | | | | As far as I can tell these do not need to scan everything, so the filtering (and faster) base plugin is sufficient. Change-Id: I0912a730bb5ec9670d1faa5c83f573902118cc95 Reviewed-on: https://gerrit.libreoffice.org/68872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* blockblock clang plugin does not do rewritingLuboš Luňák2019-03-111-2/+2
| | | | | | | Change-Id: Iee879980d8dbaa4cdbdf8f4f5859236367f30ccb Reviewed-on: https://gerrit.libreoffice.org/68871 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* avoid a possible crash in loplugin's ignoreLocation()Luboš Luňák2019-03-111-1/+4
| | | | | | | | | For the built-in(?) __int128_t there's apparently no valid presumed location. Change-Id: I1b2f1a827bc914d2f288dd1e02718bf45a50dd1e Reviewed-on: https://gerrit.libreoffice.org/68870 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* move isDerivedFrom() from a clang plugin to shared code, for reuseLuboš Luňák2019-03-113-32/+36
| | | | | | | Change-Id: I7b9b41a7081281214a387cdf02080866e9b9dfe7 Reviewed-on: https://gerrit.libreoffice.org/68873 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:constantparamNoel Grandin2019-03-113-494/+511
| | | | | | | Change-Id: Ibe167c208844b4cdd10df80ae804b1e5bfa6aa13 Reviewed-on: https://gerrit.libreoffice.org/68998 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:singlevalfieldsNoel Grandin2019-03-092-673/+370
| | | | | | | Change-Id: I7f9ff0fc58adf51eae7fef5ce925b91b8d1f4922 Reviewed-on: https://gerrit.libreoffice.org/68940 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:unusedfieldsNoel Grandin2019-03-094-810/+414
| | | | | | | Change-Id: Ifb2c9a2d1d7dcc0ed3e8458c1a13933ccababd4c Reviewed-on: https://gerrit.libreoffice.org/68939 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:unusedmethodsNoel Grandin2019-03-092-154/+178
| | | | | | | Change-Id: I242f56f2bc5dc8fce6db1ba8f1f8269da4fec0fa Reviewed-on: https://gerrit.libreoffice.org/68938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:unnecessaryvirtualNoel Grandin2019-03-092-38/+46
| | | | | | | Change-Id: I1fcde14b66ce80157cbebe7f3ec8c5ced1e13143 Reviewed-on: https://gerrit.libreoffice.org/68937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* remove debugging leftoverNoel Grandin2019-03-081-1/+0
| | | | Change-Id: Ia0d2a883a3bd3aca96fe4c8f72f44c694837e568
* new loplugin constvarsNoel Grandin2019-03-082-0/+558
| | | | | | | | | | | | | | | | | | detect static variables that can be made const. Thanks to mike kaganski for suggesting this. Here I introduce a new plugin feature - using markers in nearby comments to disable the plugin for specific vars. Some of this stuff was old debugging code. I removed the stuff that was older than 5 years. Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c Reviewed-on: https://gerrit.libreoffice.org/68807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Fix typoAndrea Gelmini2019-03-071-1/+1
| | | | | | | Change-Id: Icafc637004e219b523c862cb5fbad55a2bd4eaaf Reviewed-on: https://gerrit.libreoffice.org/68835 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
* loplugin:staticconstfield improve warning messageNoel Grandin2019-03-062-7/+10
| | | | | | | Change-Id: I000dff6b1b6e33e1b2c5aa337c027c1edd7b1003 Reviewed-on: https://gerrit.libreoffice.org/68795 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Remove debugging dump()sStephan Bergmann2019-03-061-8/+0
| | | | | | | Change-Id: I1f5479adefbf7c77a5584d698c6a6c35ff4716d0 Reviewed-on: https://gerrit.libreoffice.org/68778 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:unnecessaryparen improve member expressionNoel Grandin2019-03-062-0/+19
| | | | | | | Change-Id: I304621018cb1e2a47e478e86df4229bcf2176741 Reviewed-on: https://gerrit.libreoffice.org/68757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* re-land "new loplugin typedefparam""Noel Grandin2019-03-052-0/+371
| | | | | | | | | | This reverts commit c9bb48386bad7d2a40e6958883328145ae439cad, and adds a bunch more fixes. Change-Id: Ib584d302a73125528eba85fa1e722cb6fc41538a Reviewed-on: https://gerrit.libreoffice.org/68680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Revert "new loplugin typedefparam"Noel Grandin2019-03-042-371/+0
| | | | | | | This reverts commit 9865440d217d975206a3f91612f0666312bc8fd8. This is not ready to land yet, seems like the latest update of the logic reveals a bunch more places I need to fix before it can land.
* new loplugin typedefparamNoel Grandin2019-03-042-0/+371
| | | | | | | | | | verify that parameters use the exact same typedef-names (if any) in definition and declaration Change-Id: I55d2817f599b0253904dce2d35a1a93967e15a77 Reviewed-on: https://gerrit.libreoffice.org/68439 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* do not call GetFormatTable() from GetNonThreadedContext() (tdf#121949)Luboš Luňák2019-03-011-0/+2
| | | | | | | | | | | | | ScDocument dtor calls ClearLookupCaches(), which calls GetNonThreadedContext(). But ScDocument instances used for copy&paste GetFormatTable() fails on null mxPoolHelper, because ScDocument ctor doesn't set it in such a case. So set up the pointer in ScInterpreterContext on demand only if actually needed. Change-Id: If3811da5bb00a2d7d404c089ee1bf46037a2cddb Reviewed-on: https://gerrit.libreoffice.org/68350 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
* Remove unused YYWarning functions (cargo cult?)Stephan Bergmann2019-02-281-1/+1
| | | | | | | Change-Id: I9cb03530150ee35bdaee4920dd2e818007a0a658 Reviewed-on: https://gerrit.libreoffice.org/68469 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Fix apparent temporary debugging leftoverStephan Bergmann2019-02-271-1/+0
| | | | | | | Change-Id: I3277a341137b1b404ad9839431b5cc39a88fcbe1 Reviewed-on: https://gerrit.libreoffice.org/68425 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* loplugin:unnecessaryoverride look for more patternsNoel Grandin2019-02-272-50/+111
| | | | | | | | | | | | | like bool Foo::bar() { b = Super::bar(); return b; } Change-Id: I5e4c8005a3da7d7487c9039c35dcbb1d17e65bd7 Reviewed-on: https://gerrit.libreoffice.org/68418 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:unusedfields fix read/write when dealing with r<<= and >>=Noel Grandin2019-02-272-8/+26
| | | | | | | Change-Id: I103bcc2f21741d0a52a0bdf053fdbddf5a3e9ea0 Reviewed-on: https://gerrit.libreoffice.org/68387 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
* m_bShowAllShapes in SdPageObjsTLV is deadNoel Grandin2019-02-271-2/+0
| | | | | | | | | | | | since commit c4a91f1409fc21d92f207718f29377c2862e381f Date: Mon Feb 11 17:32:44 2019 +0000 weld SdInsertPagesObjsDlg Change-Id: I9644c492d02e930592fd568c15f2f87d12f4f038 Reviewed-on: https://gerrit.libreoffice.org/68386 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:simplifybool improve search for negated operatorNoel Grandin2019-02-272-56/+121
| | | | | | | Change-Id: Id6ac35fefa5c3e1f64c222713791e849b3cb4d34 Reviewed-on: https://gerrit.libreoffice.org/68379 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:unusedfields look for classes where we can make all the..Noel Grandin2019-02-271-0/+28
| | | | | | | | | fields private Change-Id: Id3c6b123f06ab5dcf87628de4c347626110d2d27 Reviewed-on: https://gerrit.libreoffice.org/68302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:unusedmethodsNoel Grandin2019-02-252-99/+151
| | | | | | | Change-Id: I085394e0f4b780dc5b376d5ac0e9d761434e3ead Reviewed-on: https://gerrit.libreoffice.org/68301 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Fix typoAndrea Gelmini2019-02-241-1/+1
| | | | | | | Change-Id: I70542a0cbbed834f47a84be4a60330ddc6e84d6f Reviewed-on: https://gerrit.libreoffice.org/68274 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
* Fix typoAndrea Gelmini2019-02-231-1/+1
| | | | | | | Change-Id: I428b4c484ba6e18ee2947c9be4688317764769f2 Reviewed-on: https://gerrit.libreoffice.org/68240 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
* loplugin:writeonlyvars is no-op on Windows, so don't run its test thereStephan Bergmann2019-02-221-2/+8
| | | | | | | | | | But nevertheless, make sure that the variables m_bar9/10 used in combination with css::uno::Any have UNO-compatible type. Change-Id: I4e9915193386278ace128df94f7722d90b2567f2 Reviewed-on: https://gerrit.libreoffice.org/68195 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* loplugin:unusedfields improve write-only when dealing with operatorsNoel Grandin2019-02-216-375/+1145
| | | | | | | Change-Id: I3a060d94de7c3d77a54e7f7f87bef88458ab5161 Reviewed-on: https://gerrit.libreoffice.org/68132 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Fix typoAndrea Gelmini2019-02-211-1/+1
| | | | | | | Change-Id: Ibd7c52137674eb07c35c951260a8102d06a436cc Reviewed-on: https://gerrit.libreoffice.org/68130 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
* Avoid loplugin:indentation after preproc conditional inclusion linesStephan Bergmann2019-02-202-0/+14
| | | | | | | | | | | | | | | | | | | ...to not trigger (for --disable-dbgutil) at > rContentAtPos.eContentAtPos = IsAttrAtPos::TableBoxFml; > #ifdef DBG_UTIL > if( RES_BOXATR_VALUE == pItem->Which() ) > rContentAtPos.eContentAtPos = IsAttrAtPos::TableBoxValue; > else > #endif > const_cast<SwTableBoxFormula*>(static_cast<const SwTableBoxFormula*>(pItem))->PtrToBoxNm( &pTableNd->GetTable() ); (sw/source/core/crsr/crstrvl.cxx:1710) Change-Id: I8fd5c8a1cd40450bdd8cc97057e5233a0134f044 Reviewed-on: https://gerrit.libreoffice.org/68030 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Better loplugin:unnecessaryparen check for vexing parseStephan Bergmann2019-02-191-2/+3
| | | | | | | Change-Id: Id7b09a8556da25b81c056d5811ba721e781682d6 Reviewed-on: https://gerrit.libreoffice.org/68025 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* make Makefile-clang.mk also use gb_Output_announceLuboš Luňák2019-02-181-3/+6
| | | | | | | | | | So that the output is consistent, even though the actual build handling is different. Change-Id: I460dfe4c2ac74515cc1b598d47e119eb249b8277 Reviewed-on: https://gerrit.libreoffice.org/67972 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
* make uninteresting code in clang's makefile to the uninteresting partLuboš Luňák2019-02-181-10/+10
| | | | | | | Change-Id: I235284c7198aa2a295b4d81ff2f8e9ca554a4174 Reviewed-on: https://gerrit.libreoffice.org/67971 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
* Make findOperator more precise wrt acceptable parameter typesStephan Bergmann2019-02-181-8/+38
| | | | | | | Change-Id: I0a1ea253d999c9444344188d764134e83ae0c495 Reviewed-on: https://gerrit.libreoffice.org/67959 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
* Tell about presumed corresponding negated operatorStephan Bergmann2019-02-182-6/+14
| | | | | | | Change-Id: Ic7ed64ecc4902853dc7431294484abb74e8da65b Reviewed-on: https://gerrit.libreoffice.org/67953 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>