summaryrefslogtreecommitdiffstats
path: root/compilerplugins
Commit message (Collapse)AuthorAgeFilesLines
* Adapt compilerplugins to Clang trunk towards 3.6Stephan Bergmann2014-08-112-0/+12
| | | | Change-Id: I0b7be1616a3e4206982f9f925de141ed9d53b96e
* Adapt loplugin:derefnullptr to old Clang versionsStephan Bergmann2014-07-301-1/+1
| | | | | | | | | ...where prior to r183883 "Implement core issue 903: only integer literals with value 0 and prvalues of type std::nullptr_t are null pointer constants from C++11 onwards," Expr::isNullPointerConstant with NPC_NeverValueDependent could go into an llvm_unreachable case. Change-Id: I29cf093f18ece4cd83fd759e30f72c2a71f69554
* fix for running externandnotdefined plugin on UbuntuNoel Grandin2014-07-291-2/+1
| | | | Change-Id: I00804b2dd63df44478a14a3eaf2fdcd4e4ce5d09
* compilerplugins: Fix tutorials pluginsJuan Picca2014-07-246-9/+9
| | | | | | | | | Broken in commit 1f078fcaddd45bb074e4d0a4933db01f6e8b623e Change-Id: Ica93c3b9309b2ae4d973ccc34a84b5accac7472c Reviewed-on: https://gerrit.libreoffice.org/10478 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
* new loplugin: externalandnotdefinedNoel Grandin2014-07-111-0/+79
| | | | | | | | Find "missing headers," where a function is declared directly in the .cxx (as extern) and not defined, and should arguably instead be declared in an include file. Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
* compat for Clang 3.2Stephan Bergmann2014-07-022-2/+24
| | | | Change-Id: I2746abd05edd00dadfe613c17b9874b1035c3be4
* Make configmgr loplugin:salbool-cleanStephan Bergmann2014-07-021-13/+9
| | | | Change-Id: Ib1f33387c50bcd853140eb2fc46995d23d7f367b
* loplugin:salbool: Fix handling of potentially overriding functionsStephan Bergmann2014-07-021-23/+40
| | | | Change-Id: I63d00cf5ab1dac953fae07ca4eb4d987610551a2
* Activate the "suspicious cast to sal_Bool" parts of loplugin:salboolStephan Bergmann2014-07-011-17/+28
| | | | Change-Id: I78a368ef2899b2462251b45a327fc7b1f31fe764
* New loplugin:stringconcatStephan Bergmann2014-07-011-0/+82
| | | | Change-Id: Id7c517fb37bc28797c45fc0dde83e866f2aa4aac
* 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-246-119/+31
| | | | | | to reduce copy-pasted code Change-Id: I7728d85dea7d0161998c326d6648ca681a8250d0
* Clang trunk compat fixStephan Bergmann2014-06-241-1/+2
| | | | Change-Id: Ic414ad0416e27e223ff702996b796b68d39709b9
* new compilerplugin returnbyrefNoel Grandin2014-06-241-0/+153
| | | | | | | | | | | | | | Find places where we are returning a pointer to something, where we can be returning a reference. e.g. class A { struct X x; public X* getX() { return &x; } } which can be: public X& getX() { return x; } Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
* Fix logic to obtain callee's FunctionProtoType (if any)Stephan Bergmann2014-06-171-6/+11
| | | | Change-Id: I1bfdd865429cc6fa89ea3b6b4fc132b5d5b57b0d
* improve the inlinesimplememberfunctions clang pluginNoel Grandin2014-06-171-53/+57
| | | | Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
* loplugin:staticcallStephan Bergmann2014-06-131-0/+49
| | | | Change-Id: Id46b391c09555c9ec30916fdd93b05455835d81b
* New loplugin:derefnullptr (all violations already fixed)Stephan Bergmann2014-06-111-0/+44
| | | | Change-Id: I32cd8e740855699036c420a091c282029f8d4a08
* compile fixNoel Grandin2014-06-091-2/+28
| | | | | | | after my commit 184a00b96235f6432294ded63ce4a4a318effdb5 "loplugin: inlinesimplememberfunctions" Change-Id: Ib46d862b90566506c3035a12eeb01892b225ed51
* improve safety of loplugin inlinesimplememberfunctionsNoel Grandin2014-06-091-0/+13
| | | | | | don't try and move functions containing comments Change-Id: I2de8fc8be851af979acf9d1a91e7cdd9a5dc6a32
* new loplugin: inlinesimpleaccessmethodsNoel Grandin2014-06-041-0/+282
| | | | | | | | | | Create a rewriting plugin for finding methods that simply return object fields, and should therefore be declared in the header, so that the compiler can reduce method calls into a simple fixed-offset load instruction. Change-Id: I7a620fc54250b79681918dc31ed9a8f21118c037 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
* New loplugin:inlinevisible to flag inline functions marked DLLEXPORTStephan Bergmann2014-05-301-0/+53
| | | | | | | | ...which does not make sense. On Linux and Mac OS X, they potentially end up exported from multiple libs (weakly, though), while on Windows the potentially even end up not emitted at all, which could cause link errors. Change-Id: I092c9ba39e686c17b6e91581cdd4753f1c4d582f
* Filter out all -fsanitize= args when building compilerpluginsStephan Bergmann2014-05-221-1/+1
| | | | Change-Id: Ic809ddad81608f107749498c1432606403ee2314
* loplugin-passbyref: ignore non-base declarationsNoel Grandin2014-05-221-0/+7
| | | | | | | Only consider base declarations, not overriden ones, or we warn on methods that are overriding stuff from external libraries. Change-Id: I08791c96f7adba5997ad237a98e7c08a759042ad
* enhance pass-by-ref plugin to detect large argumentsNoel Grandin2014-05-201-14/+20
| | | | | | | Detect arguments larger than 64 chars passed by value. Change-Id: I9b0ea9ccb99d115984a26eab67c9cf6afd5f6cae Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
* Correct common misspellings, and remove some ASCII art along the way.Chris Laplante2014-05-171-1/+1
| | | | | | | Change-Id: I42787db31769e8bde984c5f4f0aa90335e889b1c Reviewed-on: https://gerrit.libreoffice.org/9356 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
* combine the pass-by-ref clang pluginsNoel Grandin2014-05-162-70/+14
| | | | Change-Id: Idac24afb7cb67fa2d539553fb9fa049c2d61ecf0
* Find places where uno::Sequence is passed by value.Noel Grandin2014-05-141-0/+63
| | | | | | | | | | Implement a clang plugin to find them, and clean up existing code to pass them by reference. Change-Id: If642d87407c73346d9c0164b9fc77c5c3c4354b8 Reviewed-on: https://gerrit.libreoffice.org/9351 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
* compilerplugins/clang: filter out -fsanitize=addressStephan Bergmann2014-05-091-1/+1
| | | | Change-Id: I3e78bd86c8010124a2d006f288095aac26e60797
* compilerplugins: Build them in parallel.Jan Holesovsky2014-04-171-1/+5
| | | | Change-Id: Idddc9a2b76e33c7e90ca51cb2c53e0d9f34d3906
* salbool: fix commentThomas Arnhold2014-04-151-1/+1
| | | | | | | | accidently removed by 5babf1b9037eb283798322eecd8334e6ff1db655 maybe obsolete now Change-Id: Id1b8ce21e08ce2df5668252406bad6fb549b5206
* Flag unreferrenced functions only declared in the main file, not an includeStephan Bergmann2014-04-152-0/+172
| | | | | | | | | ...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
* Better be specificStephan Bergmann2014-04-151-2/+2
| | | | Change-Id: Ibb9b5b8f53ab8fdeba6d3db295339ead4bde7b6e
* add "include/comphelper" to list of includes to ignoreNoel Grandin2014-04-151-0/+1
| | | | | | | since it only contains a single sal_Bool site now, and we want to leave that alone since it's a copy of similar stuff in cppuhelper. Change-Id: I3cf4cf5f67e95d5b6f70371181f77c5451fcbf50
* remove unnecessary scope qualifier from sal_Bool usesNoel Grandin2014-04-031-1/+1
| | | | | | i.e. convert "::sal_Bool" to "sal_Bool" Change-Id: Ie5943aee4fee617bf2670655558927ed25b7e067
* Add compat::isInMainFileStephan Bergmann2014-04-022-11/+16
| | | | Change-Id: I0e155c6c68a43020110a8e1c0cb29cabdcade454
* Explicitly mark overriding destructors as "virtual"Stephan Bergmann2014-04-011-1/+19
| | | | | | | | It appears that the C++ standard allows overriding destructors to be marked "override," but at least some MSVC versions complain about it, so at least make sure such destructors are explicitly marked "virtual." Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
* Plugin to warn about/fix verriding functions not marked SAL_OVERRIDEStephan Bergmann2014-03-271-0/+158
| | | | Change-Id: I1d49aa9ad238cd5bd2e04479c2eb916f010417df
* More compat stuffStephan Bergmann2014-03-271-0/+16
| | | | | | (currently only used by a not-yet committed plugin, though) Change-Id: I4cff7eb97dbe10a44a911be9db090ea8cd10d8f0
* fix filename detection in clang pluginsLuboš Luňák2014-03-232-3/+3
| | | | | | SourceManager::getFilename() returns "<stdin>" whenever icecream is used. Change-Id: I4e3e1b90880c5fd2b53f20e4ce3e38e3a0486973
* improve warning message in passstringbyref compiler pluginNoel Grandin2014-03-191-2/+2
| | | | Change-Id: Ia8470bbd04c841e6c44c182493fede3dc312f635
* Find places where OUString and OString are passed by value.Noel Grandin2014-03-181-0/+71
| | | | | | | | | | It's not very efficient, because we generally end up copying it twice - once into the parameter and again into the destination OUString. So I create a clang plugin that finds such places and generates a warning so that we can convert them to pass-by-reference. Change-Id: I5341a6ea9e3190f4b4c05c42c85595e3dcd83361
* More compat stuffStephan Bergmann2014-03-141-0/+8
| | | | | | (currently only used by a not-yet committed plugin, though) Change-Id: Id62ea41031ad8ba4495ef46877ad7a10bc58fb05
* Save the stdexception rewriter plugin used in...Stephan Bergmann2014-02-281-0/+199
| | | | | | | ...5e21a413c788f839a66d9e4c14e745ed18058db8 "retrofit std::exception into overriding exception specs." Change-Id: If802bbd26b91438f3f46fe18bc763d27967bac5c
* Remove visual noise from compilerpluginsAlexander Wilms2014-02-276-9/+0
| | | | | Change-Id: Ibfed0b64bd60804fa377b5e25e5f197a7772d605 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
* isIntegerConstantExpr is more general than IntegerLiteralStephan Bergmann2014-02-251-17/+12
| | | | | | | ...and subsumes not only the use of __builtin_expect in assert, but also the use of __builtin_constant_p (nested) in htonl on Mac OS X. Change-Id: I62ab6c71c42948c4ec1e2f1e1d23223cbb13416b
* Move plain rewriters to store/ (so they don' get built needlessly)Stephan Bergmann2014-02-254-0/+0
| | | | Change-Id: I62d21e9a579bcb9c116bb272fc1236a890216cd9
* Drop CLANGBUILD in addition to CLANGDIRStephan Bergmann2014-02-251-2/+2
| | | | | | | | ...see <http://lists.freedesktop.org/archives/libreoffice/2014-February/059654.html> "Drop CLANGBUILD in addition to CLANGDIR?" Change-Id: I8d68aa0f2298240c8e7265cab273c602f5b6881a
* salbool: a rewriting plugin that flags most uses of sal_BoolStephan Bergmann2014-02-252-0/+584
| | | | | | | | | | | ...that would not lead to silent changes of the code. That is, it does not warn about sal_Bool parameters of virtual functions, so that (not yet rewritten) overrides do not silently become overloads instead. The plugin is in store/ for now, because not all of the code has been cleaned up yet. Change-Id: I6e9b3847eb26c3090f375045188d38097052defe