about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2025-05-10 05:01:09 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2025-05-10 05:01:09 +0000
commita4f765dcada7c37abfc3beda66b7823736b58ea6 (patch)
treeb815913f2d6c42de19b550fd5f5941555789ab08 /compiler/rustc_llvm/llvm-wrapper
parent6e5d6473aaa21d6fae3eb7afdacdfaf93391bfc7 (diff)
parent35679bad981e1551138a8b367c0571b0a5928a27 (diff)
downloadrust-a4f765dcada7c37abfc3beda66b7823736b58ea6.tar.gz
rust-a4f765dcada7c37abfc3beda66b7823736b58ea6.zip
Merge from rustc
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index ebe8eb57f2c..d4a05fbbbc5 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -512,8 +512,13 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
 #endif
   }
 
+#if LLVM_VERSION_GE(21, 0)
+  TargetMachine *TM = TheTarget->createTargetMachine(Trip, CPU, Feature,
+                                                     Options, RM, CM, OptLevel);
+#else
   TargetMachine *TM = TheTarget->createTargetMachine(
       Trip.getTriple(), CPU, Feature, Options, RM, CM, OptLevel);
+#endif
   return wrap(TM);
 }