From b476f823d4fa3a2b0a407db4ddebbf1531ce8d01 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 7 Nov 2018 14:25:03 -0800 Subject: [PATCH] Update to target_lexicon 0.2.0. --- cranelift/Cargo.toml | 2 +- cranelift/fuzz/Cargo.toml | 2 +- lib/codegen/Cargo.toml | 2 +- lib/codegen/src/isa/call_conv.rs | 26 ++++++-------------------- lib/faerie/Cargo.toml | 4 ++-- lib/frontend/Cargo.toml | 2 +- lib/native/Cargo.toml | 2 +- lib/reader/Cargo.toml | 2 +- lib/simplejit/Cargo.toml | 2 +- lib/wasm/Cargo.toml | 2 +- 10 files changed, 16 insertions(+), 30 deletions(-) diff --git a/cranelift/Cargo.toml b/cranelift/Cargo.toml index e347ce3efc..e401e954c5 100644 --- a/cranelift/Cargo.toml +++ b/cranelift/Cargo.toml @@ -33,7 +33,7 @@ serde = "1.0.8" term = "0.5.1" capstone = { version = "0.5.0", optional = true } wabt = { version = "0.7.0", optional = true } -target-lexicon = "0.0.3" +target-lexicon = "0.2.0" pretty_env_logger = "0.2.4" file-per-thread-logger = "0.1.1" diff --git a/cranelift/fuzz/Cargo.toml b/cranelift/fuzz/Cargo.toml index 3c2930ae07..a78d0ed3fc 100644 --- a/cranelift/fuzz/Cargo.toml +++ b/cranelift/fuzz/Cargo.toml @@ -14,7 +14,7 @@ libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" } cranelift-codegen = { path = "../lib/codegen" } cranelift-wasm = { path = "../lib/wasm" } cranelift-reader = { path = "../lib/reader" } -target-lexicon = "0.0.3" +target-lexicon = "0.2.0" # Prevent this from interfering with workspaces [workspace] diff --git a/lib/codegen/Cargo.toml b/lib/codegen/Cargo.toml index 7c1d2d0e9a..baaa059f3f 100644 --- a/lib/codegen/Cargo.toml +++ b/lib/codegen/Cargo.toml @@ -17,7 +17,7 @@ cranelift-bforest = { path = "../bforest", version = "0.22.0", default-features failure = { version = "0.1.1", default-features = false, features = ["derive"] } failure_derive = { version = "0.1.1", default-features = false } hashmap_core = { version = "0.1.9", optional = true } -target-lexicon = { version = "0.0.3", default-features = false } +target-lexicon = { version = "0.2.0", default-features = false } log = { version = "0.4.4", default-features = false } # It is a goal of the cranelift-codegen crate to have minimal external dependencies. # Please don't add any unless they are essential to the task of creating binary diff --git a/lib/codegen/src/isa/call_conv.rs b/lib/codegen/src/isa/call_conv.rs index ce5b10b315..0fe242b958 100644 --- a/lib/codegen/src/isa/call_conv.rs +++ b/lib/codegen/src/isa/call_conv.rs @@ -1,6 +1,6 @@ use std::fmt; use std::str; -use target_lexicon::{OperatingSystem, Triple}; +use target_lexicon::{CallingConvention, Triple}; /// Calling convention identifiers. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -22,25 +22,11 @@ pub enum CallConv { impl CallConv { /// Return the default calling convention for the given target triple. pub fn default_for_triple(triple: &Triple) -> Self { - match triple.operating_system { - OperatingSystem::Unknown - | OperatingSystem::Bitrig - | OperatingSystem::Cloudabi - | OperatingSystem::Darwin - | OperatingSystem::Dragonfly - | OperatingSystem::Freebsd - | OperatingSystem::Fuchsia - | OperatingSystem::Haiku - | OperatingSystem::Ios - | OperatingSystem::L4re - | OperatingSystem::Linux - | OperatingSystem::Nebulet - | OperatingSystem::Netbsd - | OperatingSystem::Openbsd - | OperatingSystem::Redox - | OperatingSystem::Solaris => CallConv::SystemV, - OperatingSystem::Windows => CallConv::WindowsFastcall, - os => panic!("unsupported operating system: {}", os), + match triple.default_calling_convention() { + // Default to System V for unknown targets because most everything + // uses System V. + Ok(CallingConvention::SystemV) | Err(()) => CallConv::SystemV, + Ok(CallingConvention::WindowsFastcall) => CallConv::WindowsFastcall, } } } diff --git a/lib/faerie/Cargo.toml b/lib/faerie/Cargo.toml index 7b84b67fa6..40f60549e1 100644 --- a/lib/faerie/Cargo.toml +++ b/lib/faerie/Cargo.toml @@ -11,10 +11,10 @@ readme = "README.md" [dependencies] cranelift-codegen = { path = "../codegen", version = "0.22.0" } cranelift-module = { path = "../module", version = "0.22.0" } -faerie = "0.5.0" +faerie = "0.6.0" goblin = "0.0.19" failure = "0.1.2" -target-lexicon = "0.0.3" +target-lexicon = "0.2.0" [badges] maintenance = { status = "experimental" } diff --git a/lib/frontend/Cargo.toml b/lib/frontend/Cargo.toml index 269f085a57..000c759438 100644 --- a/lib/frontend/Cargo.toml +++ b/lib/frontend/Cargo.toml @@ -11,7 +11,7 @@ readme = "README.md" [dependencies] cranelift-codegen = { path = "../codegen", version = "0.22.0", default-features = false } -target-lexicon = { version = "0.0.3", default-features = false } +target-lexicon = { version = "0.2.0", default-features = false } log = { version = "0.4.4", default-features = false } hashmap_core = { version = "0.1.9", optional = true } diff --git a/lib/native/Cargo.toml b/lib/native/Cargo.toml index 58a5234d59..5c680720dd 100644 --- a/lib/native/Cargo.toml +++ b/lib/native/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" [dependencies] cranelift-codegen = { path = "../codegen", version = "0.22.0", default-features = false } -target-lexicon = { version = "0.0.3", default-features = false } +target-lexicon = { version = "0.2.0", default-features = false } [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] raw-cpuid = "6.0.0" diff --git a/lib/reader/Cargo.toml b/lib/reader/Cargo.toml index 878520a472..1158ecaa06 100644 --- a/lib/reader/Cargo.toml +++ b/lib/reader/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" [dependencies] cranelift-codegen = { path = "../codegen", version = "0.22.0" } -target-lexicon = "0.0.3" +target-lexicon = "0.2.0" [badges] maintenance = { status = "experimental" } diff --git a/lib/simplejit/Cargo.toml b/lib/simplejit/Cargo.toml index 4d85eb1bce..9046a16dee 100644 --- a/lib/simplejit/Cargo.toml +++ b/lib/simplejit/Cargo.toml @@ -16,7 +16,7 @@ cranelift-native = { path = "../native", version = "0.22.0", default-features = region = "1.0.0" libc = { version = "0.2.42", default-features = false } errno = "0.2.4" -target-lexicon = { version = "0.0.3", default-features = false } +target-lexicon = { version = "0.2.0", default-features = false } [target.'cfg(target_os = "windows")'.dependencies] winapi = { version = "0.3", features = ["winbase", "memoryapi"] } diff --git a/lib/wasm/Cargo.toml b/lib/wasm/Cargo.toml index e674945ac2..ee2b1e45f1 100644 --- a/lib/wasm/Cargo.toml +++ b/lib/wasm/Cargo.toml @@ -21,7 +21,7 @@ log = { version = "0.4.4", default-features = false } [dev-dependencies] wabt = "0.7.0" -target-lexicon = "0.0.3" +target-lexicon = "0.2.0" [features] default = ["std"]