Skip to content

Commit 5afbb69

Browse files
committed
llvm: Default new RunTimeLang to 0 for enums
In LLVM-18, RunTimeLang is added to enums and classes: llvm/llvm-project#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.
1 parent 0b24479 commit 5afbb69

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,11 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateEnumerationType(
11051105
unwrapDI<DIDescriptor>(Scope), StringRef(Name, NameLen),
11061106
unwrapDI<DIFile>(File), LineNumber,
11071107
SizeInBits, AlignInBits, DINodeArray(unwrapDI<MDTuple>(Elements)),
1108-
unwrapDI<DIType>(ClassTy), "", IsScoped));
1108+
unwrapDI<DIType>(ClassTy),
1109+
#if LLVM_VERSION_GE(18, 0)
1110+
/*RunTimeLang=*/0,
1111+
#endif
1112+
"", IsScoped));
11091113
}
11101114

11111115
extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateUnionType(

0 commit comments

Comments
 (0)