summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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