65 Commits

Author SHA1 Message Date
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
2c3759735f print something when compiling clang plugin too
Change-Id: Ia312533381260a7c506dfd75b9f88c74a8329958
2012-10-12 13:12:05 +02:00
Luboš Luňák
f56da8c967 rebuild clang plugin when clang changes
Change-Id: Ia4192224d0b217ba2393dc457250cf12febe9306
2012-10-12 13:12:04 +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
06fb559a4b note about (not) linking llvm/clang libraries
Change-Id: I628e3b99b69d238abc9df3e62e77b30eb85f1a0d
2012-10-09 23:31:39 +02:00
Luboš Luňák
7c4d3ea6ba don't check next statement after if body if there's also an else part
Change-Id: I04265acd821187f529562691f35ede93b84368fa
2012-10-09 17:25:28 +02:00
Luboš Luňák
4d3c6a0499 ignore macro expansion completely for now
Change-Id: Ie37b83fef1279a0a953de27941e3b342437c81d1
2012-10-09 17:25:28 +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
4d05099806 do not force compiler plugin warnings to errors with -Werror, for now
Change-Id: I87585fce44e803513d5345709d9723075b9429a1
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
d4aa136e97 compiler plugin check for if/while/true bodies with possibly {} missing
Change-Id: Ia84c70006b0b8a039b6fea27f3c5cde796f25d03
2012-10-09 17:25:27 +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
Luboš Luňák
02a8d36ebf initial support for clang compiler plugins
The plugin is intentionally built using a custom Makefile,
because it's used by gbuild, so I don't want to build the plugin
using gbuild too. It is also intentionally not placed under workdir/,
as that is cleaned by 'make clean', the plugin is cleaned only
by 'make distclean', so that cleaning it doesn't cause ccache misses.
No actual functionality in the plugin itself yet.

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