Avoid "blacklist"
Other terms are more inclusive and precise. Clippy still has a lint named "blacklisted-name", but renaming it would be a breaking change, so is left for future work. The target configuration option "abi-blacklist" has been depreciated and renamed to "unsupported-abis". The old name continues to work.
This commit is contained in:
parent
1d919c9377
commit
1e567c1168
63 changed files with 111 additions and 107 deletions
|
@ -1,6 +1,6 @@
|
|||
The requested ABI is unsupported by the current target.
|
||||
|
||||
The rust compiler maintains for each target a blacklist of ABIs unsupported on
|
||||
The rust compiler maintains for each target a list of unsupported ABIs on
|
||||
that target. If an ABI is present in such a list this usually means that the
|
||||
target / ABI combination is currently unsupported by llvm.
|
||||
|
||||
|
|
|
@ -262,8 +262,8 @@ impl<'a> Resolver<'a> {
|
|||
}
|
||||
|
||||
let check_usable = |this: &mut Self, binding: &'a NameBinding<'a>| {
|
||||
if let Some(blacklisted_binding) = this.blacklisted_binding {
|
||||
if ptr::eq(binding, blacklisted_binding) {
|
||||
if let Some(unusable_binding) = this.unusable_binding {
|
||||
if ptr::eq(binding, unusable_binding) {
|
||||
return Err((Determined, Weak::No));
|
||||
}
|
||||
}
|
||||
|
@ -278,12 +278,12 @@ impl<'a> Resolver<'a> {
|
|||
return resolution
|
||||
.binding
|
||||
.and_then(|binding| {
|
||||
// If the primary binding is blacklisted, search further and return the shadowed
|
||||
// glob binding if it exists. What we really want here is having two separate
|
||||
// scopes in a module - one for non-globs and one for globs, but until that's done
|
||||
// use this hack to avoid inconsistent resolution ICEs during import validation.
|
||||
if let Some(blacklisted_binding) = self.blacklisted_binding {
|
||||
if ptr::eq(binding, blacklisted_binding) {
|
||||
// If the primary binding is unusable, search further and return the shadowed glob
|
||||
// binding if it exists. What we really want here is having two separate scopes in
|
||||
// a module - one for non-globs and one for globs, but until that's done use this
|
||||
// hack to avoid inconsistent resolution ICEs during import validation.
|
||||
if let Some(unusable_binding) = self.unusable_binding {
|
||||
if ptr::eq(binding, unusable_binding) {
|
||||
return resolution.shadowed_glob;
|
||||
}
|
||||
}
|
||||
|
@ -875,9 +875,9 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
|||
/// consolidate multiple unresolved import errors into a single diagnostic.
|
||||
fn finalize_import(&mut self, import: &'b Import<'b>) -> Option<UnresolvedImportError> {
|
||||
let orig_vis = import.vis.replace(ty::Visibility::Invisible);
|
||||
let orig_blacklisted_binding = match &import.kind {
|
||||
let orig_unusable_binding = match &import.kind {
|
||||
ImportKind::Single { target_bindings, .. } => {
|
||||
Some(mem::replace(&mut self.r.blacklisted_binding, target_bindings[TypeNS].get()))
|
||||
Some(mem::replace(&mut self.r.unusable_binding, target_bindings[TypeNS].get()))
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
|
@ -891,8 +891,8 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
|||
import.crate_lint(),
|
||||
);
|
||||
let no_ambiguity = self.r.ambiguity_errors.len() == prev_ambiguity_errors_len;
|
||||
if let Some(orig_blacklisted_binding) = orig_blacklisted_binding {
|
||||
self.r.blacklisted_binding = orig_blacklisted_binding;
|
||||
if let Some(orig_unusable_binding) = orig_unusable_binding {
|
||||
self.r.unusable_binding = orig_unusable_binding;
|
||||
}
|
||||
import.vis.set(orig_vis);
|
||||
if let PathResult::Failed { .. } | PathResult::NonModule(..) = path_res {
|
||||
|
@ -1013,8 +1013,8 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
|||
self.r.per_ns(|this, ns| {
|
||||
if !type_ns_only || ns == TypeNS {
|
||||
let orig_vis = import.vis.replace(ty::Visibility::Invisible);
|
||||
let orig_blacklisted_binding =
|
||||
mem::replace(&mut this.blacklisted_binding, target_bindings[ns].get());
|
||||
let orig_unusable_binding =
|
||||
mem::replace(&mut this.unusable_binding, target_bindings[ns].get());
|
||||
let orig_last_import_segment = mem::replace(&mut this.last_import_segment, true);
|
||||
let binding = this.resolve_ident_in_module(
|
||||
module,
|
||||
|
@ -1025,7 +1025,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
|||
import.span,
|
||||
);
|
||||
this.last_import_segment = orig_last_import_segment;
|
||||
this.blacklisted_binding = orig_blacklisted_binding;
|
||||
this.unusable_binding = orig_unusable_binding;
|
||||
import.vis.set(orig_vis);
|
||||
|
||||
match binding {
|
||||
|
@ -1291,8 +1291,8 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
|||
return;
|
||||
}
|
||||
|
||||
let orig_blacklisted_binding =
|
||||
mem::replace(&mut this.blacklisted_binding, target_bindings[ns].get());
|
||||
let orig_unusable_binding =
|
||||
mem::replace(&mut this.unusable_binding, target_bindings[ns].get());
|
||||
|
||||
match this.early_resolve_ident_in_lexical_scope(
|
||||
target,
|
||||
|
@ -1311,7 +1311,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
|||
Err(_) => is_redundant[ns] = Some(false),
|
||||
}
|
||||
|
||||
this.blacklisted_binding = orig_blacklisted_binding;
|
||||
this.unusable_binding = orig_unusable_binding;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -842,14 +842,14 @@ impl<'a, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||
report_error(self, ns);
|
||||
}
|
||||
Some(LexicalScopeBinding::Item(binding)) => {
|
||||
let orig_blacklisted_binding =
|
||||
replace(&mut self.r.blacklisted_binding, Some(binding));
|
||||
let orig_unusable_binding =
|
||||
replace(&mut self.r.unusable_binding, Some(binding));
|
||||
if let Some(LexicalScopeBinding::Res(..)) = self
|
||||
.resolve_ident_in_lexical_scope(ident, ns, None, use_tree.prefix.span)
|
||||
{
|
||||
report_error(self, ns);
|
||||
}
|
||||
self.r.blacklisted_binding = orig_blacklisted_binding;
|
||||
self.r.unusable_binding = orig_unusable_binding;
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
|
|
|
@ -867,7 +867,7 @@ pub struct Resolver<'a> {
|
|||
last_import_segment: bool,
|
||||
/// This binding should be ignored during in-module resolution, so that we don't get
|
||||
/// "self-confirming" import resolutions during import validation.
|
||||
blacklisted_binding: Option<&'a NameBinding<'a>>,
|
||||
unusable_binding: Option<&'a NameBinding<'a>>,
|
||||
|
||||
/// The idents for the primitive types.
|
||||
primitive_type_table: PrimitiveTypeTable,
|
||||
|
@ -1266,7 +1266,7 @@ impl<'a> Resolver<'a> {
|
|||
indeterminate_imports: Vec::new(),
|
||||
|
||||
last_import_segment: false,
|
||||
blacklisted_binding: None,
|
||||
unusable_binding: None,
|
||||
|
||||
primitive_type_table: PrimitiveTypeTable::new(),
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+neon,+fp-armv8,+apple-a7".to_string(),
|
||||
eliminate_frame_pointer: false,
|
||||
max_atomic_width: Some(128),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
forces_embed_bitcode: true,
|
||||
// Taken from a clang build on Xcode 11.4.1.
|
||||
// These arguments are not actually invoked - they just have
|
||||
|
|
|
@ -18,7 +18,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+neon,+fp-armv8,+apple-a7".to_string(),
|
||||
eliminate_frame_pointer: false,
|
||||
max_atomic_width: Some(128),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
forces_embed_bitcode: true,
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -15,6 +15,6 @@ pub fn target() -> TargetResult {
|
|||
target_env: String::new(),
|
||||
target_vendor: String::new(),
|
||||
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
||||
options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base },
|
||||
options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base },
|
||||
})
|
||||
}
|
||||
|
|
|
@ -20,6 +20,6 @@ pub fn target() -> TargetResult {
|
|||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base },
|
||||
options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base },
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ use crate::spec::{LinkerFlavor, Target, TargetResult};
|
|||
pub fn target() -> TargetResult {
|
||||
let mut base = super::cloudabi_base::opts();
|
||||
base.max_atomic_width = Some(128);
|
||||
base.abi_blacklist = super::arm_base::abi_blacklist();
|
||||
base.unsupported_abis = super::arm_base::unsupported_abis();
|
||||
base.linker = Some("aarch64-unknown-cloudabi-cc".to_string());
|
||||
|
||||
Ok(Target {
|
||||
|
|
|
@ -15,6 +15,6 @@ pub fn target() -> TargetResult {
|
|||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base },
|
||||
options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base },
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ use crate::spec::{LinkerFlavor, Target, TargetResult};
|
|||
pub fn target() -> TargetResult {
|
||||
let mut base = super::hermit_base::opts();
|
||||
base.max_atomic_width = Some(128);
|
||||
base.abi_blacklist = super::arm_base::abi_blacklist();
|
||||
base.unsupported_abis = super::arm_base::unsupported_abis();
|
||||
base.linker = Some("aarch64-hermit-gcc".to_string());
|
||||
|
||||
Ok(Target {
|
||||
|
|
|
@ -16,7 +16,7 @@ pub fn target() -> TargetResult {
|
|||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions {
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}_mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@ pub fn target() -> TargetResult {
|
|||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions {
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}_mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
|
|||
pub fn target() -> TargetResult {
|
||||
let mut base = super::netbsd_base::opts();
|
||||
base.max_atomic_width = Some(128);
|
||||
base.abi_blacklist = super::arm_base::abi_blacklist();
|
||||
base.unsupported_abis = super::arm_base::unsupported_abis();
|
||||
|
||||
Ok(Target {
|
||||
llvm_target: "aarch64-unknown-netbsd".to_string(),
|
||||
|
|
|
@ -18,7 +18,7 @@ pub fn target() -> Result<Target, String> {
|
|||
linker_is_gnu: true,
|
||||
max_atomic_width: Some(128),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
..Default::default()
|
||||
};
|
||||
Ok(Target {
|
||||
|
|
|
@ -18,7 +18,7 @@ pub fn target() -> Result<Target, String> {
|
|||
linker_is_gnu: true,
|
||||
max_atomic_width: Some(128),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
..Default::default()
|
||||
};
|
||||
Ok(Target {
|
||||
|
|
|
@ -3,7 +3,7 @@ use crate::spec::{LinkerFlavor, Target, TargetResult};
|
|||
pub fn target() -> TargetResult {
|
||||
let mut base = super::openbsd_base::opts();
|
||||
base.max_atomic_width = Some(128);
|
||||
base.abi_blacklist = super::arm_base::abi_blacklist();
|
||||
base.unsupported_abis = super::arm_base::unsupported_abis();
|
||||
|
||||
Ok(Target {
|
||||
llvm_target: "aarch64-unknown-openbsd".to_string(),
|
||||
|
|
|
@ -15,6 +15,6 @@ pub fn target() -> TargetResult {
|
|||
target_env: "gnu".to_string(),
|
||||
target_vendor: "wrs".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base },
|
||||
options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base },
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::spec::abi::Abi;
|
||||
|
||||
// All the calling conventions trigger an assertion(Unsupported calling convention) in llvm on arm
|
||||
pub fn abi_blacklist() -> Vec<Abi> {
|
||||
pub fn unsupported_abis() -> Vec<Abi> {
|
||||
vec![Abi::Stdcall, Abi::Fastcall, Abi::Vectorcall, Abi::Thiscall, Abi::Win64, Abi::SysV64]
|
||||
}
|
||||
|
|
|
@ -17,6 +17,6 @@ pub fn target() -> TargetResult {
|
|||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base },
|
||||
options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base },
|
||||
})
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> TargetResult {
|
|||
|
||||
options: TargetOptions {
|
||||
features: "+strict-align,+v6".to_string(),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> TargetResult {
|
|||
|
||||
options: TargetOptions {
|
||||
features: "+strict-align,+v6,+vfp2,-d32".to_string(),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -22,7 +22,7 @@ pub fn target() -> TargetResult {
|
|||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions {
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -22,7 +22,7 @@ pub fn target() -> TargetResult {
|
|||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions {
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -22,7 +22,7 @@ pub fn target() -> TargetResult {
|
|||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
emit_debug_gdb_scripts: false,
|
||||
..Default::default()
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@ pub fn target() -> TargetResult {
|
|||
panic_strategy: PanicStrategy::Abort,
|
||||
features: "+vfp3,-d32,-fp16".to_string(),
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
emit_debug_gdb_scripts: false,
|
||||
..Default::default()
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+soft-float,+strict-align".to_string(),
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+soft-float,+strict-align".to_string(),
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -21,7 +21,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+soft-float,+strict-align".to_string(),
|
||||
// Atomic operations provided by compiler-builtins
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> TargetResult {
|
|||
options: TargetOptions {
|
||||
features: "+v6,+vfp2,-d32".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> TargetResult {
|
|||
|
||||
options: TargetOptions {
|
||||
features: "+v6,+vfp2,-d32".to_string(),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "__mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> TargetResult {
|
|||
options: TargetOptions {
|
||||
features: "+v7,+vfp3,+neon".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
..base
|
||||
},
|
||||
})
|
||||
|
|
|
@ -25,6 +25,6 @@ pub fn target() -> TargetResult {
|
|||
target_env: String::new(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base },
|
||||
options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base },
|
||||
})
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ pub fn target() -> TargetResult {
|
|||
base.cpu = "cortex-a8".to_string();
|
||||
base.max_atomic_width = Some(64);
|
||||
base.features = "+v7,+vfp3,+neon".to_string();
|
||||
base.abi_blacklist = super::arm_base::abi_blacklist();
|
||||
base.unsupported_abis = super::arm_base::unsupported_abis();
|
||||
base.linker = Some("armv7-unknown-cloudabi-eabihf-cc".to_string());
|
||||
|
||||
Ok(Target {
|
||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> TargetResult {
|
|||
options: TargetOptions {
|
||||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -21,7 +21,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -22,7 +22,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -26,7 +26,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+v7,+thumb2,+soft-float,-neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -25,7 +25,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "__mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
..base
|
||||
},
|
||||
})
|
||||
|
|
|
@ -28,7 +28,7 @@ pub fn target() -> Result<Target, String> {
|
|||
disable_redzone: true,
|
||||
max_atomic_width: Some(64),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
emit_debug_gdb_scripts: false,
|
||||
..Default::default()
|
||||
};
|
||||
|
|
|
@ -16,7 +16,7 @@ pub fn target() -> Result<Target, String> {
|
|||
disable_redzone: true,
|
||||
max_atomic_width: Some(64),
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
emit_debug_gdb_scripts: false,
|
||||
..Default::default()
|
||||
};
|
||||
|
|
|
@ -22,7 +22,7 @@ pub fn target() -> TargetResult {
|
|||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
emit_debug_gdb_scripts: false,
|
||||
..Default::default()
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@ pub fn target() -> TargetResult {
|
|||
panic_strategy: PanicStrategy::Abort,
|
||||
features: "+vfp3,-d32,-fp16".to_string(),
|
||||
max_atomic_width: Some(32),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
emit_debug_gdb_scripts: false,
|
||||
..Default::default()
|
||||
},
|
||||
|
|
|
@ -17,7 +17,7 @@ pub fn target() -> TargetResult {
|
|||
options: TargetOptions {
|
||||
features: "+v7,+vfp4,+neon".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
..base
|
||||
},
|
||||
})
|
||||
|
|
|
@ -902,9 +902,10 @@ pub struct TargetOptions {
|
|||
/// Panic strategy: "unwind" or "abort"
|
||||
pub panic_strategy: PanicStrategy,
|
||||
|
||||
/// A blacklist of ABIs unsupported by the current target. Note that generic
|
||||
/// ABIs are considered to be supported on all platforms and cannot be blacklisted.
|
||||
pub abi_blacklist: Vec<Abi>,
|
||||
/// A list of ABIs unsupported by the current target. Note that generic ABIs
|
||||
/// are considered to be supported on all platforms and cannot be marked
|
||||
/// unsupported.
|
||||
pub unsupported_abis: Vec<Abi>,
|
||||
|
||||
/// Whether or not linking dylibs to a static CRT is allowed.
|
||||
pub crt_static_allows_dylibs: bool,
|
||||
|
@ -1056,7 +1057,7 @@ impl Default for TargetOptions {
|
|||
max_atomic_width: None,
|
||||
atomic_cas: true,
|
||||
panic_strategy: PanicStrategy::Unwind,
|
||||
abi_blacklist: vec![],
|
||||
unsupported_abis: vec![],
|
||||
crt_static_allows_dylibs: false,
|
||||
crt_static_default: false,
|
||||
crt_static_respected: false,
|
||||
|
@ -1125,7 +1126,7 @@ impl Target {
|
|||
}
|
||||
|
||||
pub fn is_abi_supported(&self, abi: Abi) -> bool {
|
||||
abi.generic() || !self.options.abi_blacklist.contains(&abi)
|
||||
abi.generic() || !self.options.unsupported_abis.contains(&abi)
|
||||
}
|
||||
|
||||
/// Loads a target descriptor from a JSON object.
|
||||
|
@ -1474,22 +1475,29 @@ impl Target {
|
|||
key!(llvm_args, list);
|
||||
key!(use_ctors_section, bool);
|
||||
|
||||
if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) {
|
||||
for name in array.iter().filter_map(|abi| abi.as_string()) {
|
||||
match lookup_abi(name) {
|
||||
Some(abi) => {
|
||||
if abi.generic() {
|
||||
// NB: The old name is deprecated, but support for it is retained for
|
||||
// compatibility.
|
||||
for name in ["abi-blacklist", "unsupported-abis"].iter() {
|
||||
if let Some(array) = obj.find(name).and_then(Json::as_array) {
|
||||
for name in array.iter().filter_map(|abi| abi.as_string()) {
|
||||
match lookup_abi(name) {
|
||||
Some(abi) => {
|
||||
if abi.generic() {
|
||||
return Err(format!(
|
||||
"The ABI \"{}\" is considered to be supported on all \
|
||||
targets and cannot be marked unsupported",
|
||||
abi
|
||||
));
|
||||
}
|
||||
|
||||
base.options.unsupported_abis.push(abi)
|
||||
}
|
||||
None => {
|
||||
return Err(format!(
|
||||
"The ABI \"{}\" is considered to be supported on \
|
||||
all targets and cannot be blacklisted",
|
||||
abi
|
||||
"Unknown ABI \"{}\" in target specification",
|
||||
name
|
||||
));
|
||||
}
|
||||
|
||||
base.options.abi_blacklist.push(abi)
|
||||
}
|
||||
None => {
|
||||
return Err(format!("Unknown ABI \"{}\" in target specification", name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1705,11 +1713,11 @@ impl ToJson for Target {
|
|||
target_option_val!(llvm_args);
|
||||
target_option_val!(use_ctors_section);
|
||||
|
||||
if default.abi_blacklist != self.options.abi_blacklist {
|
||||
if default.unsupported_abis != self.options.unsupported_abis {
|
||||
d.insert(
|
||||
"abi-blacklist".to_string(),
|
||||
"unsupported-abis".to_string(),
|
||||
self.options
|
||||
.abi_blacklist
|
||||
.unsupported_abis
|
||||
.iter()
|
||||
.map(|&name| Abi::name(name).to_json())
|
||||
.collect::<Vec<_>>()
|
||||
|
|
|
@ -55,7 +55,7 @@ pub fn target() -> TargetResult {
|
|||
|
||||
// FIXME: enable compilation tests for the target and
|
||||
// create the tests for this.
|
||||
abi_blacklist: vec![
|
||||
unsupported_abis: vec![
|
||||
Abi::Cdecl,
|
||||
Abi::Stdcall,
|
||||
Abi::Fastcall,
|
||||
|
|
|
@ -24,7 +24,7 @@ pub fn target() -> TargetResult {
|
|||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
abi_blacklist: super::riscv_base::abi_blacklist(),
|
||||
unsupported_abis: super::riscv_base::unsupported_abis(),
|
||||
..Default::default()
|
||||
},
|
||||
})
|
||||
|
|
|
@ -24,7 +24,7 @@ pub fn target() -> TargetResult {
|
|||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
abi_blacklist: super::riscv_base::abi_blacklist(),
|
||||
unsupported_abis: super::riscv_base::unsupported_abis(),
|
||||
..Default::default()
|
||||
},
|
||||
})
|
||||
|
|
|
@ -24,7 +24,7 @@ pub fn target() -> TargetResult {
|
|||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
emit_debug_gdb_scripts: false,
|
||||
abi_blacklist: super::riscv_base::abi_blacklist(),
|
||||
unsupported_abis: super::riscv_base::unsupported_abis(),
|
||||
..Default::default()
|
||||
},
|
||||
})
|
||||
|
|
|
@ -13,7 +13,7 @@ pub fn target() -> TargetResult {
|
|||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions {
|
||||
abi_blacklist: super::riscv_base::abi_blacklist(),
|
||||
unsupported_abis: super::riscv_base::unsupported_abis(),
|
||||
code_model: Some(CodeModel::Medium),
|
||||
cpu: "generic-rv64".to_string(),
|
||||
features: "+m,+a,+f,+d,+c".to_string(),
|
||||
|
|
|
@ -25,7 +25,7 @@ pub fn target() -> TargetResult {
|
|||
relocation_model: RelocModel::Static,
|
||||
code_model: Some(CodeModel::Medium),
|
||||
emit_debug_gdb_scripts: false,
|
||||
abi_blacklist: super::riscv_base::abi_blacklist(),
|
||||
unsupported_abis: super::riscv_base::unsupported_abis(),
|
||||
..Default::default()
|
||||
},
|
||||
})
|
||||
|
|
|
@ -25,7 +25,7 @@ pub fn target() -> TargetResult {
|
|||
relocation_model: RelocModel::Static,
|
||||
code_model: Some(CodeModel::Medium),
|
||||
emit_debug_gdb_scripts: false,
|
||||
abi_blacklist: super::riscv_base::abi_blacklist(),
|
||||
unsupported_abis: super::riscv_base::unsupported_abis(),
|
||||
..Default::default()
|
||||
},
|
||||
})
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::spec::abi::Abi;
|
|||
|
||||
// All the calling conventions trigger an assertion(Unsupported calling
|
||||
// convention) in llvm on RISCV
|
||||
pub fn abi_blacklist() -> Vec<Abi> {
|
||||
pub fn unsupported_abis() -> Vec<Abi> {
|
||||
vec![
|
||||
Abi::Cdecl,
|
||||
Abi::Stdcall,
|
||||
|
|
|
@ -41,7 +41,7 @@ pub fn opts() -> TargetOptions {
|
|||
// Similarly, one almost always never wants to use relocatable code because of the extra
|
||||
// costs it involves.
|
||||
relocation_model: RelocModel::Static,
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
// When this section is added a volatile load to its start address is also generated. This
|
||||
// volatile load is a footgun as it can end up loading an invalid memory address, depending
|
||||
// on how the user set up their linker scripts. This section adds pretty printer for stuff
|
||||
|
|
|
@ -37,7 +37,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+vfp3,+neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
..base
|
||||
},
|
||||
})
|
||||
|
|
|
@ -23,7 +23,7 @@ pub fn target() -> TargetResult {
|
|||
options: TargetOptions {
|
||||
features: "+vfp3,+neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
..base
|
||||
},
|
||||
})
|
||||
|
|
|
@ -25,6 +25,6 @@ pub fn target() -> TargetResult {
|
|||
target_env: "".to_string(),
|
||||
target_vendor: "unknown".to_string(),
|
||||
linker_flavor: LinkerFlavor::Gcc,
|
||||
options: TargetOptions { abi_blacklist: super::arm_base::abi_blacklist(), ..base },
|
||||
options: TargetOptions { unsupported_abis: super::arm_base::unsupported_abis(), ..base },
|
||||
})
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
..base
|
||||
},
|
||||
})
|
||||
|
|
|
@ -29,7 +29,7 @@ pub fn target() -> TargetResult {
|
|||
features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".to_string(),
|
||||
cpu: "generic".to_string(),
|
||||
max_atomic_width: Some(64),
|
||||
abi_blacklist: super::arm_base::abi_blacklist(),
|
||||
unsupported_abis: super::arm_base::unsupported_abis(),
|
||||
target_mcount: "\u{1}mcount".to_string(),
|
||||
..base
|
||||
},
|
||||
|
|
|
@ -283,7 +283,7 @@ pub struct Config {
|
|||
pub mds_beacon_interval: String,
|
||||
pub mds_beacon_grace: String,
|
||||
pub mds_enforce_unique_name: String,
|
||||
pub mds_blacklist_interval: String,
|
||||
pub mds_interval: String,
|
||||
pub mds_session_timeout: String,
|
||||
pub mds_freeze_tree_timeout: String,
|
||||
pub mds_session_autoclose: String,
|
||||
|
|
|
@ -401,7 +401,7 @@ fn configure_lldb(config: &Config) -> Option<Config> {
|
|||
}
|
||||
|
||||
if let Some(lldb_version) = config.lldb_version.as_ref() {
|
||||
if is_blacklisted_lldb_version(&lldb_version) {
|
||||
if lldb_version == "350" {
|
||||
println!(
|
||||
"WARNING: The used version of LLDB ({}) has a \
|
||||
known issue that breaks debuginfo tests. See \
|
||||
|
@ -979,7 +979,3 @@ fn extract_lldb_version(full_version_line: Option<String>) -> (Option<String>, b
|
|||
}
|
||||
(None, false)
|
||||
}
|
||||
|
||||
fn is_blacklisted_lldb_version(version: &str) -> bool {
|
||||
version == "350"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue