From 4e4bed8684a7144c82ea95aa013e7911dd9fe20d Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 6 Mar 2025 16:24:40 -0800 Subject: setTargetTriple now accepts Triple rather than string --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_llvm/llvm-wrapper') diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index aea2a8dd097..6d01095ccca 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -153,7 +153,11 @@ extern "C" LLVMContextRef LLVMRustContextCreate(bool shouldDiscardNames) { extern "C" void LLVMRustSetNormalizedTarget(LLVMModuleRef M, const char *Triple) { +#if LLVM_VERSION_GE(21, 0) + unwrap(M)->setTargetTriple(llvm::Triple(Triple::normalize(Triple))); +#else unwrap(M)->setTargetTriple(Triple::normalize(Triple)); +#endif } extern "C" void LLVMRustPrintPassTimings(RustStringRef OutBuf) { -- cgit 1.4.1-3-g733a5