From 5afbb69ae43c60fc99b2299c681f9b0896f61384 Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Wed, 15 Nov 2023 21:42:44 +0000 Subject: [PATCH] llvm: Default new RunTimeLang to 0 for enums In LLVM-18, RunTimeLang is added to enums and classes: https://github.com/llvm/llvm-project/pull/72011 Rather than passing the parameter through, we default it to 0 since it will not reliably do anything until Rust requires LLVM 18, and we always pass 0 to the APIs for similar debug structures. --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 4390486b0deb1..ee873fa744555 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1105,7 +1105,11 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateEnumerationType( unwrapDI(Scope), StringRef(Name, NameLen), unwrapDI(File), LineNumber, SizeInBits, AlignInBits, DINodeArray(unwrapDI(Elements)), - unwrapDI(ClassTy), "", IsScoped)); + unwrapDI(ClassTy), +#if LLVM_VERSION_GE(18, 0) + /*RunTimeLang=*/0, +#endif + "", IsScoped)); } extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateUnionType(