summaryrefslogtreecommitdiffstats
path: root/compilerplugins
Commit message (Collapse)AuthorAgeFilesLines
* add mode lines to new files (and idls) since last runCaolán McNamara2013-09-2232-0/+90
| | | | Change-Id: Id1e74f18c90e69d1a781c8f02e30dc3c005ed4fd
* move valueof compiler pluginLuboš Luňák2013-08-271-0/+0
| | | | | | | The mass-conversion has been already done, so it's most probably not needed anymore. Change-Id: I3f161b8ea122e4dd185746ea29509b0d7768d6c7
* finish deprecation of O(U)String::valueOf()Luboš Luňák2013-08-211-0/+148
| | | | | | | Compiler plugin to replace with matching number(), boolean() or OUString ctor, ran it, few manual tweaks, mark as really deprecated. Change-Id: I4a79bdbcf4c460d21e73b635d2bd3725c22876b2
* warn when rewriter should modify something involving a macroLuboš Luňák2013-08-211-0/+6
| | | | | | | Apparently Clang rewriter API doesn't properly bail out if the range given is not inside one file, so check explicitly. Change-Id: I27be6d396a131d385231e9c0dfa8c84d9fa15ccc
* prevent crash when rewriting sourceLuboš Luňák2013-08-211-0/+2
| | | | Change-Id: I97519c2fb08efa2c694c9fb91a4cc402a6347c2c
* helper for getting location after current tokenLuboš Luňák2013-08-213-2/+9
| | | | | | | Given that locations often point to a (start of) token, even if it's e.g. getLocEnd(), this should be very useful. Change-Id: I266e4c0a234262e99158c8f495b631f54f8a5608
* update/rework the Rewriter wrapper functionsLuboš Luňák2013-08-212-51/+76
| | | | | | | Some improvements, like making it simple to actually remove a statement or a token including its associated whitespace. Change-Id: I02a5bd919f1fadae1dcd45a76f9d25df353ac518
* error: cannot use dynamic_cast with -fno-rttiStephan Bergmann2013-08-066-7/+12
| | | | | | ...with recent Clang trunk towards 3.4 Change-Id: Ie0991c7bd560c30551aeaada426382a889b46391
* clang binary is in clang build directory, not with its sourcesLuboš Luňák2013-08-051-1/+1
| | | | Change-Id: If037eac010d3cb72ca185382232c211758d009e6
* note about getDirectCallee() vs getCallee()Luboš Luňák2013-08-051-0/+5
| | | | Change-Id: I0a4cfd0ddb0c03b0db95d003004195df29a3f6df
* 'generic' compiler plugin to modify calls to a specific functionLuboš Luňák2013-08-051-0/+84
| | | | Change-Id: I60756d9054dfa5c55aeae8ddc904ddf6d67d2088
* Adapt to PPCallbacks.h changes on Clang trunk towards 3.4Stephan Bergmann2013-07-241-1/+7
| | | | Change-Id: I5611ffd36f9c6d1560a6ada6118a1efaeb6dc522
* adjust for upstreaming of warn_unused attributeLuboš Luňák2013-07-231-0/+9
| | | | | | | The warn_unused attribute has been upstream to GCC and Clang, so use it if present. Still warn about STL types if those do not use it yet (which is the status as of now). Change-Id: I3c003e44c08d1d141e23bba38cf92e663a5ac353
* mention the explicit bool conversion from C++11 for pointer-to-bool checkLuboš Luňák2013-07-161-3/+4
| | | | Change-Id: I050019b30d2ec96bbd25916624f8cb88d72110e4
* compiler plugin warning about unwanted silent pointer-to-bool conversionsLuboš Luňák2013-07-151-0/+163
| | | | | | | | | | | | | | | | | C/C++ silently converts pointers to booleans, which is presumably seen as a good idea by lazy people, but it can occassionally silently break code in strange ways, most notably by selecting a bool overload when no matching overload for the pointer exists (OUStringBuffer::append() can break like that, e.g. in ba37e4062f538db7e51d6a64ba544eeddbc567cf, other cases are 8e3bf1598fa95ac8d099e45ae4252e7654a6f590 or 28e4c0250e67a344b4d6088bdca2e680a4bffad0). So far the plugin checks only conversions in function call arguments, there's disabled code that could check more places, but I'm not aware so far of any place where anything actually broke because of that, and it'd require fixups to be explicit in some places (e.g. 'bool b = returns_pointer();' would require '!= NULL' added), so for it'll be only the simple various and it can be made more strict if wanted. Change-Id: I6a5d207daf925e6c2d1bf684060536795ecfcc35
* fix finding all parents for AST nodesLuboš Luňák2013-07-151-5/+17
| | | | | | | Ctor bodies can also have code inside of member variables initialization, which is not considered to be inside function body. Change-Id: Id68960093a51396b9486f1364b1a361526c3431d
* simplify bodynotinblock plugin using parentStmt()Luboš Luňák2013-06-202-47/+43
| | | | Change-Id: Ia2fe10af2ca555c7b88348e7ed571f1176586580
* simplify postfixincrementfix plugin using parentStmt()Luboš Luňák2013-06-202-67/+27
| | | | Change-Id: I93fa422afe7f3e1e10576dd64af9d57b2302f44e
* make it easy to get a parent of an AST nodeLuboš Luňák2013-06-202-0/+74
| | | | | | | | Clang API doesn't provide this, but it's occasionally needed, and so far the way has been inspecting the highest possible node in AST and walking down and remembering, which is complicated, error-prone and annoying. Change-Id: Id5b72cb5ebfc069e90efe6d673c0ef18ebcdab61
* work around the C++11 __float128 problem with libstdc++ headers and clangLuboš Luňák2013-06-131-1/+1
| | | | Change-Id: Ia1b443d22b3b7f6f93f1ad8c5fa760b0f1da3b83
* Ignore warnings in Clang headersStephan Bergmann2013-06-051-1/+1
| | | | | | (as occur at least in trunk Clang builds) Change-Id: I7e74200ae1042133fa04477e39e46fd2f01cc1b0
* Adapt UPDATE_FILES=<module> to headers being moved to include/Stephan Bergmann2013-06-051-1/+12
| | | | Change-Id: I6af5236358a51a51514d646c809147db56b2464b
* fix plugin build with clang < 3.3Luboš Luňák2013-06-021-6/+6
| | | | Change-Id: If2eb7595ca7d25f6d491e332bb3060061d3b42a7
* make compiler plugin warnings follow WaELuboš Luňák2013-05-311-2/+0
| | | | Change-Id: I72f1a11ce86d66e773e66116c725310df77fce39
* obey --enable-werror when building clang pluginLuboš Luňák2013-05-311-1/+5
| | | | Change-Id: I8ca9b09a6ffd4b2f00740563fa9682fdabb26b3d
* reoder stuff in makefileLuboš Luňák2013-05-311-2/+2
| | | | | | At the top should be stuff to set manually if needed. Change-Id: I516ac6df8102f00f6fc34c4c87d040688fcc2e99
* update for PPCallbacks API changes in Clang3.3Luboš Luňák2013-05-312-2/+43
| | | | Change-Id: I8493afa8e2264a42fba090c9c72f36f36cb2d165
* mark all virtuals in the clang plugin as overrideLuboš Luňák2013-05-3115-21/+21
| | | | | | In order to help catch Clang API changes. Change-Id: I5738f5dff405f7a2dd377c983fb32c1c7a2ff921
* Use the new type-checking Reference constructor to reduce code noiseNoel Grandin2013-05-222-0/+225
| | | | | | | | | | Also create a Clang compiler plugin to detect such cases. Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752 Reviewed-on: https://gerrit.libreoffice.org/4001 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
* check for double modifications in compiler pluginsLuboš Luňák2013-05-062-0/+17
| | | | | | | | A different way to do 1c0669af2f1f58e6431b5e489ac48a883e242ba7. Sometimes one piece of code can be represented several times in the AST, e.g. with default function arguments. Change-Id: Ic7799fa0bd918a638bdc8ebef69e6aa91d355bdc
* compiler plugin for RTL_CONSTASCII_USTRINGPARAM removalLuboš Luňák2013-05-061-0/+140
| | | | Change-Id: Ibc487aa78d9eba3f936b4f4cc0298adfaef60d5c
* Revert "ignore already seen locations in compiler plugins"Luboš Luňák2013-05-062-16/+6
| | | | | | | This does not always work well, e.g. when building a return value in a return statement from a temporary, there is CXXConstructExpr containing CXXTemporaryObjectExpr, which both share the same location. This reverts commit 1c0669af2f1f58e6431b5e489ac48a883e242ba7.
* ignore already seen locations in compiler pluginsLuboš Luňák2013-05-062-6/+16
| | | | Change-Id: Icba8dfa61aee7237af569b2414b1cf4ce93ca476
* Fix handling range in removeText().Luboš Luňák2013-05-062-2/+15
| | | | | | | | Turns out removeText( SourceRange ) treats it as a token range, so it's not always character-exact if used for removal of only several characters from a token (e.g. an identifier). Change-Id: I0223d52da90f9535d9ef1d48b0f56d69131536c8
* add constLuboš Luňák2013-05-0220-28/+28
| | | | Change-Id: I71236b9ca6300372ba00c85401cf19f6c0e7ac99
* Update location of log-areas.doxTor Lillqvist2013-04-241-3/+3
| | | | Change-Id: If54a3d7047f13ae9c9345c21737a89afee645403
* base for unusedcode compiler pluginLuboš Luňák2013-04-221-0/+75
| | | | | | Needs work to actually do something useful, but the basics are there. Change-Id: I193922f2f5572760c8c20def0f9b830138f47fef
* removeforwardstringdecl clang plugin has been used, move itLuboš Luňák2013-04-072-0/+0
| | | | Change-Id: I3bccfa773448e17ac3c8ece6b99f85c6d399b0cf
* compiler plugin to check incorrect #ifdef for config_XXX.h macrosLuboš Luňák2013-04-041-0/+100
| | | | | | http://lists.freedesktop.org/archives/libreoffice/2013-March/047769.html Change-Id: Ibba9d3dcc87d6d6eee58ab3690a8f87339d00956
* don't explicitly delete PPCallbacks-based compiler plugin actionsLuboš Luňák2013-04-041-1/+6
| | | | | | | If the class is based on PPCallbacks too, Clang internals will delete the instance. Change-Id: I6dd83d800e6cca17eb0b5de23c8994f11c087fd5
* silence compilerplugin buildPeter Foley2013-03-301-3/+5
| | | | Change-Id: I4397575e4665e8a257d0bd3e15245d996a48a1f4
* adjust unused compiler plugins for ASTContext to CompilerInstance change tooLuboš Luňák2013-03-288-16/+16
| | | | Change-Id: I415ed25586408d7e7df9457f7c637a8c6d13d35d
* pass around CompilerInstance rather than ASTContextLuboš Luňák2013-03-2815-65/+67
| | | | | | | 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
* -Wextra for compiler pluginsLuboš Luňák2013-03-284-5/+5
| | | | Change-Id: I246dcf1d2c099c510435d21f0dd47e3c098456f2
* A plugin to find suboptimal equalsIgnoreAsciiCaseAscii[L] callsStephan Bergmann2013-03-191-0/+111
| | | | Change-Id: Id2572982ca899223b89016ee7482ccb960032805
* Enable -std=c++11 for compilerplugins/clangStephan Bergmann2013-03-191-1/+1
| | | | Change-Id: I4849656b16c2a7103217870050b0de3ccb97af56
* s/the the/the/Tor Lillqvist2013-02-222-2/+2
| | | | Change-Id: Iadacffaad832c6ff06757e8567e24f929f24a4c3
* Fixed compilation error of Clang plugins on Ubuntu/MintMarc-André Laverdière2013-02-111-0/+2
| | | | | | | Change-Id: Ib08c5075034e0e16c5541f05425ef15d2cc3a6f6 Reviewed-on: https://gerrit.libreoffice.org/2045 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
* make it possible to limit what files will be modified by a compiler pluginLuboš Luňák2013-02-093-25/+90
| | | | Change-Id: I4e3e8f5ca5e5b5b59b1bd067281f90940dd893b1
* fix check whether a file is in a directoryLuboš Luňák2013-02-091-4/+4
| | | | | | Make sure / is appended, otherwise /foo might match /foobar/file . Change-Id: I36469916b72b407c8f0c9c255099ee671039cf17