2012-10-05 11:17:13 -05:00
|
|
|
Compiler plugins.
|
|
|
|
|
2012-10-15 08:36:25 -05:00
|
|
|
|
2012-10-05 11:17:13 -05:00
|
|
|
== Overview ==
|
|
|
|
|
|
|
|
This directory contains code for compiler plugins. These are used to perform
|
|
|
|
additional actions during compilation (such as additional warnings) and
|
|
|
|
also to perform mass code refactoring.
|
|
|
|
|
2013-01-11 07:55:17 -06:00
|
|
|
Currently only the Clang compiler is supported (http://wiki.documentfoundation.org/Development/Clang).
|
2012-10-05 11:17:13 -05:00
|
|
|
|
2012-10-15 08:36:25 -05:00
|
|
|
|
2012-10-05 11:17:13 -05:00
|
|
|
== Usage ==
|
|
|
|
|
|
|
|
Compiler plugins are enabled automatically by --enable-dbgutil if Clang headers
|
|
|
|
are found or explicitly using --enable-compiler-plugins.
|
|
|
|
|
|
|
|
|
|
|
|
== Functionality ==
|
|
|
|
|
2013-02-02 11:34:12 -06:00
|
|
|
There are two kinds of plugin actions:
|
2012-10-15 08:36:25 -05:00
|
|
|
- compile checks - these are run during normal compilation
|
|
|
|
- rewriters - these must be run manually and modify source files
|
|
|
|
|
2013-02-02 11:34:12 -06:00
|
|
|
Each source has a comment saying whether it's compile check or a rewriter
|
|
|
|
and description of functionality.
|
2012-10-05 11:17:13 -05:00
|
|
|
|
2012-10-15 08:36:25 -05:00
|
|
|
=== Compile checks ===
|
|
|
|
|
|
|
|
Used during normal compilation to perform additional checks.
|
2012-10-05 11:17:13 -05:00
|
|
|
All warnings and errors are marked '[loplugin]' in the message.
|
|
|
|
|
2012-10-15 08:36:25 -05:00
|
|
|
|
|
|
|
=== Rewriters ===
|
|
|
|
|
|
|
|
Rewriters analyse and possibly modify given source files.
|
|
|
|
Usage: make COMPILER_PLUGIN_TOOL=<rewriter_name>
|
2013-02-09 11:47:55 -06:00
|
|
|
Additional optional make arguments:
|
|
|
|
- it is possible to also pass FORCE_COMPILE_ALL=1 to make to trigger rebuild of all source files,
|
|
|
|
even those that are up to date.
|
|
|
|
- UPDATE_FILES=<scope> - limits which modified files will be actually written back with the changes
|
|
|
|
- mainfile - only the main .cxx file will be modifed (default)
|
|
|
|
- all - all source files involved will be modified (possibly even header files from other LO modules),
|
|
|
|
3rd party header files are however never modified
|
|
|
|
- <module> - only files in the given LO module (toplevel directory) will be modified (including headers)
|
|
|
|
|
2013-01-31 07:47:50 -06:00
|
|
|
Modifications will be written directly to the source files.
|
2012-10-15 08:36:25 -05:00
|
|
|
|
2013-02-02 11:34:12 -06:00
|
|
|
|
2012-10-05 11:17:13 -05:00
|
|
|
== Code documentation / howtos ==
|
|
|
|
|
2013-02-02 15:59:17 -06:00
|
|
|
http://wiki.documentfoundation.org/Clang_plugins
|
|
|
|
|