about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-01-24 00:20:00 +0100
committerGitHub <noreply@github.com>2019-01-24 00:20:00 +0100
commitab998a2eeb2bcdc69ce70c814af97f0d1302a404 (patch)
treee4ea33b684a02cc779136be991fd179243a1bfb0
parentd17f62d857c70508efbf60be41135880bcd2e062 (diff)
parent9452a8dfa3ba3575d5cf090a4e2305ee106d259e (diff)
downloadrust-ab998a2eeb2bcdc69ce70c814af97f0d1302a404.tar.gz
rust-ab998a2eeb2bcdc69ce70c814af97f0d1302a404.zip
Rollup merge of #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 #57762
-rw-r--r--src/librustc_codegen_llvm/debuginfo/metadata.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs
index 6deedd0b5ea..9f63038c362 100644
--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs
+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs
@@ -1164,7 +1164,10 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool {
     // On MSVC we have to use the fallback mode, because LLVM doesn't
     // lower variant parts to PDB.
     return cx.sess().target.target.options.is_like_msvc
-        || llvm_util::get_major_version() < 7;
+        // LLVM version 7 did not release with an important bug fix;
+        // but the required patch is in the LLVM 8.  Rust LLVM reports
+        // 8 as well.
+        || llvm_util::get_major_version() < 8;
 }
 
 // Describes the members of an enum value: An enum is described as a union of