From 56d589b5bea75d08d21d7d6efb34e8527aec7635 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Mon, 17 Jun 2024 09:35:38 +0000 Subject: [PATCH] llvm-wrapper: adapt for LLVM 19 API change No functional changes intended. The instrprof_mcdc_condbitmap_update intrinsic was dropped in LLVM 19: * https://github.com/llvm/llvm-project/commit/85a7bba7d28365ff98dae74f20ebf9f53d42023a --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index b6790b7df500b..959efb0befe4e 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1562,11 +1562,11 @@ LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) { extern "C" LLVMValueRef LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(LLVMModuleRef M) { -#if LLVM_VERSION_GE(18, 0) +#if LLVM_VERSION_GE(18, 0) && LLVM_VERSION_LT(19, 0) return wrap(llvm::Intrinsic::getDeclaration( unwrap(M), llvm::Intrinsic::instrprof_mcdc_condbitmap_update)); #else - report_fatal_error("LLVM 18.0 is required for mcdc intrinsic functions"); + report_fatal_error("The instrprof_mcdc_condbitmap_update only exists in LLVM 18"); #endif }