Skip to content

Commit 1a39f0e

Browse files
authored
Rollup merge of rust-lang#140534 - erickt:llvm-21, r=cuviper
PassWrapper: adapt for llvm/llvm-project@f137c3d592e96330e450a8fd63ef… …7e8877fc1908 In LLVM 21 PR llvm/llvm-project#130940 `TargetRegistry::createTargetMachine` was changed to take a `const Triple&` and has deprecated the old `StringRef` method. `@rustbot` label llvm-main
2 parents 0cb4090 + 951412e commit 1a39f0e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,13 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
512512
#endif
513513
}
514514

515+
#if LLVM_VERSION_GE(21, 0)
516+
TargetMachine *TM = TheTarget->createTargetMachine(Trip, CPU, Feature,
517+
Options, RM, CM, OptLevel);
518+
#else
515519
TargetMachine *TM = TheTarget->createTargetMachine(
516520
Trip.getTriple(), CPU, Feature, Options, RM, CM, OptLevel);
521+
#endif
517522
return wrap(TM);
518523
}
519524

0 commit comments

Comments
 (0)