From 0349c738da5970d9f0fc10d7cf4d7b766ce10e13 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Mon, 15 Oct 2012 15:36:25 +0200 Subject: support for compiler rewriters Change-Id: I12e98ac9fc49ef2007914324006a396d183b778c --- compilerplugins/README | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'compilerplugins/README') 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= +Modifications will be written to files .new . + == Code documentation / howtos == TBD -- cgit