Rollup merge of #140534 - erickt:llvm-21, r=cuviper
PassWrapper: adapt for llvm/llvm-project@f137c3d592e96330e450a8fd63ef… …7e8877fc1908 In LLVM 21 PR https://github.com/llvm/llvm-project/pull/130940 `TargetRegistry::createTargetMachine` was changed to take a `const Triple&` and has deprecated the old `StringRef` method. ``@rustbot`` label llvm-main
This commit is contained in:
commit
9ff7455551
1 changed files with 5 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue