fix: gallivm: fix LLVM #include of Host.h, moved to TargetParser
authorKai Wasserbäch <kai@dev.carbon-project.org>
Sat, 11 Feb 2023 17:38:01 +0000 (18:38 +0100)
committerMarge Bot <emma+marge@anholt.net>
Sun, 12 Mar 2023 14:02:23 +0000 (14:02 +0000)
Upstream moved Host.h from Support to TargetParser in LLVM 17.

This shouldn't lead to a FTBFS, since there is a forwarding include left
behind. Sadly the added deprecation warning #pragma is invalid and thus
causes a build failure right away. But since we would have to follow the
move anyway in the future, just do it right away.

Reference: https://github.com/llvm/llvm-project/commit/d768bf994f508d7eaf9541a568be3d71096febf5
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Closes: #8275
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21263>

src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp

index 54bc5d5..f78f04f 100644 (file)
 #include <llvm-c/Disassembler.h>
 #include <llvm/Support/raw_ostream.h>
 #include <llvm/Support/Format.h>
-#include <llvm/Support/Host.h>
 #include <llvm/IR/Module.h>
 
+#if LLVM_VERSION_MAJOR >= 17
+#include <llvm/TargetParser/Host.h>
+#else
+#include <llvm/Support/Host.h>
+#endif
+
 #include "util/u_math.h"
 #include "util/u_debug.h"
 
index 334c135..5e7a30a 100644 (file)
 #include <llvm/Analysis/TargetLibraryInfo.h>
 #include <llvm/ExecutionEngine/SectionMemoryManager.h>
 #include <llvm/Support/CommandLine.h>
-#include <llvm/Support/Host.h>
 #include <llvm/Support/PrettyStackTrace.h>
 #include <llvm/ExecutionEngine/ObjectCache.h>
 #include <llvm/Support/TargetSelect.h>
 #if LLVM_VERSION_MAJOR >= 15
 #include <llvm/Support/MemoryBuffer.h>
 #endif
+
 #if LLVM_VERSION_MAJOR >= 17
+#include <llvm/TargetParser/Host.h>
 #include <llvm/TargetParser/Triple.h>
 #else
+#include <llvm/Support/Host.h>
 #include <llvm/ADT/Triple.h>
 #endif