From 0847dae70368eeed7c4d1c772e29d3fc7e3e1f95 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Tue, 8 Sep 2026 09:39:47 +0200 Subject: [PATCH] call renumberMetadataForAssembly() in LLVMRustPrintModule() --- compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index e77d63d91703b..1bd5094c38f02 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -1165,7 +1165,9 @@ extern "C" LLVMRustResult LLVMRustPrintModule(LLVMModuleRef M, const char *Path, LLVMRustSetLastError(ErrorInfo.c_str()); return LLVMRustResult::Failure; } - +#if LLVM_VERSION_GE(24, 0) + unwrap(M)->renumberMetadataForAssembly(); +#endif auto AAW = RustAssemblyAnnotationWriter(Demangle); auto FOS = formatted_raw_ostream(OS); unwrap(M)->print(FOS, &AAW);