Blame SOURCES/rust-pr57840-llvm7-debuginfo-variants.patch

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