22 Commits

Author SHA1 Message Date
Luboš Luňák
a0da672521 ignore already seen locations in compiler plugins
Change-Id: Icba8dfa61aee7237af569b2414b1cf4ce93ca476
2013-05-06 16:49:36 +02:00
Luboš Luňák
6f16cfb5a6 Fix handling range in removeText().
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
2013-05-06 16:49:36 +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
b4392c575e always use the report() helper
Change-Id: I2966fdb5bd98b1ddf718079584acf90a3e3a3700
2013-02-02 22:59:45 +01:00
Luboš Luňák
a1c61eb112 move documentation of plugins to the .cxx files
It's mostly there already anyway, no need to duplicate it.

Change-Id: I5b066f90725a064fb0746e1411900e835e3f66c3
2013-02-02 22:59:44 +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
Luboš Luňák
b8f932b6a5 move plugin handling to separate source files
Change-Id: Ifa1af34121bda9ca3250d09a3b8a46ea226795ed
2013-02-02 22:59:44 +01:00
Luboš Luňák
d9a5c6bdf0 fix detection whether to ignore a source file or not
When compiling using icecream, the whole input is one file fed from stdin,
so getBufferName() is "<stdin>", so get the filename from #line directives.

Change-Id: Ie87937b10b0c7e8ddfa57a405b80fd9bde68dd0a
2013-01-11 14:58:58 +01:00
Luboš Luňák
62532ad485 do not set our clang timestamp to the timestamp of the clang binary
If the clang binary comes from a package which had been built before
any of our clang related sources were changed the last time, the timestamp
would be older and so there would be no rebuild. So do the stamp handling
the usual way, clang upgrades will work fine, downgrades will not, but
that's the same problem like with downgrading a library and its headers.

To somewhat mitigate the problem (Clang plugin doesn't get cleaned by
'make clean'), include the full Clang version (which includes SVN revision)
in config_clang.h and make all Clang plugin code include that, so
at least configure re-run will trigger a rebuild if necessary.

Change-Id: I993197f79e92e36105092c92c33b2e1db343e975
2013-01-06 18:23:04 +01:00
Luboš Luňák
428a815fbc I hate arbitrary integer types
Change-Id: I4c8edfc0ee0390d595c43e384bf6e5f595a7b84f
2013-01-05 22:20:40 +01:00
Luboš Luňák
d5ea81b87b handle case of SRCDIR == BUILDDIR
Change-Id: I9daea65dc28ab13776a7c4319e5d5811515fe160
2013-01-04 15:28:00 +01:00
Luboš Luňák
258aca9924 rewriter plugin for removing forward rtl string declarations
Change-Id: I12bf38985ae62756973c05aacf762ae3c405ac9b
2013-01-04 15:27:29 +01:00
Luboš Luňák
c26e655264 support for removing a statement as a whole
Change-Id: Icb7b017a0c76a6169f0f629bb40bf97449c75837
2013-01-04 15:27:26 +01:00
Luboš Luňák
217e3f2ea1 better handling of which files are processed by clang plugins
Check that only LO's files are processed, as there's no point otherwise.
Also warn about files in workdir/solver/builddir, as those are either
generated or copies. Try to automatically match include files from
solver to srcdir though, as that's where include files are usually
included from :(.

Change-Id: Ie8389e903f623a9d0e75015091acc0da78e76c3a
2013-01-04 15:27:24 +01:00
Lubos Lunak
6ede7ad593 fix build 2012-12-26 15:43:38 +01:00
Lubos Lunak
8b727538e8 better error handling when writing modified source 2012-12-26 13:56:45 +01:00
Stephan Bergmann
149858e94e Adapt to Clang 3.2
Change-Id: I9e51867198d7677c26cbd97f5d9c85ac13dc90c5
2012-12-05 15:30:33 +01:00
Luboš Luňák
dc3aa430f9 rewriter for postfix->prefix operator++
Change-Id: I59a7490ec76b10fd31033d1ceccd1e3eae0ad398
2012-10-15 23:33:08 +02:00
Luboš Luňák
2e3642e66b convenience functions for source rewriters
Change-Id: I36e2b49bc615db0b12b03ffa755fa51acc6830a0
2012-10-15 23:33:07 +02:00
Luboš Luňák
0349c738da support for compiler rewriters
Change-Id: I12e98ac9fc49ef2007914324006a396d183b778c
2012-10-15 15:40:33 +02:00