[Libreoffice-commits] core.git: compilerplugins/clang config_host/config_clang.h.in configure.ac
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 9 16:07:50 UTC 2021
compilerplugins/clang/pluginhandler.cxx | 14 +++++++-------
config_host/config_clang.h.in | 2 --
configure.ac | 1 -
3 files changed, 7 insertions(+), 10 deletions(-)
New commits:
commit 28eb086f5d256a1febd7b0f38f9cd77fac574031
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Apr 9 11:57:14 2021 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Fri Apr 9 18:07:03 2021 +0200
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 at collabora.com>
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
More information about the Libreoffice-commits
mailing list