fix(FTBFS): clc: switch to new non-owned TargetOptions for LLVM 21

Upstream hid the `TargetOptions` in commit 985410f87f2d19910a8d327527fd30062b042b63

Use the new `getTargetOpts()` to obtain the `TargetOptions` for
`setTarget()`.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13079
Reference: https://github.com/llvm/llvm-project/commit/985410f87f2d19910a8d327527fd30062b042b63
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34835>
This commit is contained in:
Kai Wasserbäch
2025-05-06 14:36:57 +02:00
committed by Marge Bot
parent 04bbe45b76
commit 531c6696d4
+4
View File
@@ -864,7 +864,11 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx,
&c->getDiagnosticOpts()));
c->setTarget(clang::TargetInfo::CreateTargetInfo(
#if LLVM_VERSION_MAJOR >= 21
c->getDiagnostics(), c->getInvocation().getTargetOpts()));
#else
c->getDiagnostics(), c->getInvocation().TargetOpts));
#endif
c->getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;