interface: update to move of llvm/Support/Host.h to llvm/TargetParser/Host.h
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 12 Feb 2023 10:03:48 +0000 (12 11:03 +0100)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 12 Feb 2023 20:57:34 +0000 (12 21:57 +0100)
The header llvm/Support/Host.h was moved to llvm/TargetParser/Host.h
in LLVM commit llvmorg-16-init-15123-gf09cf34d0062 ([Support]
Move TargetParsers to new component, Tue Dec 20 10:24:02 2022 +0000),
leaving in a forwarding header and this forwarding header was deprecated
in LLVM commit llvmorg-17-init-1742-gd768bf994f50 ([NFC][TargetParser]
Replace uses of llvm/Support/Host.h, Fri Feb 10 09:59:46 2023 +0000).

Reported-by: Sam Elliott <Archibald.Elliott@arm.com>
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
interface/extract_interface.cc
m4/ax_detect_clang.m4

index b94847c..aebb049 100644 (file)
 #endif
 #include <llvm/Support/raw_ostream.h>
 #include <llvm/Support/CommandLine.h>
+#ifdef HAVE_TARGETPARSER_HOST_H
+#include <llvm/TargetParser/Host.h>
+#else
 #include <llvm/Support/Host.h>
+#endif
 #include <llvm/Support/ManagedStatic.h>
 #include <clang/AST/ASTContext.h>
 #include <clang/AST/ASTConsumer.h>
index c1ea32a..1c305ad 100644 (file)
@@ -78,9 +78,13 @@ SAVE_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CLANG_CXXFLAGS -I$srcdir $CPPFLAGS"
 AC_CHECK_HEADER([clang/Basic/SourceLocation.h], [],
        [AC_MSG_ERROR([clang header file not found])])
-AC_EGREP_HEADER([getDefaultTargetTriple], [llvm/Support/Host.h], [],
-       [AC_DEFINE([getDefaultTargetTriple], [getHostTriple],
-       [Define to getHostTriple for older versions of clang])])
+AC_CHECK_HEADER([llvm/TargetParser/Host.h],
+       [AC_DEFINE([HAVE_TARGETPARSER_HOST_H], [],
+                  [Define if llvm/TargetParser/Host.h exists])],
+       [AC_EGREP_HEADER([getDefaultTargetTriple], [llvm/Support/Host.h], [],
+               [AC_DEFINE([getDefaultTargetTriple], [getHostTriple],
+               [Define to getHostTriple for older versions of clang])])
+       ])
 AC_EGREP_HEADER([getExpansionLineNumber], [clang/Basic/SourceLocation.h], [],
        [AC_DEFINE([getExpansionLineNumber], [getInstantiationLineNumber],
        [Define to getInstantiationLineNumber for older versions of clang])])