...introduced with
<http://cgit.freedesktop.org/libreoffice/core/commit/?id=cc478960dceea17858ba88067dc3ecf07a07d291>
"salbool: a rewriting plugin that flags most uses of sal_Bool."
If you want to use it to clean up uses of sal_Bool in some module M:
After a full build, do
make $M.clean
cp compilerplugins/clang/store/salbool.cxx compilerplugins/clang/
make -k $M
make -k PARALLELISM=1 COMPILER_PLUGIN_TOOL='literaltoboolconversion salbool' UPDATE_FILES=$M $M
make -k $M
make -k PARALLELISM=1 COMPILER_PLUGIN_TOOL='literaltoboolconversion salbool' UPDATE_FILES=$M $M
...
rm compilerplugins/clang/salbool.cxx
make -k check
make -k COMPILER_PLUGIN_TOOL=literaltoboolconversion check
make -k check
make -k COMPILER_PLUGIN_TOOL=literaltoboolconversion check
...
i.e., first use enough iterations of running the salbool rewriter over
module M to get that module cleaned up. Also use the
literaltoboolconversion rewriter in those runs, to automatically fix
cases like salbool rewrote
sal_Bool b = sal_False;
to
bool b = sal_False;
which literatltoboolconversion on the next run rewrites to
bool b = false;
Use UPDATE_FILES=$M to also do the rewriting in the include files of
module M (requires PARALLELISM=1). Interleave with non-rewriting "make
-k $M" runs, to generate .o files for those .cxx files that have no more
errors (as rewriting runs don't generate .o files, so would needlessly
re-process those .cxx files again and again).
Once the module itself is clean, disable the salbool plugin again and
clean up any problems introduced into dependent modules (like a virtual
function override derived from module M needs to change its return type
from sal_Bool to bool).
Some errors cannot be rewritten, so you need to fix those manually
between runs. But note that salbool will rewrite a function declaration
in an include file only when working on a .cxx file where it also sees a
definition (to avoid some needless temporary compilation errors that
prevent the rewriter from doing its work), and will otherwise flag the
function declaration in the include file as a warning/error, so don't
fix such a case manually but wait for a (subsequent) run to get to the
corresponding .cxx and rewrite the include file automatically.
Modules up to toolkit have already been processed. (See "make
dump-deps-sort" for a rough estimate of "up to.")
Stephan
Context
- Notes on compilerplugins/clang/store/salbool.cxx · Stephan Bergmann
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.