26 Commits

Author SHA1 Message Date
Stephan Bergmann
01f3b95884 These version checks are about the Clang the plugins are built /against/
...not the (Clang) compiler they are being built /with/.  (Also simplifies the
checking #if code.)

Change-Id: I416321be4ef4478785be40571f81500fd3b6feb8
2016-02-26 14:34:29 +01:00
Daniel Robertson
ef779d339e tdf#94389 compilerplugins: clang 3.7.0
Fix errors that occur in build with clang 3.7.0

Change-Id: I0e8743f2b6a288d10b4e78e884ce34cfca4dd77c
Reviewed-on: https://gerrit.libreoffice.org/18738
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-09-21 13:53:47 +00:00
Noel Grandin
3d5dc80b07 fix crash in refcounting plugin
introduced by commit c15b4cf39a74176cee64795129d76f411d2c0a69
"Adapt to current Clang trunk towards 3.7"

Change-Id: I00f58d3bc79e641df9bba4e9b1d5c8463b87dc42
2015-08-04 10:25:48 +02:00
Stephan Bergmann
c15b4cf39a Adapt to current Clang trunk towards 3.7
Change-Id: Ibb2c641d49a1773be789c9259f53a040db6f605f
2015-08-04 09:36:32 +02:00
Noel Grandin
5229726b4d loplugin: add Dialog to unusedvariablecheck
so that we find dialog that have been instantiated but not actually
executed

Change-Id: Ia308e832780627c0a8de71a9d64dabcb3b861a9c
2015-03-17 11:15:28 +02:00
Stephan Bergmann
d8e21f0400 compilerplugins: get rid of std::auto_ptr in comment
Change-Id: Ia2b1bc97f3476da7bfbe659e5160cd5c73c01ce5
2014-09-30 10:33:25 +02:00
Stephan Bergmann
1f078fcadd Prepare dual-mode compiler plugin feature
...which can act as either a rewriter or a non-rewriter that emits warnings.

Also added COMPILER_PLUGIN_WARNINGS_ONLY=X to demote warnings from plugin X from
errors to warnings, even under --enable-werror.

Change-Id: I05361936240a890515c6bba2459565417c1746b7
2014-01-27 13:12:33 +01:00
Caolán McNamara
3656a57e88 add mode lines to new files (and idls) since last run
Change-Id: Id1e74f18c90e69d1a781c8f02e30dc3c005ed4fd
2013-09-22 12:21:34 +01:00
Luboš Luňák
92dfa82d2d adjust for upstreaming of warn_unused attribute
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
2013-07-23 09:52:11 +02:00
Luboš Luňák
e6c20364e7 add const
Change-Id: I71236b9ca6300372ba00c85401cf19f6c0e7ac99
2013-05-02 18:19:59 +02:00
Luboš Luňák
153a69cad2 pass around CompilerInstance rather than ASTContext
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
2013-03-28 18:01:00 +01:00
Luboš Luňák
276953ef21 remove not needed #include
Change-Id: I0fa791733407199db5be2cc9606ac9be1da64188
2013-02-02 22:59:45 +01:00
Luboš Luňák
f5ee30c3ee append [loplugin] automatically in report() rathen than manually everywhere
Change-Id: I2f98622f152ae0c7ac8d1113d6380f686ac7234c
2013-02-02 22:59:45 +01:00
Luboš Luňák
a7c3adb773 avoid having to manuall modify sources when adding a new clang plugin
Now each one registers in its .cxx file.

Change-Id: I811c0d4400c2bdccc1c287269378d7e8ad8743ce
2013-02-02 22:59:44 +01:00
Stephan Bergmann
f995e0f7bb Adapt to current Clang trunk
Change-Id: I0aadc7019934841d6864258695a17503918b6c20
2012-12-05 17:33:47 +01:00
Stephan Bergmann
149858e94e Adapt to Clang 3.2
Change-Id: I9e51867198d7677c26cbd97f5d9c85ac13dc90c5
2012-12-05 15:30:33 +01:00
Luboš Luňák
0349c738da support for compiler rewriters
Change-Id: I12e98ac9fc49ef2007914324006a396d183b778c
2012-10-15 15:40:33 +02:00
Luboš Luňák
41d6a0ea2d some namespacing improvements
Change-Id: I95bd78340519bc1457385561b64c74e938b40bb2
2012-10-15 15:40:33 +02:00
Luboš Luňák
1e313e759b compiler check to compare SAL_WARN/LOG areas against sal/inc/sal/log-areas.dox
Some of the areas are guesses I've added after seeing them, whoever feels reponsible
for whichever part of the code feel free to adjust them.

Change-Id: I2192de84d51cc2bc7c28fa84019d38b465985d15
2012-10-13 17:40:45 +02:00
Luboš Luňák
cd8a490536 compilers don't seem to warn about unused variables in the global scope
And this causes at least some problems with extern variables in headers,
maybe that could be handled, but it probably wouldn't be trivial to
get it exactly right about which location to warn and which ones not.

Change-Id: I8974c9ba9493d09165b026ee7a451238f6d90a30
2012-10-12 16:56:53 +02:00
Luboš Luňák
2acc59ea28 DeclBase::getLocation() gives better location than getLocStart()
It usually points to the declaration name rather than its start.

Change-Id: Idcb068ed88a783c177ae9dc255595afa0a163a7e
2012-10-12 16:56:53 +02:00
Luboš Luňák
d1eee073eb avoid crash on pointers to functions
Clang's dyn_cast<> crashes on NULL, and getParentFunctionOrMethod() is NULL
if the parameter is a part of a pointer-to-function declaration.

Change-Id: Iee9eef488746f9a46bc090df8d318f27ad65f0ef
2012-10-12 13:10:55 +02:00
Luboš Luňák
9c0304f5a7 do not report unnamed parameters as unused
Change-Id: I0cc44354085fbee15aa94d23c29830fd40e8d939
2012-10-12 13:10:55 +02:00
Luboš Luňák
7cd19a8f10 do not analyse system headers in the compiler plugin
Change-Id: Ica1e233b45cc778bfdc86cfd608ada7fc261c6c2
2012-10-09 17:25:28 +02:00
Luboš Luňák
4fc56b9d4c move some code to a common base
Change-Id: Ife306c69054dfcc20b1339b88a4e14e5333ced71
2012-10-09 17:25:28 +02:00
Luboš Luňák
13e39545ea compiler check for unused variables
This is for variables that the compiler itself cannot figure out
(e.g. non-trivial ctors). The classes need to be marked manually.

Change-Id: I0109972e11e20578b1adc32065f701a871ee21aa
2012-10-09 17:25:27 +02:00