summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/badstatics.cxx
AgeCommit message (Collapse)Author
2018-11-14make ScInterpreterContext also accessible without passing it aroundLuboš Luňák
E.g. ScModelObj::GetFormatter() can be rather deep in the call chain and it just doesn't make sense to pass ScInterpreterContext* to all the relevant places (and it's a question if it makes sense to pass it around at all, googling shows that thread_local is not really _that_ slow). Change-Id: I9114ef8a10d82a10968391718099edccde7a2663 Reviewed-on: https://gerrit.libreoffice.org/63184 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
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-12vcl: Add a internal (memory) manager for Graphic objectsTomaž Vajngerl
This adds vcl::graphic::Manager which is a manager singleton that tracks all the creation fo graphic objects and swaps them out on a time and allocation basis. Time based - every number of seconds it looks for Graphics that weren't used for a time. Allocation based - when creating a new Graphic and the total of Graphic uses more than the total amount of memory for Graphics defined in configuration, it tries to release the Graphics that weren't used for a time. Change-Id: I5dbf74db4a6455d32c4abcbad7be21c7f0534642 Reviewed-on: https://gerrit.libreoffice.org/52396 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-01-04sw: move some globals in fetab.cxx into SwFEShellMichael Stahl
It looks like the main point of these being globals is so that they can be cleared from various places when tables or table frames are destroyed. Add a SwDoc parameter to ClearFEShellTabCols() and just iterate over all shells. Change-Id: I75ad6b695ee1bfa76b9a05c606b07a3574c70ac4
2017-12-05lokdialog: Make the badstatic loplugin happy.Jan Holesovsky
Change-Id: Ic19bbd2a3533e4e600d8856e55c4e8d06f0ad752 Reviewed-on: https://gerrit.libreoffice.org/45500 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2017-11-29TODO: silence new loplugin:badstatics for nowStephan Bergmann
Change-Id: Ia57dd190a173f664b0c624617b13f2876008835a
2017-11-07Clean away temporarily added using declarationsStephan Bergmann
Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
2017-09-22compilerplugins: add test for badstaticsMichael Stahl
Change-Id: Ibdb3144c0510ed723a01ca28d7cdcd6b21caec54 Reviewed-on: https://gerrit.libreoffice.org/42596 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-09-09tdf#108572 remove connections only for current shellSzymon Kłos
Also remove connections to temp files. Change-Id: Ie5c09eb365d1246e053dc52884c72687ac226f3c Reviewed-on: https://gerrit.libreoffice.org/42095 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2016-12-19vcl: separate ImplImageTree - ImageTree singleton and public ifaceTomaž Vajngerl
ImplImageTree was used outside of VCL which is not consistent with the name and the header also contains a lot of implementation detail. This separates the implementation to ImplImageTree and the public interface and singleton to ImageTree only. Change-Id: I3a26444f0f6971a6b1d83472e9cef19c93192d3e Reviewed-on: https://gerrit.libreoffice.org/32134 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-12-12Whitelist aLogger, in FormulaLogger& FormulaLogger::get()Tor Lillqvist
To avoid this: sc/source/core/tool/formulalogger.cxx:55:26: error: bad static variable causes crash on shutdown [loplugin:badstatics] static FormulaLogger aLogger; ~~~~~~~~~~~~~~~~~~~~~^~~~~~~ sc/inc/formulalogger.hxx:42:31: note: ... due to this member of 'FormulaLogger' [loplugin:badstatics] const ScFormulaCellGroup* mpLastGroup = nullptr; ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ sc/inc/formulacell.hxx:66:20: note: ... due to this member of 'ScFormulaCellGroup' [loplugin:badstatics] ScFormulaCell *mpTopCell; ~~~~~~~~~~~~~~~^~~~~~~~~ sc/inc/formulacell.hxx:114:21: note: ... due to this member of 'ScFormulaCell' [loplugin:badstatics] ScDocument* pDocument; ~~~~~~~~~~~~~~~~^~~~~~~~~ sc/inc/document.hxx:312:27: note: ... due to this member of 'ScDocument' [loplugin:badstatics] VclPtr<SfxPrinter> pPrinter; ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ Change-Id: I533e45f655ca928a801188aa48ee818d89a962ac
2016-10-09loplugin:badstatics: reliably look into std container typesStephan Bergmann
Change-Id: Ifca7325533e3f7d5ce5c59cc6b14d4232d4fc792 Reviewed-on: https://gerrit.libreoffice.org/29614 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-09loplugin:badstaticsStephan Bergmann
ScAddInListener has a member ScAddInDocs* pDocs; // documents where this is used where ScAddInDocs is set<ScDocument*>, and ScDocument has a memmber VclPtr<SfxPrinter> pPrinter; so that's only a chain of (apparently non-owning) pointers. Change-Id: I050218320eb2c588dcfaee80225f4e45a515ed32 Reviewed-on: https://gerrit.libreoffice.org/29613 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-29sfx2: introduce SfxViewShell::GetViewShellId()Miklos Vajna
This is quite similar to SwFrame::GetFrameId(), i.e. it assigns a numeric identifier to each instance to help debugging, as those identifiers are stable accross runs. Change-Id: I9cc57e316435f0284a1d481a956a703be859d67e Reviewed-on: https://gerrit.libreoffice.org/27669 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-30loplugin:badstatics: new static only found with libc++Stephan Bergmann
Change-Id: I93f12629fe6aa4bddae7379a5a7ac4f4c42c7923
2016-06-30loplugin:badstatics: further (Linux-only) static only found with libc++Stephan Bergmann
Change-Id: I048212e3feb3f548d5a65940dd71ccb71cade778
2016-06-29loplugin:badstatics: whitelist some more staticsStephan Bergmann
...which use std containers and are only found at all with the libc++ container implementations, not the libstdc++ ones. Change-Id: Ic9af06139823befad4af1a9a825cba10c115aceb
2016-06-28More Clang 3.4 "(anonymous namespace)" fixesStephan Bergmann
Change-Id: I7cb43f915565dadd611b90ee30373e472f97efb5 Reviewed-on: https://gerrit.libreoffice.org/26748 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-22Avoid reserved identifiersStephan Bergmann
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-04-18tdf#99352 - Some VclPtrs leak past DeInitVCLNoel Grandin
Change-Id: I74b27b1d8b662a644df580ae128643b8495355f8 Reviewed-on: https://gerrit.libreoffice.org/24204 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-15update badstatics plugin to look for VclPtr<> staticsNoel Grandin
maybe we should create a "StaticVclPtr<>" class that checks if VCL is still "alive" before destructing the object? Change-Id: If8619f689c29294efa19c37ec782fa07acec728d Reviewed-on: https://gerrit.libreoffice.org/24085 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2016-01-25compilerplugins: rejoice, for pStaticThesSubMenu is deadMichael Stahl
Change-Id: I6c7f250af4c1f09feb836aef3c468d97e8266e4b
2015-12-08More loplugin::TypeCheck useStephan Bergmann
Change-Id: I2f4a26a918134568f541cd45bdcf5a12b1f1d2ee
2015-11-26compilerplugins: adapt commentMiklos Vajna
...after 49c2b9808df8a6b197dec666dfc0cda6321a4306 "bin/rename-sw-abbreviations.sh" Change-Id: Ibd74246403bead8100d181b335f9145013f31e5e
2015-11-26Adapt whitelisted namesStephan Bergmann
...after 49c2b9808df8a6b197dec666dfc0cda6321a4306 "bin/rename-sw-abbreviations.sh" Change-Id: I90cec551bdc52ea4d76dd9e32b45692e8a3be70f
2015-11-17vcl, sd: rename some overly generic static variablesMichael Stahl
Change-Id: I89159df36361f9ceff3401ef379c8230465617b7
2015-11-17Fix check for std::weak_ptr (that may be in an inline namespace)Stephan Bergmann
Change-Id: I048aef08df43d07544aafc69b711d258dc40bc21
2015-11-17Work around loplguins:badstaticsStephan Bergmann
Change-Id: I597dbc3e4288acb5b71f7a344ae78ba568451614
2015-11-17Work around loplguins:badstaticsStephan Bergmann
Change-Id: I9d8d0f6cc001de09d8d3f96d8ad7e243e07f426d
2015-11-17Work around loplguins:badstaticsStephan Bergmann
Change-Id: I243dcb86cc1a99550b26962daf47c19eb62aa8df
2015-11-17Improve commentStephan Bergmann
Change-Id: I25931d59fc1b4feb1fd1eaa036a64a28a269f409
2015-11-17Work around loplugin:badstaticsStephan Bergmann
...about static ImplImageTree instance; in ImplImageTree::get (vcl/source/gdi/impimagetree.cxx) due to StyleIconSet ImplImageTree::maIconSet; (of type std::unordered_map<OUString, IconSet, OUStringHash>) due to IconCache ImplImageTree::IconSet::maIconCache; (of type std::unordered_map<OUString, std::pair<bool, BitmapEx>, OUStringHash>), reported at least when building against Mac libc++. This is a false positive, as ImplImageTree::shutDown cleans this up. Change-Id: Idb1a99aa33f71286e57b31b7adb833e3ee8b5f5a
2015-11-17Improve loplugin:badstatics diagnostic outputStephan Bergmann
Change-Id: Ia2f088a79b03ff866429e1cae73edccd36a01b4f
2015-11-17Use a DiagnosticsEngine::NoteStephan Bergmann
...a Remark prints the whole stack of includes leading up to the source Change-Id: I41e5bd2855b4a55b54e63432703f2e65b4c44249
2015-11-17compilerplugins: enhance badstatics plugin to follow pointersMichael Stahl
.... and references. This gives numerous false positives as pointers may be re-set prior to shutdown, so needs a white-list. Change-Id: I19a011c6f19501cc31b3d9ae76b599296f132478 Reviewed-on: https://gerrit.libreoffice.org/19949 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-11-06compilerplugins: enhance "badstatics" plugin to find membersMichael Stahl
Finds static variables of types that have bad non-static members. Change-Id: I81ee940580c0f043feb543840ea4d3dd27734202
2015-11-02compilerplugins: add "badstatics" to detect abuse of VCL BitmapsMichael Stahl
VCL Image/Bitmap/BitmapEx instances must not have static life-time because then they will be destructed after DeInitVCL() and that likely segfaults. Change-Id: I3ff8d32de729c971b190028094cb4efe206395e2