1
Fork 0

Replace target.target with target and target.ptr_width with target.pointer_width

Preparation for a subsequent change that replaces
rustc_target::config::Config with its wrapped Target.

On its own, this commit breaks the build. I don't like making
build-breaking commits, but in this instance I believe that it
makes review easier, as the "real" changes of this PR can be
seen much more easily.

Result of running:

find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \;
./x.py fmt
This commit is contained in:
est31 2020-10-15 11:44:00 +02:00
parent 0d1aa1e034
commit 4fa5578774
50 changed files with 224 additions and 240 deletions

View file

@ -1079,7 +1079,7 @@ impl<'tcx> TyCtxt<'tcx> {
crate_name: &str,
output_filenames: &OutputFilenames,
) -> GlobalCtxt<'tcx> {
let data_layout = TargetDataLayout::parse(&s.target.target).unwrap_or_else(|err| {
let data_layout = TargetDataLayout::parse(&s.target).unwrap_or_else(|err| {
s.fatal(&err);
});
let interners = CtxtInterners::new(arena);
@ -1522,7 +1522,7 @@ impl<'tcx> TyCtxt<'tcx> {
/// Determines whether identifiers in the assembly have strict naming rules.
/// Currently, only NVPTX* targets need it.
pub fn has_strict_asm_symbol_naming(self) -> bool {
self.sess.target.target.arch.contains("nvptx")
self.sess.target.arch.contains("nvptx")
}
/// Returns `&'static core::panic::Location<'static>`.

View file

@ -106,7 +106,7 @@ impl IntegerExt for Integer {
}
if repr.c() {
match &tcx.sess.target.target.arch[..] {
match &tcx.sess.target.arch[..] {
// WARNING: the ARM EABI has two variants; the one corresponding
// to `at_least == I32` appears to be used on Linux and NetBSD,
// but some systems may use the variant corresponding to no
@ -2548,7 +2548,7 @@ where
let sig = cx.tcx().normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
use rustc_target::spec::abi::Abi::*;
let conv = match cx.tcx().sess.target.target.adjust_abi(sig.abi) {
let conv = match cx.tcx().sess.target.adjust_abi(sig.abi) {
RustIntrinsic | PlatformIntrinsic | Rust | RustCall => Conv::Rust,
// It's the ABI's job to select this, not ours.
@ -2600,7 +2600,7 @@ where
extra_args.to_vec()
};
let target = &cx.tcx().sess.target.target;
let target = &cx.tcx().sess.target;
let target_env_gnu_like = matches!(&target.target_env[..], "gnu" | "musl");
let win_x64_gnu =
target.target_os == "windows" && target.arch == "x86_64" && target.target_env == "gnu";
@ -2775,7 +2775,7 @@ where
// anyway, we control all calls to it in libstd.
Abi::Vector { .. }
if abi != SpecAbi::PlatformIntrinsic
&& cx.tcx().sess.target.target.options.simd_types_indirect =>
&& cx.tcx().sess.target.options.simd_types_indirect =>
{
arg.make_indirect();
return;