From 32c31c03d07219522426fe83d8b17d03ee0154a1 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 8 Dec 2017 16:31:34 +0100 Subject: 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 Reviewed-by: Stephan Bergmann --- compilerplugins/clang/pluginhandler.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compilerplugins/clang/pluginhandler.cxx') diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index ff1c6b6922cb..1740a5d05486 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -113,6 +113,8 @@ void PluginHandler::handleOption( const std::string& option ) warningsAsErrors = true; else if( option == "unit-test-mode" ) unitTestMode = true; + else if (option == "debug") + debugMode = true; else report( DiagnosticsEngine::Fatal, "unknown option %0" ) << option; } -- cgit