clc: use new createTargetMachine overload with llvm-21
The old one is deprecated, so let's move and silence the warning. Cc: mesa-stable Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35399>
This commit is contained in:
@@ -60,6 +60,10 @@
|
||||
#include <spirv-tools/linker.hpp>
|
||||
#include <spirv-tools/optimizer.hpp>
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 16
|
||||
#include <llvm/TargetParser/Triple.h>
|
||||
#endif
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 20
|
||||
#include <llvm/Support/VirtualFileSystem.h>
|
||||
#endif
|
||||
@@ -1139,7 +1143,12 @@ llvm_mod_to_spirv(std::unique_ptr<::llvm::Module> mod,
|
||||
auto target = TargetRegistry::lookupTarget(triple, error_msg);
|
||||
if (target) {
|
||||
auto TM = target->createTargetMachine(
|
||||
triple, "", "", {}, std::nullopt, std::nullopt,
|
||||
#if LLVM_VERSION_MAJOR >= 21
|
||||
llvm::Triple(triple),
|
||||
#else
|
||||
triple,
|
||||
#endif
|
||||
"", "", {}, std::nullopt, std::nullopt,
|
||||
#if LLVM_VERSION_MAJOR >= 18
|
||||
::llvm::CodeGenOptLevel::None
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user