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