ac/llvm: Don't use getTriple() on LLVM21+

setTargetTriple() takes a Triple now.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33981>
This commit is contained in:
Natalie Vock 2025-03-10 16:18:24 +01:00 committed by Marge Bot
parent 1f93dd7d37
commit 0e7c94b2b3

View file

@ -97,7 +97,11 @@ LLVMModuleRef ac_create_module(LLVMTargetMachineRef tm, LLVMContextRef ctx)
TargetMachine *TM = reinterpret_cast<TargetMachine *>(tm);
LLVMModuleRef module = LLVMModuleCreateWithNameInContext("mesa-shader", ctx);
#if LLVM_VERSION_MAJOR >= 21
unwrap(module)->setTargetTriple(TM->getTargetTriple());
#else
unwrap(module)->setTargetTriple(TM->getTargetTriple().getTriple());
#endif
unwrap(module)->setDataLayout(TM->createDataLayout());
return module;
}