diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp index cbf46ce7aa4..2920f7325ed 100644 --- a/src/compiler/clc/clc_helpers.cpp +++ b/src/compiler/clc/clc_helpers.cpp @@ -60,6 +60,10 @@ #include #include +#if LLVM_VERSION_MAJOR >= 16 +#include +#endif + #if LLVM_VERSION_MAJOR >= 20 #include #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