Skip to content

Commit

Permalink
Add the new description field to Target::to_json, and add description…
Browse files Browse the repository at this point in the history
…s for some MSVC targets
  • Loading branch information
dpaoliello committed Mar 7, 2024
1 parent 1c580bc commit 72135fc
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3251,6 +3251,7 @@ impl ToJson for Target {
}

target_val!(llvm_target);
target_val!(description);
d.insert("target-pointer-width".to_string(), self.pointer_width.to_string().to_json());
target_val!(arch);
target_val!(data_layout);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::spec::{base, Target};
use std::borrow::Cow;

pub fn target() -> Target {
let mut base = base::windows_msvc::opts();
Expand All @@ -7,7 +8,7 @@ pub fn target() -> Target {

Target {
llvm_target: "aarch64-pc-windows-msvc".into(),
description: None,
description: Some(Cow::Borrowed("ARM64 Windows MSVC")),
pointer_width: 64,
data_layout: "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128".into(),
arch: "aarch64".into(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::spec::{base, LinkerFlavor, Lld, SanitizerSet, Target};
use std::borrow::Cow;

pub fn target() -> Target {
let mut base = base::windows_msvc::opts();
Expand All @@ -23,7 +24,7 @@ pub fn target() -> Target {

Target {
llvm_target: "i686-pc-windows-msvc".into(),
description: None,
description: Some(Cow::Borrowed("32-bit MSVC (Windows 7+)")),
pointer_width: 32,
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::spec::{base, LinkerFlavor, Lld, Target};
use std::borrow::Cow;

pub fn target() -> Target {
let mut base = base::windows_msvc::opts();
Expand All @@ -23,7 +24,7 @@ pub fn target() -> Target {

Target {
llvm_target: "i686-pc-windows-msvc".into(),
description: None,
description: Some(Cow::Borrowed("32-bit Windows 7 support")),
pointer_width: 32,
data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::spec::{base, LinkerFlavor, Lld, PanicStrategy, Target, TargetOptions};
use std::borrow::Cow;

pub fn target() -> Target {
let mut base = base::windows_msvc::opts();
Expand All @@ -13,7 +14,7 @@ pub fn target() -> Target {

Target {
llvm_target: "thumbv7a-pc-windows-msvc".into(),
description: None,
description: Some(Cow::Borrowed("ARM64 Windows MSVC")),
pointer_width: 32,
data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
arch: "arm".into(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::spec::{base, SanitizerSet, Target};
use std::borrow::Cow;

pub fn target() -> Target {
let mut base = base::windows_msvc::opts();
Expand All @@ -10,7 +11,7 @@ pub fn target() -> Target {

Target {
llvm_target: "x86_64-pc-windows-msvc".into(),
description: None,
description: Some(Cow::Borrowed("64-bit MSVC (Windows 7+)")),
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::spec::{base, Target};
use std::borrow::Cow;

pub fn target() -> Target {
let mut base = base::windows_msvc::opts();
Expand All @@ -9,7 +10,7 @@ pub fn target() -> Target {

Target {
llvm_target: "x86_64-win7-windows-msvc".into(),
description: None,
description: Some(Cow::Borrowed("64-bit Windows 7 support")),
pointer_width: 64,
data_layout:
"e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
Expand Down

0 comments on commit 72135fc

Please sign in to comment.