mirror of
https://github.com/rust-lang/rust
synced 2024-09-15 22:50:55 +00:00
Update the minimum external LLVM to 8
LLVM 8 was released on March 20, 2019, over a year ago.
This commit is contained in:
parent
ba72b15666
commit
8506bb0060
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -36,13 +36,13 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
name:
|
name:
|
||||||
- mingw-check
|
- mingw-check
|
||||||
- x86_64-gnu-llvm-7
|
- x86_64-gnu-llvm-8
|
||||||
- x86_64-gnu-tools
|
- x86_64-gnu-tools
|
||||||
include:
|
include:
|
||||||
- name: mingw-check
|
- name: mingw-check
|
||||||
os: ubuntu-latest-xl
|
os: ubuntu-latest-xl
|
||||||
env: {}
|
env: {}
|
||||||
- name: x86_64-gnu-llvm-7
|
- name: x86_64-gnu-llvm-8
|
||||||
os: ubuntu-latest-xl
|
os: ubuntu-latest-xl
|
||||||
env: {}
|
env: {}
|
||||||
- name: x86_64-gnu-tools
|
- name: x86_64-gnu-tools
|
||||||
|
@ -352,7 +352,7 @@ jobs:
|
||||||
- x86_64-gnu-debug
|
- x86_64-gnu-debug
|
||||||
- x86_64-gnu-distcheck
|
- x86_64-gnu-distcheck
|
||||||
- x86_64-gnu-full-bootstrap
|
- x86_64-gnu-full-bootstrap
|
||||||
- x86_64-gnu-llvm-7
|
- x86_64-gnu-llvm-8
|
||||||
- x86_64-gnu-nopt
|
- x86_64-gnu-nopt
|
||||||
- x86_64-gnu-tools
|
- x86_64-gnu-tools
|
||||||
- x86_64-mingw-1
|
- x86_64-mingw-1
|
||||||
|
@ -469,7 +469,7 @@ jobs:
|
||||||
- name: x86_64-gnu-full-bootstrap
|
- name: x86_64-gnu-full-bootstrap
|
||||||
os: ubuntu-latest-xl
|
os: ubuntu-latest-xl
|
||||||
env: {}
|
env: {}
|
||||||
- name: x86_64-gnu-llvm-7
|
- name: x86_64-gnu-llvm-8
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
os: ubuntu-latest-xl
|
os: ubuntu-latest-xl
|
||||||
|
|
|
@ -289,11 +289,11 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) {
|
||||||
let version = output(cmd.arg("--version"));
|
let version = output(cmd.arg("--version"));
|
||||||
let mut parts = version.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
|
let mut parts = version.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
|
||||||
if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
|
if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
|
||||||
if major >= 7 {
|
if major >= 8 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
panic!("\n\nbad LLVM version: {}, need >=7.0\n\n", version)
|
panic!("\n\nbad LLVM version: {}, need >=8.0\n\n", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn configure_cmake(
|
fn configure_cmake(
|
||||||
|
|
|
@ -29,7 +29,7 @@ jobs:
|
||||||
- template: steps/run.yml
|
- template: steps/run.yml
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
x86_64-gnu-llvm-7:
|
x86_64-gnu-llvm-8:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
dist-x86_64-linux: {}
|
dist-x86_64-linux: {}
|
||||||
dist-x86_64-linux-alt:
|
dist-x86_64-linux-alt:
|
||||||
|
|
|
@ -29,7 +29,7 @@ jobs:
|
||||||
- template: steps/run.yml
|
- template: steps/run.yml
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
x86_64-gnu-llvm-7: {}
|
x86_64-gnu-llvm-8: {}
|
||||||
mingw-check: {}
|
mingw-check: {}
|
||||||
x86_64-gnu-tools:
|
x86_64-gnu-tools:
|
||||||
CI_ONLY_WHEN_SUBMODULES_CHANGED: 1
|
CI_ONLY_WHEN_SUBMODULES_CHANGED: 1
|
||||||
|
|
|
@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
cmake \
|
cmake \
|
||||||
sudo \
|
sudo \
|
||||||
gdb \
|
gdb \
|
||||||
llvm-7-tools \
|
llvm-8-tools \
|
||||||
libedit-dev \
|
libedit-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
|
@ -26,7 +26,7 @@ RUN sh /scripts/sccache.sh
|
||||||
# using llvm-link-shared due to libffi issues -- see #34486
|
# using llvm-link-shared due to libffi issues -- see #34486
|
||||||
ENV RUST_CONFIGURE_ARGS \
|
ENV RUST_CONFIGURE_ARGS \
|
||||||
--build=x86_64-unknown-linux-gnu \
|
--build=x86_64-unknown-linux-gnu \
|
||||||
--llvm-root=/usr/lib/llvm-7 \
|
--llvm-root=/usr/lib/llvm-8 \
|
||||||
--enable-llvm-link-shared \
|
--enable-llvm-link-shared \
|
||||||
--set rust.thin-lto-import-instr-limit=10
|
--set rust.thin-lto-import-instr-limit=10
|
||||||
|
|
|
@ -259,13 +259,13 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
name:
|
name:
|
||||||
- mingw-check
|
- mingw-check
|
||||||
- x86_64-gnu-llvm-7
|
- x86_64-gnu-llvm-8
|
||||||
- x86_64-gnu-tools
|
- x86_64-gnu-tools
|
||||||
include:
|
include:
|
||||||
- name: mingw-check
|
- name: mingw-check
|
||||||
<<: *job-linux-xl
|
<<: *job-linux-xl
|
||||||
|
|
||||||
- name: x86_64-gnu-llvm-7
|
- name: x86_64-gnu-llvm-8
|
||||||
<<: *job-linux-xl
|
<<: *job-linux-xl
|
||||||
|
|
||||||
- name: x86_64-gnu-tools
|
- name: x86_64-gnu-tools
|
||||||
|
@ -349,7 +349,7 @@ jobs:
|
||||||
- x86_64-gnu-debug
|
- x86_64-gnu-debug
|
||||||
- x86_64-gnu-distcheck
|
- x86_64-gnu-distcheck
|
||||||
- x86_64-gnu-full-bootstrap
|
- x86_64-gnu-full-bootstrap
|
||||||
- x86_64-gnu-llvm-7
|
- x86_64-gnu-llvm-8
|
||||||
- x86_64-gnu-nopt
|
- x86_64-gnu-nopt
|
||||||
- x86_64-gnu-tools
|
- x86_64-gnu-tools
|
||||||
- x86_64-mingw-1
|
- x86_64-mingw-1
|
||||||
|
@ -471,7 +471,7 @@ jobs:
|
||||||
- name: x86_64-gnu-full-bootstrap
|
- name: x86_64-gnu-full-bootstrap
|
||||||
<<: *job-linux-xl
|
<<: *job-linux-xl
|
||||||
|
|
||||||
- name: x86_64-gnu-llvm-7
|
- name: x86_64-gnu-llvm-8
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
<<: *job-linux-xl
|
<<: *job-linux-xl
|
||||||
|
|
|
@ -82,21 +82,12 @@ fn naked(val: &'ll Value, is_naked: bool) {
|
||||||
|
|
||||||
pub fn set_frame_pointer_elimination(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
|
pub fn set_frame_pointer_elimination(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
|
||||||
if cx.sess().must_not_eliminate_frame_pointers() {
|
if cx.sess().must_not_eliminate_frame_pointers() {
|
||||||
if llvm_util::get_major_version() >= 8 {
|
llvm::AddFunctionAttrStringValue(
|
||||||
llvm::AddFunctionAttrStringValue(
|
llfn,
|
||||||
llfn,
|
llvm::AttributePlace::Function,
|
||||||
llvm::AttributePlace::Function,
|
const_cstr!("frame-pointer"),
|
||||||
const_cstr!("frame-pointer"),
|
const_cstr!("all"),
|
||||||
const_cstr!("all"),
|
);
|
||||||
);
|
|
||||||
} else {
|
|
||||||
llvm::AddFunctionAttrStringValue(
|
|
||||||
llfn,
|
|
||||||
llvm::AttributePlace::Function,
|
|
||||||
const_cstr!("no-frame-pointer-elim"),
|
|
||||||
const_cstr!("true"),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
DIArray, DICompositeType, DIDescriptor, DIFile, DIFlags, DILexicalBlock, DIScope, DIType,
|
DIArray, DICompositeType, DIDescriptor, DIFile, DIFlags, DILexicalBlock, DIScope, DIType,
|
||||||
DebugEmissionKind,
|
DebugEmissionKind,
|
||||||
};
|
};
|
||||||
use crate::llvm_util;
|
|
||||||
use crate::value::Value;
|
use crate::value::Value;
|
||||||
|
|
||||||
use log::debug;
|
use log::debug;
|
||||||
|
@ -1289,22 +1288,11 @@ fn prepare_union_metadata(
|
||||||
// Enums
|
// Enums
|
||||||
//=-----------------------------------------------------------------------------
|
//=-----------------------------------------------------------------------------
|
||||||
|
|
||||||
/// DWARF variant support is only available starting in LLVM 8.
|
/// DWARF variant support is only available starting in LLVM 8, but
|
||||||
/// Although the earlier enum debug info output did not work properly
|
/// on MSVC we have to use the fallback mode, because LLVM doesn't
|
||||||
/// in all situations, it is better for the time being to continue to
|
/// lower variant parts to PDB.
|
||||||
/// sometimes emit the old style rather than emit something completely
|
|
||||||
/// useless when rust is compiled against LLVM 6 or older. LLVM 7
|
|
||||||
/// contains an early version of the DWARF variant support, and will
|
|
||||||
/// crash when handling the new debug info format. This function
|
|
||||||
/// decides which representation will be emitted.
|
|
||||||
fn use_enum_fallback(cx: &CodegenCx<'_, '_>) -> bool {
|
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.
|
|
||||||
cx.sess().target.target.options.is_like_msvc
|
cx.sess().target.target.options.is_like_msvc
|
||||||
// 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(eddyb) maybe precompute this? Right now it's computed once
|
// FIXME(eddyb) maybe precompute this? Right now it's computed once
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
use crate::builder::Builder;
|
use crate::builder::Builder;
|
||||||
use crate::context::CodegenCx;
|
use crate::context::CodegenCx;
|
||||||
use crate::llvm;
|
use crate::llvm;
|
||||||
use crate::llvm_util;
|
|
||||||
use crate::type_::Type;
|
use crate::type_::Type;
|
||||||
use crate::type_of::LayoutLlvmExt;
|
use crate::type_of::LayoutLlvmExt;
|
||||||
use crate::va_arg::emit_va_arg;
|
use crate::va_arg::emit_va_arg;
|
||||||
|
@ -11,7 +10,7 @@
|
||||||
use rustc_ast::ast;
|
use rustc_ast::ast;
|
||||||
use rustc_codegen_ssa::base::{compare_simd_types, to_immediate, wants_msvc_seh};
|
use rustc_codegen_ssa::base::{compare_simd_types, to_immediate, wants_msvc_seh};
|
||||||
use rustc_codegen_ssa::common::span_invalid_monomorphization_error;
|
use rustc_codegen_ssa::common::span_invalid_monomorphization_error;
|
||||||
use rustc_codegen_ssa::common::{IntPredicate, TypeKind};
|
use rustc_codegen_ssa::common::TypeKind;
|
||||||
use rustc_codegen_ssa::glue;
|
use rustc_codegen_ssa::glue;
|
||||||
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
|
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
|
||||||
use rustc_codegen_ssa::mir::place::PlaceRef;
|
use rustc_codegen_ssa::mir::place::PlaceRef;
|
||||||
|
@ -461,46 +460,14 @@ fn codegen_intrinsic_call(
|
||||||
let is_add = name == "saturating_add";
|
let is_add = name == "saturating_add";
|
||||||
let lhs = args[0].immediate();
|
let lhs = args[0].immediate();
|
||||||
let rhs = args[1].immediate();
|
let rhs = args[1].immediate();
|
||||||
if llvm_util::get_major_version() >= 8 {
|
let llvm_name = &format!(
|
||||||
let llvm_name = &format!(
|
"llvm.{}{}.sat.i{}",
|
||||||
"llvm.{}{}.sat.i{}",
|
if signed { 's' } else { 'u' },
|
||||||
if signed { 's' } else { 'u' },
|
if is_add { "add" } else { "sub" },
|
||||||
if is_add { "add" } else { "sub" },
|
width
|
||||||
width
|
);
|
||||||
);
|
let llfn = self.get_intrinsic(llvm_name);
|
||||||
let llfn = self.get_intrinsic(llvm_name);
|
self.call(llfn, &[lhs, rhs], None)
|
||||||
self.call(llfn, &[lhs, rhs], None)
|
|
||||||
} else {
|
|
||||||
let llvm_name = &format!(
|
|
||||||
"llvm.{}{}.with.overflow.i{}",
|
|
||||||
if signed { 's' } else { 'u' },
|
|
||||||
if is_add { "add" } else { "sub" },
|
|
||||||
width
|
|
||||||
);
|
|
||||||
let llfn = self.get_intrinsic(llvm_name);
|
|
||||||
let pair = self.call(llfn, &[lhs, rhs], None);
|
|
||||||
let val = self.extract_value(pair, 0);
|
|
||||||
let overflow = self.extract_value(pair, 1);
|
|
||||||
let llty = self.type_ix(width);
|
|
||||||
|
|
||||||
let limit = if signed {
|
|
||||||
let limit_lo = self
|
|
||||||
.const_uint_big(llty, (i128::MIN >> (128 - width)) as u128);
|
|
||||||
let limit_hi = self
|
|
||||||
.const_uint_big(llty, (i128::MAX >> (128 - width)) as u128);
|
|
||||||
let neg = self.icmp(
|
|
||||||
IntPredicate::IntSLT,
|
|
||||||
val,
|
|
||||||
self.const_uint(llty, 0),
|
|
||||||
);
|
|
||||||
self.select(neg, limit_hi, limit_lo)
|
|
||||||
} else if is_add {
|
|
||||||
self.const_uint_big(llty, u128::MAX >> (128 - width))
|
|
||||||
} else {
|
|
||||||
self.const_uint(llty, 0)
|
|
||||||
};
|
|
||||||
self.select(overflow, limit, val)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => bug!(),
|
_ => bug!(),
|
||||||
},
|
},
|
||||||
|
|
|
@ -83,17 +83,15 @@ fn llvm_arg_to_arg_name(full_arg: &str) -> &str {
|
||||||
if !sess.opts.debugging_opts.no_generate_arange_section {
|
if !sess.opts.debugging_opts.no_generate_arange_section {
|
||||||
add("-generate-arange-section", false);
|
add("-generate-arange-section", false);
|
||||||
}
|
}
|
||||||
if get_major_version() >= 8 {
|
match sess
|
||||||
match sess
|
.opts
|
||||||
.opts
|
.debugging_opts
|
||||||
.debugging_opts
|
.merge_functions
|
||||||
.merge_functions
|
.unwrap_or(sess.target.target.options.merge_functions)
|
||||||
.unwrap_or(sess.target.target.options.merge_functions)
|
{
|
||||||
{
|
MergeFunctions::Disabled | MergeFunctions::Trampolines => {}
|
||||||
MergeFunctions::Disabled | MergeFunctions::Trampolines => {}
|
MergeFunctions::Aliases => {
|
||||||
MergeFunctions::Aliases => {
|
add("-mergefunc-use-aliases", false);
|
||||||
add("-mergefunc-use-aliases", false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,8 @@
|
||||||
#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
|
#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
|
||||||
#include "llvm/Support/TimeProfiler.h"
|
#include "llvm/Support/TimeProfiler.h"
|
||||||
#endif
|
#endif
|
||||||
#if LLVM_VERSION_GE(8, 0)
|
|
||||||
#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
|
#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
|
||||||
#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
|
#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
|
||||||
#endif
|
|
||||||
#if LLVM_VERSION_GE(9, 0)
|
#if LLVM_VERSION_GE(9, 0)
|
||||||
#include "llvm/Transforms/Utils/CanonicalizeAliases.h"
|
#include "llvm/Transforms/Utils/CanonicalizeAliases.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -138,19 +136,13 @@ extern "C" LLVMPassRef LLVMRustCreateMemorySanitizerPass(int TrackOrigins, bool
|
||||||
|
|
||||||
return wrap(createMemorySanitizerLegacyPassPass(
|
return wrap(createMemorySanitizerLegacyPassPass(
|
||||||
MemorySanitizerOptions{TrackOrigins, Recover, CompileKernel}));
|
MemorySanitizerOptions{TrackOrigins, Recover, CompileKernel}));
|
||||||
#elif LLVM_VERSION_GE(8, 0)
|
|
||||||
return wrap(createMemorySanitizerLegacyPassPass(TrackOrigins, Recover));
|
|
||||||
#else
|
#else
|
||||||
return wrap(createMemorySanitizerPass(TrackOrigins, Recover));
|
return wrap(createMemorySanitizerLegacyPassPass(TrackOrigins, Recover));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMPassRef LLVMRustCreateThreadSanitizerPass() {
|
extern "C" LLVMPassRef LLVMRustCreateThreadSanitizerPass() {
|
||||||
#if LLVM_VERSION_GE(8, 0)
|
|
||||||
return wrap(createThreadSanitizerLegacyPassPass());
|
return wrap(createThreadSanitizerLegacyPassPass());
|
||||||
#else
|
|
||||||
return wrap(createThreadSanitizerPass());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMRustPassKind LLVMRustPassKind(LLVMPassRef RustPass) {
|
extern "C" LLVMRustPassKind LLVMRustPassKind(LLVMPassRef RustPass) {
|
||||||
|
@ -1236,15 +1228,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
||||||
auto deadIsPrevailing = [&](GlobalValue::GUID G) {
|
auto deadIsPrevailing = [&](GlobalValue::GUID G) {
|
||||||
return PrevailingType::Unknown;
|
return PrevailingType::Unknown;
|
||||||
};
|
};
|
||||||
#if LLVM_VERSION_GE(8, 0)
|
|
||||||
// We don't have a complete picture in our use of ThinLTO, just our immediate
|
// We don't have a complete picture in our use of ThinLTO, just our immediate
|
||||||
// crate, so we need `ImportEnabled = false` to limit internalization.
|
// crate, so we need `ImportEnabled = false` to limit internalization.
|
||||||
// Otherwise, we sometimes lose `static` values -- see #60184.
|
// Otherwise, we sometimes lose `static` values -- see #60184.
|
||||||
computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols,
|
computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols,
|
||||||
deadIsPrevailing, /* ImportEnabled = */ false);
|
deadIsPrevailing, /* ImportEnabled = */ false);
|
||||||
#else
|
|
||||||
computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols, deadIsPrevailing);
|
|
||||||
#endif
|
|
||||||
ComputeCrossModuleImport(
|
ComputeCrossModuleImport(
|
||||||
Ret->Index,
|
Ret->Index,
|
||||||
Ret->ModuleToDefinedGVSummaries,
|
Ret->ModuleToDefinedGVSummaries,
|
||||||
|
@ -1277,10 +1265,8 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
||||||
#if LLVM_VERSION_GE(9, 0)
|
#if LLVM_VERSION_GE(9, 0)
|
||||||
thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage,
|
thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage,
|
||||||
Ret->GUIDPreservedSymbols);
|
Ret->GUIDPreservedSymbols);
|
||||||
#elif LLVM_VERSION_GE(8, 0)
|
|
||||||
thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage);
|
|
||||||
#else
|
#else
|
||||||
thinLTOResolveWeakForLinkerInIndex(Ret->Index, isPrevailing, recordNewLinkage);
|
thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Here we calculate an `ExportedGUIDs` set for use in the `isExported`
|
// Here we calculate an `ExportedGUIDs` set for use in the `isExported`
|
||||||
|
@ -1346,11 +1332,7 @@ extern "C" bool
|
||||||
LLVMRustPrepareThinLTOResolveWeak(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
|
LLVMRustPrepareThinLTOResolveWeak(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
|
||||||
Module &Mod = *unwrap(M);
|
Module &Mod = *unwrap(M);
|
||||||
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(Mod.getModuleIdentifier());
|
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(Mod.getModuleIdentifier());
|
||||||
#if LLVM_VERSION_GE(8, 0)
|
|
||||||
thinLTOResolvePrevailingInModule(Mod, DefinedGlobals);
|
thinLTOResolvePrevailingInModule(Mod, DefinedGlobals);
|
||||||
#else
|
|
||||||
thinLTOResolveWeakForLinkerModule(Mod, DefinedGlobals);
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -586,7 +586,6 @@ inline LLVMRustDISPFlags virtuality(LLVMRustDISPFlags F) {
|
||||||
return static_cast<LLVMRustDISPFlags>(static_cast<uint32_t>(F) & 0x3);
|
return static_cast<LLVMRustDISPFlags>(static_cast<uint32_t>(F) & 0x3);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_VERSION_GE(8, 0)
|
|
||||||
static DISubprogram::DISPFlags fromRust(LLVMRustDISPFlags SPFlags) {
|
static DISubprogram::DISPFlags fromRust(LLVMRustDISPFlags SPFlags) {
|
||||||
DISubprogram::DISPFlags Result = DISubprogram::DISPFlags::SPFlagZero;
|
DISubprogram::DISPFlags Result = DISubprogram::DISPFlags::SPFlagZero;
|
||||||
|
|
||||||
|
@ -619,7 +618,6 @@ static DISubprogram::DISPFlags fromRust(LLVMRustDISPFlags SPFlags) {
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
enum class LLVMRustDebugEmissionKind {
|
enum class LLVMRustDebugEmissionKind {
|
||||||
NoDebug,
|
NoDebug,
|
||||||
|
@ -734,7 +732,6 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateFunction(
|
||||||
LLVMMetadataRef Decl) {
|
LLVMMetadataRef Decl) {
|
||||||
DITemplateParameterArray TParams =
|
DITemplateParameterArray TParams =
|
||||||
DITemplateParameterArray(unwrap<MDTuple>(TParam));
|
DITemplateParameterArray(unwrap<MDTuple>(TParam));
|
||||||
#if LLVM_VERSION_GE(8, 0)
|
|
||||||
DISubprogram::DISPFlags llvmSPFlags = fromRust(SPFlags);
|
DISubprogram::DISPFlags llvmSPFlags = fromRust(SPFlags);
|
||||||
DINode::DIFlags llvmFlags = fromRust(Flags);
|
DINode::DIFlags llvmFlags = fromRust(Flags);
|
||||||
#if LLVM_VERSION_LT(9, 0)
|
#if LLVM_VERSION_LT(9, 0)
|
||||||
|
@ -748,22 +745,6 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateFunction(
|
||||||
unwrapDI<DIFile>(File), LineNo,
|
unwrapDI<DIFile>(File), LineNo,
|
||||||
unwrapDI<DISubroutineType>(Ty), ScopeLine, llvmFlags,
|
unwrapDI<DISubroutineType>(Ty), ScopeLine, llvmFlags,
|
||||||
llvmSPFlags, TParams, unwrapDIPtr<DISubprogram>(Decl));
|
llvmSPFlags, TParams, unwrapDIPtr<DISubprogram>(Decl));
|
||||||
#else
|
|
||||||
bool IsLocalToUnit = isSet(SPFlags & LLVMRustDISPFlags::SPFlagLocalToUnit);
|
|
||||||
bool IsDefinition = isSet(SPFlags & LLVMRustDISPFlags::SPFlagDefinition);
|
|
||||||
bool IsOptimized = isSet(SPFlags & LLVMRustDISPFlags::SPFlagOptimized);
|
|
||||||
DINode::DIFlags llvmFlags = fromRust(Flags);
|
|
||||||
if (isSet(SPFlags & LLVMRustDISPFlags::SPFlagMainSubprogram))
|
|
||||||
llvmFlags |= DINode::DIFlags::FlagMainSubprogram;
|
|
||||||
DISubprogram *Sub = Builder->createFunction(
|
|
||||||
unwrapDI<DIScope>(Scope),
|
|
||||||
StringRef(Name, NameLen),
|
|
||||||
StringRef(LinkageName, LinkageNameLen),
|
|
||||||
unwrapDI<DIFile>(File), LineNo,
|
|
||||||
unwrapDI<DISubroutineType>(Ty), IsLocalToUnit, IsDefinition,
|
|
||||||
ScopeLine, llvmFlags, IsOptimized, TParams,
|
|
||||||
unwrapDIPtr<DISubprogram>(Decl));
|
|
||||||
#endif
|
|
||||||
unwrap<Function>(Fn)->setSubprogram(Sub);
|
unwrap<Function>(Fn)->setSubprogram(Sub);
|
||||||
return wrap(Sub);
|
return wrap(Sub);
|
||||||
}
|
}
|
||||||
|
@ -884,9 +865,7 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
|
||||||
/* isDefined */ true,
|
/* isDefined */ true,
|
||||||
#endif
|
#endif
|
||||||
InitExpr, unwrapDIPtr<MDNode>(Decl),
|
InitExpr, unwrapDIPtr<MDNode>(Decl),
|
||||||
#if LLVM_VERSION_GE(8, 0)
|
|
||||||
/* templateParams */ nullptr,
|
/* templateParams */ nullptr,
|
||||||
#endif
|
|
||||||
AlignInBits);
|
AlignInBits);
|
||||||
|
|
||||||
InitVal->setMetadata("dbg", VarExpr);
|
InitVal->setMetadata("dbg", VarExpr);
|
||||||
|
@ -1107,11 +1086,7 @@ extern "C" void LLVMRustUnpackOptimizationDiagnostic(
|
||||||
if (loc.isValid()) {
|
if (loc.isValid()) {
|
||||||
*Line = loc.getLine();
|
*Line = loc.getLine();
|
||||||
*Column = loc.getColumn();
|
*Column = loc.getColumn();
|
||||||
#if LLVM_VERSION_GE(8, 0)
|
|
||||||
FilenameOS << loc.getAbsolutePath();
|
FilenameOS << loc.getAbsolutePath();
|
||||||
#else
|
|
||||||
FilenameOS << loc.getFilename();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RawRustStringOstream MessageOS(MessageOut);
|
RawRustStringOstream MessageOS(MessageOut);
|
||||||
|
|
|
@ -1,18 +1,13 @@
|
||||||
// This test depends on a patch that was committed to upstream LLVM
|
// This tests that debug info for "c-like" enums is properly emitted.
|
||||||
// before 7.0, then backported to the Rust LLVM fork. It tests that
|
// This is ignored for the fallback mode on MSVC due to problems with PDB.
|
||||||
// debug info for "c-like" enums is properly emitted.
|
|
||||||
|
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// ignore-windows
|
// ignore-msvc
|
||||||
// min-system-llvm-version 8.0
|
|
||||||
|
|
||||||
// compile-flags: -g -C no-prepopulate-passes
|
// compile-flags: -g -C no-prepopulate-passes
|
||||||
|
|
||||||
// DIFlagFixedEnum was deprecated in 8.0, renamed to DIFlagEnumClass.
|
|
||||||
// We match either for compatibility.
|
|
||||||
|
|
||||||
// CHECK-LABEL: @main
|
// CHECK-LABEL: @main
|
||||||
// CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_enumeration_type,{{.*}}name: "E",{{.*}}flags: {{(DIFlagEnumClass|DIFlagFixedEnum)}},{{.*}}
|
// CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_enumeration_type,{{.*}}name: "E",{{.*}}flags: DIFlagEnumClass,{{.*}}
|
||||||
// CHECK: {{.*}}DIEnumerator{{.*}}name: "A",{{.*}}value: {{[0-9].*}}
|
// CHECK: {{.*}}DIEnumerator{{.*}}name: "A",{{.*}}value: {{[0-9].*}}
|
||||||
// CHECK: {{.*}}DIEnumerator{{.*}}name: "B",{{.*}}value: {{[0-9].*}}
|
// CHECK: {{.*}}DIEnumerator{{.*}}name: "B",{{.*}}value: {{[0-9].*}}
|
||||||
// CHECK: {{.*}}DIEnumerator{{.*}}name: "C",{{.*}}value: {{[0-9].*}}
|
// CHECK: {{.*}}DIEnumerator{{.*}}name: "C",{{.*}}value: {{[0-9].*}}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
// This test depends on a patch that was committed to upstream LLVM
|
// This tests that optimized enum debug info accurately reflects the enum layout.
|
||||||
// before 7.0, then backported to the Rust LLVM fork. It tests that
|
// This is ignored for the fallback mode on MSVC due to problems with PDB.
|
||||||
// optimized enum debug info accurately reflects the enum layout.
|
|
||||||
|
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// ignore-windows
|
// ignore-msvc
|
||||||
// min-system-llvm-version 8.0
|
|
||||||
|
|
||||||
// compile-flags: -g -C no-prepopulate-passes
|
// compile-flags: -g -C no-prepopulate-passes
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
// This test depends on a patch that was committed to upstream LLVM
|
// This tests that optimized enum debug info accurately reflects the enum layout.
|
||||||
// before 7.0, then backported to the Rust LLVM fork. It tests that
|
// This is ignored for the fallback mode on MSVC due to problems with PDB.
|
||||||
// optimized enum debug info accurately reflects the enum layout.
|
|
||||||
|
|
||||||
// ignore-windows
|
// ignore-msvc
|
||||||
// min-system-llvm-version 8.0
|
|
||||||
|
|
||||||
// compile-flags: -g -C no-prepopulate-passes
|
// compile-flags: -g -C no-prepopulate-passes
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
// This test depends on a patch that was committed to upstream LLVM
|
// This tests that debug info for tagged (ordinary) enums is properly emitted.
|
||||||
// before 7.0, then backported to the Rust LLVM fork. It tests that
|
// This is ignored for the fallback mode on MSVC due to problems with PDB.
|
||||||
// debug info for tagged (ordinary) enums is properly emitted.
|
|
||||||
|
|
||||||
// ignore-windows
|
// ignore-msvc
|
||||||
// min-system-llvm-version 8.0
|
|
||||||
|
|
||||||
// compile-flags: -g -C no-prepopulate-passes
|
// compile-flags: -g -C no-prepopulate-passes
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
// min-llvm-version 8.0
|
|
||||||
// compile-flags: -C no-prepopulate-passes -C force-frame-pointers=y
|
// compile-flags: -C no-prepopulate-passes -C force-frame-pointers=y
|
||||||
|
|
||||||
#![crate_type="lib"]
|
#![crate_type="lib"]
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
// min-llvm-version 8.0
|
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// compile-flags: -Z instrument-mcount
|
// compile-flags: -Z instrument-mcount
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
|
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb or lldb that can read it.
|
// Require a gdb or lldb that can read DW_TAG_variant_part.
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
// rust-lldb
|
// rust-lldb
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb that can read it.
|
// Require a gdb that can read DW_TAG_variant_part.
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
|
|
||||||
// compile-flags:-g -Z thinlto
|
// compile-flags:-g -Z thinlto
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
|
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb that can read it.
|
// Require a gdb that can read DW_TAG_variant_part.
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
|
|
||||||
// compile-flags:-g
|
// compile-flags:-g
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
// ignore-lldb: FIXME(#27089)
|
// ignore-lldb: FIXME(#27089)
|
||||||
// min-lldb-version: 310
|
// min-lldb-version: 310
|
||||||
|
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb that can read it.
|
// Require a gdb that can read DW_TAG_variant_part.
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
|
|
||||||
// compile-flags:-g
|
// compile-flags:-g
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// min-lldb-version: 310
|
// min-lldb-version: 310
|
||||||
|
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb that can read it.
|
// Require a gdb that can read DW_TAG_variant_part.
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
|
|
||||||
// compile-flags:-g
|
// compile-flags:-g
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
|
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
|
// Require a gdb or lldb that can read DW_TAG_variant_part.
|
||||||
// read it.
|
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
// rust-lldb
|
// rust-lldb
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
// This test makes sure that the LLDB pretty printer does not throw an exception
|
// This test makes sure that the LLDB pretty printer does not throw an exception
|
||||||
// for nested closures and generators.
|
// for nested closures and generators.
|
||||||
|
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb that can read it.
|
// Require a gdb that can read DW_TAG_variant_part.
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// ignore-lldb
|
// ignore-lldb
|
||||||
|
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb that can read it.
|
// Require a gdb that can read DW_TAG_variant_part.
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
|
|
||||||
// compile-flags:-g
|
// compile-flags:-g
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
|
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
|
// Require a gdb or lldb that can read DW_TAG_variant_part.
|
||||||
// read it.
|
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
// rust-lldb
|
// rust-lldb
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
|
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
|
// Require a gdb or lldb that can read DW_TAG_variant_part.
|
||||||
// read it.
|
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
// rust-lldb
|
// rust-lldb
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
// Require LLVM with DW_TAG_variant_part and a gdb and lldb that can
|
// Require a gdb or lldb that can read DW_TAG_variant_part.
|
||||||
// read it.
|
|
||||||
// min-system-llvm-version: 8.0
|
|
||||||
// min-gdb-version: 8.2
|
// min-gdb-version: 8.2
|
||||||
// rust-lldb
|
// rust-lldb
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// run-pass
|
// run-pass
|
||||||
// ignore-emscripten
|
// ignore-emscripten
|
||||||
// min-llvm-version 8.0
|
|
||||||
|
|
||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
#![feature(repr_simd, platform_intrinsics)]
|
#![feature(repr_simd, platform_intrinsics)]
|
||||||
|
|
Loading…
Reference in a new issue