Rollup merge of #131552 - durin42:llvm-20-getOrInsertDeclaration, r=cuviper
RustWrapper: adapt for rename of Intrinsic::getDeclaration llvm/llvm-project@fa789dffb1 renamed getDeclaration to getOrInsertDeclaration. `@rustbot` label: +llvm-main
This commit is contained in:
commit
6f76d6e1a3
@ -1533,27 +1533,40 @@ extern "C" LLVMValueRef LLVMRustBuildCall(LLVMBuilderRef B, LLVMTypeRef Ty,
|
|||||||
|
|
||||||
extern "C" LLVMValueRef
|
extern "C" LLVMValueRef
|
||||||
LLVMRustGetInstrProfIncrementIntrinsic(LLVMModuleRef M) {
|
LLVMRustGetInstrProfIncrementIntrinsic(LLVMModuleRef M) {
|
||||||
|
#if LLVM_VERSION_GE(20, 0)
|
||||||
|
return wrap(llvm::Intrinsic::getOrInsertDeclaration(
|
||||||
|
unwrap(M), llvm::Intrinsic::instrprof_increment));
|
||||||
|
#else
|
||||||
return wrap(llvm::Intrinsic::getDeclaration(
|
return wrap(llvm::Intrinsic::getDeclaration(
|
||||||
unwrap(M), llvm::Intrinsic::instrprof_increment));
|
unwrap(M), llvm::Intrinsic::instrprof_increment));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMValueRef
|
extern "C" LLVMValueRef
|
||||||
LLVMRustGetInstrProfMCDCParametersIntrinsic(LLVMModuleRef M) {
|
LLVMRustGetInstrProfMCDCParametersIntrinsic(LLVMModuleRef M) {
|
||||||
#if LLVM_VERSION_GE(19, 0)
|
#if LLVM_VERSION_LT(19, 0)
|
||||||
return wrap(llvm::Intrinsic::getDeclaration(
|
report_fatal_error("LLVM 19.0 is required for mcdc intrinsic functions");
|
||||||
|
#endif
|
||||||
|
#if LLVM_VERSION_GE(20, 0)
|
||||||
|
return wrap(llvm::Intrinsic::getOrInsertDeclaration(
|
||||||
unwrap(M), llvm::Intrinsic::instrprof_mcdc_parameters));
|
unwrap(M), llvm::Intrinsic::instrprof_mcdc_parameters));
|
||||||
#else
|
#else
|
||||||
report_fatal_error("LLVM 19.0 is required for mcdc intrinsic functions");
|
return wrap(llvm::Intrinsic::getDeclaration(
|
||||||
|
unwrap(M), llvm::Intrinsic::instrprof_mcdc_parameters));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMValueRef
|
extern "C" LLVMValueRef
|
||||||
LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) {
|
LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) {
|
||||||
#if LLVM_VERSION_GE(19, 0)
|
#if LLVM_VERSION_LT(19, 0)
|
||||||
return wrap(llvm::Intrinsic::getDeclaration(
|
report_fatal_error("LLVM 19.0 is required for mcdc intrinsic functions");
|
||||||
|
#endif
|
||||||
|
#if LLVM_VERSION_GE(20, 0)
|
||||||
|
return wrap(llvm::Intrinsic::getOrInsertDeclaration(
|
||||||
unwrap(M), llvm::Intrinsic::instrprof_mcdc_tvbitmap_update));
|
unwrap(M), llvm::Intrinsic::instrprof_mcdc_tvbitmap_update));
|
||||||
#else
|
#else
|
||||||
report_fatal_error("LLVM 19.0 is required for mcdc intrinsic functions");
|
return wrap(llvm::Intrinsic::getDeclaration(
|
||||||
|
unwrap(M), llvm::Intrinsic::instrprof_mcdc_tvbitmap_update));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user