summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/plugin.cxx
AgeCommit message (Collapse)Author
2016-01-11update unusedmethods loplugin to update unused return valuesNoel Grandin
Change-Id: I825d022d09282bc9b6cffd9178e40e4090d335da
2015-11-02tdf#94269: Replace "n" prefix for bool variables with "b"Benjamin Ni
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797 Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-06-22Add variadic PartialWeakComponentImplHelper, remove need for implbase_var.hxxStephan Bergmann
Change-Id: Iad3417822b2ab3afb75da09c311a0bf07af5e2e4
2015-06-22Fix for BUILDDIR != SRCDIRStephan Bergmann
Change-Id: I3ea2a0a6d8f54afcc1959b54c36f90bb849995b4
2014-06-24compilerplugins: move isUnoIncludeFile to base classNoel Grandin
to reduce copy-pasted code Change-Id: I7728d85dea7d0161998c326d6648ca681a8250d0
2014-02-27Remove visual noise from compilerpluginsAlexander Wilms
Change-Id: Ibfed0b64bd60804fa377b5e25e5f197a7772d605 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-02-21ParentBuilder needs support for ObjCMethodDeclStephan Bergmann
Change-Id: I8883649da31eabbc5a0f9780fb953ad58f154e1e
2014-02-20Don't attempt to actually do double code removalsStephan Bergmann
...that easily works around the problem that in a rewriter rewriting types of VarDecls like T x, y; it would try to replace T twice. Also, keep the list of removals globally with the (global) rewriter. Change-Id: I55b8d11986c2a29e09ff40132fd114a0cc48dc90
2014-02-14const improvementStephan Bergmann
Change-Id: I03815f33117a2927b1882d221f159a5de8d3ba78
2014-01-27Prepare dual-mode compiler plugin featureStephan Bergmann
...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-10compilerplugins: ignore WORKDIR codeStephan Bergmann
...which is typically external or generated code and causes warnings that we cannot easily fix. Change-Id: If86ecd96c069ec23c6b3d7f5c32bf962397393e5
2013-10-31solver doesn't solve anything...Michael Stahl
... it is an abbreviation of "Solar Version". Since nobody can remember that: remove OUTDIR OUTDIR_FOR_BUILD SOLARVER SOLARVERSION solarpath and any mention thereof. Change-Id: Idb3031c4f25a76ac05b22ec67e3ca3e1e8e512ad Reviewed-on: https://gerrit.libreoffice.org/6515 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2013-09-22add mode lines to new files (and idls) since last runCaolán McNamara
Change-Id: Id1e74f18c90e69d1a781c8f02e30dc3c005ed4fd
2013-08-21warn when rewriter should modify something involving a macroLuboš Luňák
Apparently Clang rewriter API doesn't properly bail out if the range given is not inside one file, so check explicitly. Change-Id: I27be6d396a131d385231e9c0dfa8c84d9fa15ccc
2013-08-21helper for getting location after current tokenLuboš Luňák
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
2013-08-21update/rework the Rewriter wrapper functionsLuboš Luňák
Some improvements, like making it simple to actually remove a statement or a token including its associated whitespace. Change-Id: I02a5bd919f1fadae1dcd45a76f9d25df353ac518
2013-08-06error: cannot use dynamic_cast with -fno-rttiStephan Bergmann
...with recent Clang trunk towards 3.4 Change-Id: Ie0991c7bd560c30551aeaada426382a889b46391
2013-07-15fix finding all parents for AST nodesLuboš Luňák
Ctor bodies can also have code inside of member variables initialization, which is not considered to be inside function body. Change-Id: Id68960093a51396b9486f1364b1a361526c3431d
2013-06-20make it easy to get a parent of an AST nodeLuboš Luňák
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
2013-05-31make compiler plugin warnings follow WaELuboš Luňák
Change-Id: I72f1a11ce86d66e773e66116c725310df77fce39
2013-05-06check for double modifications in compiler pluginsLuboš Luňák
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
2013-05-06Revert "ignore already seen locations in compiler plugins"Luboš Luňák
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.
2013-05-06ignore already seen locations in compiler pluginsLuboš Luňák
Change-Id: Icba8dfa61aee7237af569b2414b1cf4ce93ca476
2013-05-06Fix handling range in removeText().Luboš Luňák
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-03-28pass around CompilerInstance rather than ASTContextLuboš Luňák
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-02-02remove not needed #includeLuboš Luňák
Change-Id: I0fa791733407199db5be2cc9606ac9be1da64188
2013-02-02append [loplugin] automatically in report() rathen than manually everywhereLuboš Luňák
Change-Id: I2f98622f152ae0c7ac8d1113d6380f686ac7234c
2013-02-02always use the report() helperLuboš Luňák
Change-Id: I2966fdb5bd98b1ddf718079584acf90a3e3a3700
2013-02-02move documentation of plugins to the .cxx filesLuboš Luňák
It's mostly there already anyway, no need to duplicate it. Change-Id: I5b066f90725a064fb0746e1411900e835e3f66c3
2013-02-02avoid having to manuall modify sources when adding a new clang pluginLuboš Luňák
Now each one registers in its .cxx file. Change-Id: I811c0d4400c2bdccc1c287269378d7e8ad8743ce
2013-02-02move plugin handling to separate source filesLuboš Luňák
Change-Id: Ifa1af34121bda9ca3250d09a3b8a46ea226795ed
2013-01-11fix detection whether to ignore a source file or notLuboš Luňák
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-06do not set our clang timestamp to the timestamp of the clang binaryLuboš Luňák
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-05I hate arbitrary integer typesLuboš Luňák
Change-Id: I4c8edfc0ee0390d595c43e384bf6e5f595a7b84f
2013-01-04handle case of SRCDIR == BUILDDIRLuboš Luňák
Change-Id: I9daea65dc28ab13776a7c4319e5d5811515fe160
2013-01-04rewriter plugin for removing forward rtl string declarationsLuboš Luňák
Change-Id: I12bf38985ae62756973c05aacf762ae3c405ac9b
2013-01-04support for removing a statement as a wholeLuboš Luňák
Change-Id: Icb7b017a0c76a6169f0f629bb40bf97449c75837
2013-01-04better handling of which files are processed by clang pluginsLuboš Luňák
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
2012-12-26fix buildLubos Lunak
2012-12-26better error handling when writing modified sourceLubos Lunak
2012-12-05Adapt to Clang 3.2Stephan Bergmann
Change-Id: I9e51867198d7677c26cbd97f5d9c85ac13dc90c5
2012-10-15rewriter for postfix->prefix operator++Luboš Luňák
Change-Id: I59a7490ec76b10fd31033d1ceccd1e3eae0ad398
2012-10-15convenience functions for source rewritersLuboš Luňák
Change-Id: I36e2b49bc615db0b12b03ffa755fa51acc6830a0
2012-10-15support for compiler rewritersLuboš Luňák
Change-Id: I12e98ac9fc49ef2007914324006a396d183b778c