Skip to content

Commit ab998a2

Browse files
authored
Rollup merge of rust-lang#57840 - tromey:fix-issue-57762, r=nikic
Fix issue 57762 against a stock LLVM 7. LLVM 7 was released without a necessary fix for a bug in the DWARF discriminant code. This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. Closes rust-lang#57762
2 parents d17f62d + 9452a8d commit ab998a2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc_codegen_llvm/debuginfo/metadata.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,10 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool {
11641164
// On MSVC we have to use the fallback mode, because LLVM doesn't
11651165
// lower variant parts to PDB.
11661166
return cx.sess().target.target.options.is_like_msvc
1167-
|| llvm_util::get_major_version() < 7;
1167+
// LLVM version 7 did not release with an important bug fix;
1168+
// but the required patch is in the LLVM 8. Rust LLVM reports
1169+
// 8 as well.
1170+
|| llvm_util::get_major_version() < 8;
11681171
}
11691172

11701173
// Describes the members of an enum value: An enum is described as a union of

0 commit comments

Comments
 (0)