PassWrapper: adapt for llvm/llvm-project@f137c3d592
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:
@@ -512,8 +512,13 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if LLVM_VERSION_GE(21, 0)
|
||||||
|
TargetMachine *TM = TheTarget->createTargetMachine(Trip, CPU, Feature,
|
||||||
|
Options, RM, CM, OptLevel);
|
||||||
|
#else
|
||||||
TargetMachine *TM = TheTarget->createTargetMachine(
|
TargetMachine *TM = TheTarget->createTargetMachine(
|
||||||
Trip.getTriple(), CPU, Feature, Options, RM, CM, OptLevel);
|
Trip.getTriple(), CPU, Feature, Options, RM, CM, OptLevel);
|
||||||
|
#endif
|
||||||
return wrap(TM);
|
return wrap(TM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user