summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)AuthorFilesLines
2015-04-09loplugin:staticmethodsNoel Grandin1-2/+7
Change-Id: I715374b531da2850434b2436633b6042ecb9ebe0
2015-04-09loplugin:staticmethodsNoel Grandin1-0/+5
Change-Id: Ie348778ea666c24e95e048386547f301083a0017
2015-04-02loplugin:staticmethodsNoel Grandin1-0/+14
Change-Id: Ibf0c73ac17ec19ed672f66907db47057920babca
2015-03-31Reduce to static_cast any reinterpret_cast from void pointersStephan Bergmann1-3/+51
Change-Id: I514e183571e4ac109f59c4bdfccdc553c36c26ee
2015-03-30Remove leftover debug codeStephan Bergmann1-4/+0
Change-Id: I874fc4d677abb2646bffb4331a220f3812443b66
2015-03-29Clean up template-parameter-dependent C-style castsStephan Bergmann1-4/+0
Change-Id: Ia1ab134a0afbeeb3ae40264bd4233a47df26b734
2015-03-29Clean up remaining C-style casts among void pointersStephan Bergmann1-3/+0
Change-Id: I1b49c020d597b569e330482f4dbf20c15ccdae3f
2015-03-28Clean up isMacroBodyExpansionStephan Bergmann4-25/+3
Change-Id: I745b320dd5f44d54371d8a0b961c49793e3e0ad6
2015-03-28Clean up C-style casts from pointers to voidStephan Bergmann1-8/+3
Change-Id: Idff46e5642034cf751d557de9a49c02a7abf27bb
2015-03-28loplugin:redundantcast: Don't warn about certain casts in macrosStephan Bergmann1-1/+4
...that might depend on macro arguments and not really be redundant Change-Id: If19de3835a4972add58965ea7c0936fad7ef6957
2015-03-27new clang plugin: staticmethodsNoel Grandin3-14/+152
Genius suggestion from Tor Lillqvist, write a clang plugin that finds methods that can be static. Change-Id: Ie6684cc95d088e8750b300a028b49f763da00345
2015-03-26const_cast: convert some C-style casts and remove some redundant onesStephan Bergmann2-22/+195
Change-Id: I876736d18db6676629c283fccd65e1b6fb2bb2be
2015-03-26move the constantfunction plugin into /storeNoel Grandin1-0/+0
as sberg points out, it needs a massive blacklist, which is going to be a pain to maintain. Until I can think of a way to make this more resilient, move it where it can't bother people. Change-Id: I64fc498146a3cb4ea9c1e37150c4ef50023b7bd5
2015-03-26loplugin:constantfunction: vcl/unx/gtk3Stephan Bergmann1-2/+4
Change-Id: I66ffc0c3a73d45e9d4b54f46092a65913b753d26
2015-03-26loplugin:constantfunction: vcl/unx/gtk3Stephan Bergmann1-0/+10
Change-Id: Ieedf89bebb59e783dfe13ef2d5ae7ba3347cdc62
2015-03-26loplugins:constantfunction: properly detect overloaded operatorsStephan Bergmann1-29/+8
Change-Id: I484e1206d1f17305d21f7e750b8aca9d1c8d809b
2015-03-25Expr::EvaluateAs... does not work for type-dependent expressionsStephan Bergmann1-2/+3
Change-Id: Iea1cd468528d00ffa07e13b2063ca5fce5cc4fae
2015-03-25new constantfunction lopluginNoel Grandin2-0/+497
Change-Id: Ie9b7a0c41fc4dbd2560ceff6bae9ab85357f518b
2015-03-17loplugin: add Dialog to unusedvariablecheckNoel Grandin1-0/+27
so that we find dialog that have been instantiated but not actually executed Change-Id: Ia308e832780627c0a8de71a9d64dabcb3b861a9c
2015-03-11Ensure RTTI symbol visibility for Linux Clang -fsanitize=function,vptrStephan Bergmann1-3/+8
The problem being that any lib later loaded via osl_loadModule (e.g., libgcc3_uno.so) would not bind to the same global (RTTI-related) symbols as libsofficeapp.so and its dependencies (so, e.g., -fsanitize=function would erroneously assume that bridges/source/cpp_uno/shared/component.cxx's uno_initEnvironment is called with a different, non-matching uno_Environment type). Change-Id: I08b0cbc1f9eb74641eb617c46587a0a528a56c31
2015-03-11Fix copy/paste errorStephan Bergmann1-1/+1
Change-Id: I3fd9d6447adfa365a823ca6e87f0939670bcb39b
2015-03-03Improve loplugin:passstuffbyrefStephan Bergmann1-2/+5
Change-Id: I88ab4c51ff59312127681d3087d22b9c79192b94
2015-03-02Missing initializationStephan Bergmann1-1/+1
Change-Id: I45eabbe9d1a4e3f85f16c2869c4031fc06f5ef31
2015-03-02plugin:literaltoboolconversion: Recurse into comma operator's rhsStephan Bergmann1-6/+15
...inspired by <http://www.viva64.com/en/b/0308/#ID0EE4BI>'s V639 finding. Change-Id: I3b49f00dd4a593ed0b94d81398fa89ff64f6c79b
2015-02-26Adapt compilerplugins to Clang trunk towards 3.7Stephan Bergmann2-8/+11
Change-Id: I5b41039bf63a4c2f313fe7a57c0f6934dcb0752d
2015-02-09Adapt loplugin:passstuffbyref to Clang 3.2Stephan Bergmann1-5/+5
Change-Id: I24d0b7531feba32f86f761daf18170397cfe5d2f
2015-02-07loplugin:deletedspecial (Mac OS X)Stephan Bergmann1-1/+5
Change-Id: Ia09e2e7b3e40bd04da64b52fe29258017b90b156
2015-02-07loplugin:deletedspecial to help add SAL_DELETED_FUNCTION annotationsStephan Bergmann1-0/+151
...to special member function declarations that were left undefined. Helps compilers do a better job at identifiying unused class members. This plugin uses heuristics and whitelists do identify applicable declarations, but is not appropriate for "unattended" use so is placed into store/. The following commits contain the results of running this plugin, per module: * Declarations of undefined special member functions are mmarked SAL_DELETED_FUNCTION (aka "= delete", which is deemed superior to deriving the class from boost::noncopyable, cf. Howard Hinnant's reply to <http://stackoverflow.com/questions/7823990/what-are-the-advantages-of-boostnoncopyable>. * Any redundant "explicit" or SAL_DLLPRIVATE markers are removed from the deleted definitions. * Some redundant declarations of undefined default ctors are simply removed; smelled like clueless cargo-cult to have them declared at all. * Some declarations of undefined operator == etc. are left in (and marked SAL_DELETED_FUNCTION) for now, to be on the safe side, though they are likely clueless cargo-cult, too. * Most "static-only" classes are replaced with namespaces (and some where that would be non-trivial due to private members are marked TODO for later). * Newly identified unused class members are removed. Change-Id: Ibeaae4fd579d7a0971a2c2a654a2263acd13414a
2015-02-05Extend loplugin:passstuffbyref to handle lambdasStephan Bergmann1-27/+55
...even if it is known to be dangerous Change-Id: Ied96284e33b966bf072d0961054479ec7f891dea
2015-01-29Extract loplugin:redundantcast from loplugin:cstylecastStephan Bergmann2-28/+84
Change-Id: I08f17dd9cc092206083ff41bbbc178e0322e86d0
2015-01-28Some more loplugin:cstylecast clean-upStephan Bergmann1-7/+6
Change-Id: I132d22e2af3cf673c17d8964f690d48990834884
2015-01-26move these plugins into /storeNoel Grandin2-0/+0
we don't need to run them on an ongoing basis, and the current code does not compile with older versions of clang. Change-Id: I07ccacf7ff7b00e8e2453fff91a3f487dd5abed9
2015-01-26new loplugin: change virtual methods to non-virtualNoel Grandin2-0/+260
Where we can prove that the virtual method is never overriden. In the case of pure-virtual methods, we remove the method entirely. Sometimes this leads to entire methods and fields being eliminated. Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2015-01-22loplugin:cstylecast: Warn about more of the potentially suspicious onesStephan Bergmann1-5/+3
Change-Id: Id7a596344c21e9265e35188c477e60ce510bcc6e
2015-01-09loplugin:cstylecast: warn about certain redundant reinterpret_castsStephan Bergmann1-0/+28
Change-Id: Iaa46849742c215798722d03d9ee59bb39d8033f7
2015-01-08Fix typoTor Lillqvist1-1/+1
Change-Id: Ifdbcbcc51c29dc14b2a3b4c845481b45300313d6
2015-01-08loplugin:cstylecast: improve detection of C codeStephan Bergmann2-7/+43
Change-Id: Id5dd1ee1a29c4e1c7cb2b58419d6ccb1f032bffe
2015-01-07loplugin:cstylecast: No need to exclude include/cppuhelperStephan Bergmann1-5/+0
Change-Id: Ie74be926c1e071fa9b311920b1cf1d4dd5bbd30d
2015-01-07tools/solar.h already filtered out via filename.endsWith(".h")Stephan Bergmann1-2/+1
Change-Id: I8a4483a6425f51fea0eae5c809c6c41ef56388a2
2015-01-07loplugin:cstylecast: bridgesStephan Bergmann1-9/+5
Change-Id: I7c41b90c9af045fd452ee62ed0c5d9b261236855
2015-01-07loplugin:cstylecast: salStephan Bergmann1-9/+2
Change-Id: I0ad9681a8b31d78cefce5b66040415154a1c7a99
2015-01-07Minor beautificationStephan Bergmann1-2/+2
Change-Id: I1300d1d696878c1b646decc2841f13d489d3cadc
2015-01-07loplugin:cstylecast: Exclude only sal, not salhelperStephan Bergmann1-1/+1
Change-Id: Ib09f2b794ce7a1e650275750a67c6c8ad5d7c808
2015-01-06Work around loplugin:cstylecast under -fsanitize=*Stephan Bergmann1-1/+7
Change-Id: I467d032296607d22e850c95e56c452fe7e62cebe
2015-01-05Improve loplugin:revisibilityStephan Bergmann1-1/+19
(for non-Windows--only code, as MSVC would complain about such cases anyway) Change-Id: Id6daf61b79bd31529bdaeb7c6df4f354731ae7d7
2015-01-05Some loplugin:revisibility clean-upStephan Bergmann1-0/+71
Stumbled across such redundant visibility re-specifications when looking at the odd case of cppu_unsatisfied_iquery_msg declared CPPU_DLLPUBLIC in cppu/source/cppu/cppu_opt.cxx and used in inline code in include/com/sun/star/uno/Reference.hxx with only a declaration lacking CPPU_DLLPUBLIC visible, and wondering how that actually works on Windows. However, this plugin is probably not worth it being run all the time, so committing it to compilerplugins/clang/store/. Change-Id: Ibc3c4e7499213de1b419ce7eb85455cb832e1510
2014-12-21Don't call isIntegerConstantExpr if isValueDependentStephan Bergmann1-2/+5
...some paths trough clang::Expr::isIntegerConstantExpr (esp. if non-CPlusPlus11) assert the assumption that the given expr is not value-dependent, so it appears to be a prereq Change-Id: Ibc5fe472ea3f91b31c8cb7f06c4b7c7f4d6831a3
2014-12-19Extend loplugin:literalalternative to loplugin:stringconstantStephan Bergmann2-111/+1096
Change-Id: Ie425af19019126b6a15ac03f52e32d186a46db35
2014-12-18loplugin:saloverride does not make sense for external codeStephan Bergmann1-2/+9
...where SAL_OVERRIDE is not available Change-Id: I49d447ba90516f4f744c21302607bff97ad3c4d5
2014-12-07loplugin:cstylecast: warn about casts involving incomplete typesStephan Bergmann1-5/+28
...the worst kind of all Change-Id: I6b98a324735a79ed9060003b491acce733f74f06