diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-10-15 15:36:25 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-10-15 15:40:33 +0200 |
commit | 0349c738da5970d9f0fc10d7cf4d7b766ce10e13 (patch) | |
tree | 572fa7304614ae5cac51938d45823114655e145e /compilerplugins/README | |
parent | 41d6a0ea2d2d3c8daa758771bf956036d84cbe1a (diff) |
support for compiler rewriters
Change-Id: I12e98ac9fc49ef2007914324006a396d183b778c
Diffstat (limited to 'compilerplugins/README')
-rw-r--r-- | compilerplugins/README | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/compilerplugins/README b/compilerplugins/README index 2344efbf0f76..1261a34b1487 100644 --- a/compilerplugins/README +++ b/compilerplugins/README @@ -1,5 +1,6 @@ Compiler plugins. + == Overview == This directory contains code for compiler plugins. These are used to perform @@ -8,6 +9,7 @@ also to perform mass code refactoring. Currently only the Clang compiler is supported (http://clang.llvm.org). + == Usage == Compiler plugins are enabled automatically by --enable-dbgutil if Clang headers @@ -16,11 +18,17 @@ are found or explicitly using --enable-compiler-plugins. == Functionality == -=== Compile plugin === +There are two kinds of modules: +- compile checks - these are run during normal compilation +- rewriters - these must be run manually and modify source files + -The compile plugin is used during normal compilation to perform additional checks. +=== Compile checks === + +Used during normal compilation to perform additional checks. All warnings and errors are marked '[loplugin]' in the message. + ==== Unused variable check ==== - unused parameter 'foo' [loplugin] @@ -28,6 +36,7 @@ All warnings and errors are marked '[loplugin]' in the message. Additional check for unused variables. + ==== Body of if/while/for not in {} ==== - statement aligned as second statement in if/while/for body but not in a statement block [loplugin] @@ -40,6 +49,7 @@ Warn about the following construct: Here either both statements should be inside {} or the second statement in indented wrong. + ==== Sal log areas ==== - unknown log area 'foo' (check or extend sal/inc/sal/log-areas.dox) [loplugin] @@ -49,6 +59,12 @@ report if the area is not listed there. The fix is either use a proper area or a if appropriate. +=== Rewriters === + +Rewriters analyse and possibly modify given source files. +Usage: make COMPILER_PLUGIN_TOOL=<rewriter_name> +Modifications will be written to files <source_file>.new . + == Code documentation / howtos == TBD |