db49a4
commit ab998a2eeb2bcdc69ce70c814af97f0d1302a404 (from d17f62d857c70508efbf60be41135880bcd2e062)
db49a4
Merge: d17f62d857c7 9452a8dfa3ba
db49a4
Author: Mazdak Farrokhzad <twingoow@gmail.com>
db49a4
Date:   Thu Jan 24 00:20:00 2019 +0100
db49a4
db49a4
    Rollup merge of #57840 - tromey:fix-issue-57762, r=nikic
db49a4
    
db49a4
    Fix issue 57762
db49a4
    
db49a4
    against a stock LLVM 7.  LLVM 7 was released without a necessary fix
db49a4
    for a bug in the DWARF discriminant code.
db49a4
    
db49a4
    This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7.
db49a4
    
db49a4
    Closes #57762
db49a4
db49a4
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs
db49a4
index 6deedd0b5ea3..9f63038c3623 100644
db49a4
--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs
db49a4
+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs
db49a4
@@ -1164,7 +1164,10 @@ fn use_enum_fallback(cx: &CodegenCx) -> bool {
db49a4
     // On MSVC we have to use the fallback mode, because LLVM doesn't
db49a4
     // lower variant parts to PDB.
db49a4
     return cx.sess().target.target.options.is_like_msvc
db49a4
-        || llvm_util::get_major_version() < 7;
db49a4
+        // LLVM version 7 did not release with an important bug fix;
db49a4
+        // but the required patch is in the LLVM 8.  Rust LLVM reports
db49a4
+        // 8 as well.
db49a4
+        || llvm_util::get_major_version() < 8;
db49a4
 }
db49a4
 
db49a4
 // Describes the members of an enum value: An enum is described as a union of