Rename target triple to target tuple in many places in the compiler

This changes the naming to the new naming, used by `--print
target-tuple`.
It does not change all locations, but many.
This commit is contained in:
Noratrieb
2024-10-17 19:02:32 +02:00
parent 77d0b4ddfb
commit a26450cf81
32 changed files with 167 additions and 168 deletions

View File

@@ -26,7 +26,7 @@ use rustc_span::{
FileName, FileNameDisplayPreference, RealFileName, SourceFileHashAlgorithm, Symbol, sym,
};
use rustc_target::spec::{
FramePointer, LinkSelfContainedComponents, LinkerFeatures, SplitDebuginfo, Target, TargetTriple,
FramePointer, LinkSelfContainedComponents, LinkerFeatures, SplitDebuginfo, Target, TargetTuple,
};
use tracing::debug;
@@ -1116,7 +1116,7 @@ bitflags::bitflags! {
}
}
pub fn host_triple() -> &'static str {
pub fn host_tuple() -> &'static str {
// Get the host triple out of the build environment. This ensures that our
// idea of the host triple is the same as for the set of libraries we've
// actually built. We can't just take LLVM's host triple because they
@@ -1158,7 +1158,7 @@ impl Default for Options {
output_types: OutputTypes(BTreeMap::new()),
search_paths: vec![],
maybe_sysroot: None,
target_triple: TargetTriple::from_triple(host_triple()),
target_triple: TargetTuple::from_tuple(host_tuple()),
test: false,
incremental: None,
untracked_state_hash: Default::default(),
@@ -1354,7 +1354,7 @@ pub fn build_target_config(early_dcx: &EarlyDiagCtxt, opts: &Options, sysroot: &
// rust-lang/compiler-team#695. Warn unconditionally on usage to
// raise awareness of the renaming. This code will be deleted in
// October 2024.
if opts.target_triple.triple() == "wasm32-wasi" {
if opts.target_triple.tuple() == "wasm32-wasi" {
early_dcx.early_warn(
"the `wasm32-wasi` target is being renamed to \
`wasm32-wasip1` and the `wasm32-wasi` target will be \
@@ -2030,16 +2030,16 @@ fn collect_print_requests(
prints
}
pub fn parse_target_triple(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches) -> TargetTriple {
pub fn parse_target_triple(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches) -> TargetTuple {
match matches.opt_str("target") {
Some(target) if target.ends_with(".json") => {
let path = Path::new(&target);
TargetTriple::from_path(path).unwrap_or_else(|_| {
TargetTuple::from_path(path).unwrap_or_else(|_| {
early_dcx.early_fatal(format!("target file {path:?} does not exist"))
})
}
Some(target) => TargetTriple::TargetTriple(target),
_ => TargetTriple::from_triple(host_triple()),
Some(target) => TargetTuple::TargetTuple(target),
_ => TargetTuple::from_tuple(host_tuple()),
}
}
@@ -3005,7 +3005,7 @@ pub(crate) mod dep_tracking {
use rustc_span::edition::Edition;
use rustc_target::spec::{
CodeModel, FramePointer, MergeFunctions, OnBrokenPipe, PanicStrategy, RelocModel,
RelroLevel, SanitizerSet, SplitDebuginfo, StackProtector, SymbolVisibility, TargetTriple,
RelroLevel, SanitizerSet, SplitDebuginfo, StackProtector, SymbolVisibility, TargetTuple,
TlsModel, WasmCAbi,
};
@@ -3090,7 +3090,7 @@ pub(crate) mod dep_tracking {
SanitizerSet,
CFGuard,
CFProtection,
TargetTriple,
TargetTuple,
Edition,
LinkerPluginLto,
ResolveDocLinks,