Updated core
[LibreOffice.git] / compilerplugins / README
bloba9881c7f35994056e2f5fcc3e85bb71e1d9ffcf3
1 Compiler plugins.
4 == Overview ==
6 This directory contains code for compiler plugins. These are used to perform
7 additional actions during compilation (such as additional warnings) and
8 also to perform mass code refactoring.
10 Currently only the Clang compiler is supported (http://wiki.documentfoundation.org/Development/Clang).
13 == Usage ==
15 Compiler plugins are enabled automatically by --enable-dbgutil if Clang headers
16 are found or explicitly using --enable-compiler-plugins.
19 == Functionality ==
21 There are two kinds of plugin actions:
22 - compile checks - these are run during normal compilation
23 - rewriters - these must be run manually and modify source files
25 Each source has a comment saying whether it's compile check or a rewriter
26 and description of functionality.
28 === Compile checks ===
30 Used during normal compilation to perform additional checks.
31 All warnings and errors are marked '[loplugin]' in the message.
34 === Rewriters ===
36 Rewriters analyse and possibly modify given source files.
37 Usage: make COMPILER_PLUGIN_TOOL=<rewriter_name>
38 Additional optional make arguments:
39 - it is possible to also pass FORCE_COMPILE_ALL=1 to make to trigger rebuild of all source files,
40     even those that are up to date.
41 - UPDATE_FILES=<scope> - limits which modified files will be actually written back with the changes
42     - mainfile - only the main .cxx file will be modifed (default)
43     - all - all source files involved will be modified (possibly even header files from other LO modules),
44         3rd party header files are however never modified
45     - <module> - only files in the given LO module (toplevel directory) will be modified (including headers)
47 Modifications will be written directly to the source files.
50 == Code documentation / howtos ==
52 http://wiki.documentfoundation.org/Clang_plugins