diff options
| author | bors <bors@rust-lang.org> | 2024-10-11 23:57:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-11 23:57:42 +0000 |
| commit | fb20e4d3b96d1de459d086980a8b99d5060ad9fe (patch) | |
| tree | b750cf990b7d8dc65aa3c6c95898a8920907e2dd /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 1bc403daadbebb553ccc211a0a8eebb73989665f (diff) | |
| parent | 6f76d6e1a376f8119872b70f8133835739298158 (diff) | |
| download | rust-fb20e4d3b96d1de459d086980a8b99d5060ad9fe.tar.gz rust-fb20e4d3b96d1de459d086980a8b99d5060ad9fe.zip | |
Auto merge of #131573 - tgross35:rollup-r7l182a, r=tgross35
Rollup of 7 pull requests Successful merges: - #130078 (rustdoc-json: change item ID's repr from a string to an int) - #131065 (Port sort-research-rs test suite to Rust stdlib tests) - #131109 (Stabilize `debug_more_non_exhaustive`) - #131287 (stabilize const_result) - #131463 (Stabilise `const_char_encode_utf8`.) - #131543 (coverage: Remove code related to LLVM 17) - #131552 (RustWrapper: adapt for rename of Intrinsic::getDeclaration) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 8faa5212408..72b03fa0560 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1533,27 +1533,40 @@ extern "C" LLVMValueRef LLVMRustBuildCall(LLVMBuilderRef B, LLVMTypeRef Ty, extern "C" LLVMValueRef 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( unwrap(M), llvm::Intrinsic::instrprof_increment)); +#endif } extern "C" LLVMValueRef LLVMRustGetInstrProfMCDCParametersIntrinsic(LLVMModuleRef M) { -#if LLVM_VERSION_GE(19, 0) - return wrap(llvm::Intrinsic::getDeclaration( +#if LLVM_VERSION_LT(19, 0) + 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)); #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 } extern "C" LLVMValueRef LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) { -#if LLVM_VERSION_GE(19, 0) - return wrap(llvm::Intrinsic::getDeclaration( +#if LLVM_VERSION_LT(19, 0) + 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)); #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 } |
