diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-12-08 16:31:34 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-12-08 21:09:39 +0100 |
commit | 32c31c03d07219522426fe83d8b17d03ee0154a1 (patch) | |
tree | 42f7de5211b51611c83dc1a3602e2f1e7cbb8049 /solenv | |
parent | 39854837073158555ee26bee9254d1e5ac36a215 (diff) |
New --enable-compiler-plugins=debug mode
...to enable debug-only code in the plugins. Some situations in the plugin code
should never happen, yet must not by default report errors or trigger
assertions, as some newly written LO code could trigger them nevertheless (in
which case the plugin code will likely need to be adapted, to cater for these
presumed-impossible situations).
Such code can now be included in the plugins behind an if(isDebugMode()) guard,
and can explicitly be enabled with --enable-compiler-plugins=debug.
I deliberately made this a runtime rather than a compile time option (using
some #ifdef guards in the plugin code, say), as it IMO keeps the code more
readable, and also allows overridding COMPILER_PLUGINS_DEBUG=... on the make
command line.
Change-Id: Iea4f0c2783ad968a0de097fa710b3be1a248de73
Reviewed-on: https://gerrit.libreoffice.org/46096
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/platform/com_GCC_defs.mk | 3 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_defs.mk | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index 11b7871a3e6f..e1082c952528 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -210,6 +210,9 @@ ifneq ($(UPDATE_FILES),) gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang --scope=$(UPDATE_FILES) endif endif +ifeq ($(COMPILER_PLUGINS_DEBUG),TRUE) +gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang --debug +endif # set CCACHE_CPP2=1 to prevent clang generating spurious warnings gb_COMPILER_SETUP := CCACHE_CPP2=1 gb_COMPILER_PLUGINS_SETUP := ICECC_EXTRAFILES=$(SRCDIR)/include/sal/log-areas.dox CCACHE_EXTRAFILES=$(SRCDIR)/include/sal/log-areas.dox diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index 2925315da324..507264e1db89 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -316,6 +316,9 @@ ifneq ($(UPDATE_FILES),) gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang --scope=$(UPDATE_FILES) endif endif +ifeq ($(COMPILER_PLUGINS_DEBUG),TRUE) +gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang --debug +endif gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS := \ -Xclang -plugin-arg-loplugin -Xclang --warnings-as-errors else |