Skip to content

Commit 5be2b89

Browse files
committed
rollup merge of #22191: nagisa/target-ptr-width-json
This aligns json target specification to match terminology used elsewhere in the code base. [breaking-change] for custom target json users. Change all appearances of target-word-size to target-pointer-width.
2 parents 311fc36 + 6f5944b commit 5be2b89

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/librustc/session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ pub fn build_target_config(opts: &Options, sp: &SpanHandler) -> Config {
645645
"32" => (ast::TyI32, ast::TyU32),
646646
"64" => (ast::TyI64, ast::TyU64),
647647
w => sp.handler().fatal(&format!("target specification was invalid: unrecognized \
648-
target-word-size {}", w)[])
648+
target-pointer-width {}", w)[])
649649
};
650650

651651
Config {

src/librustc_back/target/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
//! this module defines the format the JSON file should take, though each
4141
//! underscore in the field names should be replaced with a hyphen (`-`) in the
4242
//! JSON file. Some fields are required in every target specification, such as
43-
//! `data-layout`, `llvm-target`, `target-endian`, `target-word-size`, and
43+
//! `data-layout`, `llvm-target`, `target-endian`, `target-pointer-width`, and
4444
//! `arch`. In general, options passed to rustc with `-C` override the target's
4545
//! settings, though `target-feature` and `link-args` will *add* to the list
4646
//! specified by the target, rather than replace.
@@ -241,7 +241,7 @@ impl Target {
241241
data_layout: get_req_field("data-layout"),
242242
llvm_target: get_req_field("llvm-target"),
243243
target_endian: get_req_field("target-endian"),
244-
target_pointer_width: get_req_field("target-word-size"),
244+
target_pointer_width: get_req_field("target-pointer-width"),
245245
arch: get_req_field("arch"),
246246
target_os: get_req_field("os"),
247247
options: Default::default(),

src/test/run-make/target-specs/my-awesome-platform.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"data-layout": "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32",
33
"llvm-target": "i686-unknown-linux-gnu",
44
"target-endian": "little",
5-
"target-word-size": "32",
5+
"target-pointer-width": "32",
66
"arch": "x86",
77
"os": "linux",
88
"morestack": false

src/test/run-make/target-specs/my-incomplete-platform.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"data-layout": "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32",
33
"target-endian": "little",
4-
"target-word-size": "32",
4+
"target-pointer-width": "32",
55
"arch": "x86",
66
"os": "foo",
77
"morestack": false

src/test/run-make/target-specs/x86_64-unknown-linux-gnu.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"data-layout": "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128",
44
"llvm-target": "x86_64-unknown-linux-gnu",
55
"target-endian": "little",
6-
"target-word-size": "64",
6+
"target-pointer-width": "64",
77
"arch": "x86_64",
88
"os": "linux",
99
"morestack": false

0 commit comments

Comments
 (0)