From 9941db45125f03f6f2c2e491b747e66f0f133415 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Sat, 5 Aug 2023 10:53:34 +0000 Subject: llvm-wrapper: adapt for LLVM API changes No functional changes intended. Adapts llvm-wrapper for https://github.com/llvm/llvm-project/commit/65e57bbed06d55cab7bb64d54891d33ccb2d4159. Found by our experimental rust + llvm @ HEAD CI: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/21304#0189c526-86cd-4db9-bdbc-dd0132dfc22b/197-500 --- compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp') diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index ebf8a50ae8b..a986fa28f78 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -1120,9 +1120,15 @@ struct LLVMRustThinLTOData { // Not 100% sure what these are, but they impact what's internalized and // what's inlined across modules, I believe. +#if LLVM_VERSION_GE(17, 0) + DenseMap ImportLists; + DenseMap ExportLists; + DenseMap ModuleToDefinedGVSummaries; +#else StringMap ImportLists; StringMap ExportLists; StringMap ModuleToDefinedGVSummaries; +#endif StringMap> ResolvedODR; LLVMRustThinLTOData() : Index(/* HaveGVs = */ false) {} -- cgit 1.4.1-3-g733a5 From 055dd282c5d17af5495ad125a08ec6b9d66062f1 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 20 Jul 2023 12:41:14 +0200 Subject: Remove no longer needed LLVM_RUSTLLVM check The bundled version now uses the LLVM 17 code path. --- compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp') diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index a986fa28f78..06f28f432ba 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -322,8 +322,6 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM, #if LLVM_VERSION_GE(17, 0) const ArrayRef CPUTable = MCInfo->getAllProcessorDescriptions(); -#elif defined(LLVM_RUSTLLVM) - const ArrayRef CPUTable = MCInfo->getCPUTable(); #else Buf << "Full target CPU help is not supported by this LLVM version.\n\n"; SubtargetSubTypeKV TargetCPUKV = { TargetCPU, {{}}, {{}} }; -- cgit 1.4.1-3-g733a5 From 78678336527cdbabaa41e5e92e6645ed712b4160 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 7 Aug 2023 20:36:14 +0200 Subject: Fix LLVM version check for ThinLTO import/export lists These types changed in LLVM 18, not LLVM 17. --- compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp') diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 06f28f432ba..48b5fd6e283 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -1118,7 +1118,7 @@ struct LLVMRustThinLTOData { // Not 100% sure what these are, but they impact what's internalized and // what's inlined across modules, I believe. -#if LLVM_VERSION_GE(17, 0) +#if LLVM_VERSION_GE(18, 0) DenseMap ImportLists; DenseMap ExportLists; DenseMap ModuleToDefinedGVSummaries; -- cgit 1.4.1-3-g733a5