summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-04-09 11:57:14 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-04-09 18:07:03 +0200
commit28eb086f5d256a1febd7b0f38f9cd77fac574031 (patch)
treeca589dd445e9ffd8e5d3427e0bcc6da793ed1cd1
parentandroid: Check result for CREATE_NEW_DOCUMENT Intent (diff)
downloadcore-28eb086f5d256a1febd7b0f38f9cd77fac574031.tar.gz
core-28eb086f5d256a1febd7b0f38f9cd77fac574031.zip
do not #error in clangplugins with --disable-pch
I missed that -building-pch-with-obj is checked by configure (and used) only if PCHs are used. So remove the error checking and hope that it gets checked whenever somebody does changes related to the flag. Change-Id: Ibdf991169f023dae48dad0dd2929215fb048d57d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113841 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--compilerplugins/clang/pluginhandler.cxx14
-rw-r--r--config_host/config_clang.h.in2
-rw-r--r--configure.ac1
3 files changed, 7 insertions, 10 deletions
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx
index 622caf917b8e..315062969b25 100644
--- a/compilerplugins/clang/pluginhandler.cxx
+++ b/compilerplugins/clang/pluginhandler.cxx
@@ -231,18 +231,18 @@ bool PluginHandler::ignoreLocation(SourceLocation loc) {
bool PluginHandler::checkIgnoreLocation(SourceLocation loc)
{
-#if HAVE_BUILDING_PCH_WITH_OBJ
- // If we're building a separate precompiled_foo.cxx file
- // for a PCH, then it is not necessary to check contents of everything
- // included by the PCH in every compilation, check only once for that
- // precompiled_foo.cxx file.
+#if CLANG_VERSION >= 80000
+ // If a location comes from a PCH, it is not necessary to check it
+ // in every compilation using the PCH, since with Clang we use
+ // -building-pch-with-obj to build a separate precompiled_foo.cxx file
+ // for the PCH, and so it is known that everything in the PCH will
+ // be checked while compiling this file. Skip the checks for all
+ // other files using the PCH.
if( !compiler.getSourceManager().isLocalSourceLocation( loc ))
{
if( !compiler.getLangOpts().BuildingPCHWithObjectFile )
return true;
}
-#elif CLANG_VERSION >= 110000
-#error Internal error, -building-pch-with-obj support not detected in Clang.
#endif
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( loc );
if( compiler.getSourceManager().isInSystemHeader( expansionLoc ))
diff --git a/config_host/config_clang.h.in b/config_host/config_clang.h.in
index e588c86cf0ed..c19c0875ce86 100644
--- a/config_host/config_clang.h.in
+++ b/config_host/config_clang.h.in
@@ -17,6 +17,4 @@ Settings related to Clang compiler plugins.
thus causing update of this .h file and triggering rebuild of our Clang plugin. */
#undef CLANG_FULL_VERSION
-#define HAVE_BUILDING_PCH_WITH_OBJ 0
-
#endif
diff --git a/configure.ac b/configure.ac
index cfc63ed6b6f5..3a03dd38290f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5779,7 +5779,6 @@ if test -n "$ENABLE_PCH"; then
CFLAGS=$save_CFLAGS
if test -n "$BUILDING_PCH_WITH_OBJ"; then
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_BUILDING_PCH_WITH_OBJ)
else
AC_MSG_RESULT(no)
fi