Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cli) Remove the --backend deprecated option #2369

Merged
merged 1 commit into from
May 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 4 additions & 28 deletions lib/cli/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
//! commands.

use crate::common::WasmFeatures;
use anyhow::{Error, Result};
use anyhow::Result;
use clap::Clap;
use std::path::PathBuf;
use std::str::FromStr;
use std::string::ToString;
#[allow(unused_imports)]
use std::sync::Arc;
Expand Down Expand Up @@ -36,15 +35,15 @@ pub struct StoreOptions {
/// The compiler options
pub struct CompilerOptions {
/// Use Singlepass compiler.
#[clap(long, conflicts_with_all = &["cranelift", "llvm", "backend"])]
#[clap(long, conflicts_with_all = &["cranelift", "llvm"])]
singlepass: bool,

/// Use Cranelift compiler.
#[clap(long, conflicts_with_all = &["singlepass", "llvm", "backend"])]
#[clap(long, conflicts_with_all = &["singlepass", "llvm"])]
cranelift: bool,

/// Use LLVM compiler.
#[clap(long, conflicts_with_all = &["singlepass", "cranelift", "backend"])]
#[clap(long, conflicts_with_all = &["singlepass", "cranelift"])]
llvm: bool,

/// Enable compiler internal verification.
Expand All @@ -55,10 +54,6 @@ pub struct CompilerOptions {
#[clap(long, parse(from_os_str))]
llvm_debug_dir: Option<PathBuf>,

/// The deprecated backend flag - Please do not use
#[clap(long = "backend", hidden = true, conflicts_with_all = &["singlepass", "cranelift", "llvm"])]
backend: Option<String>,

#[clap(flatten)]
features: WasmFeatures,
}
Expand All @@ -72,12 +67,6 @@ impl CompilerOptions {
Ok(CompilerType::LLVM)
} else if self.singlepass {
Ok(CompilerType::Singlepass)
} else if let Some(backend) = self.backend.clone() {
warning!(
"the `--backend={0}` flag is deprecated, please use `--{0}` instead",
backend
);
CompilerType::from_str(&backend)
} else {
// Auto mode, we choose the best compiler for that platform
cfg_if::cfg_if! {
Expand Down Expand Up @@ -344,19 +333,6 @@ impl ToString for CompilerType {
}
}

impl FromStr for CompilerType {
type Err = Error;
fn from_str(s: &str) -> Result<Self> {
match s {
"singlepass" => Ok(Self::Singlepass),
"cranelift" => Ok(Self::Cranelift),
"llvm" => Ok(Self::LLVM),
"headless" => Ok(Self::Headless),
backend => bail!("The `{}` compiler does not exist.", backend),
}
}
}

/// The engine used for the store
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum EngineType {
Expand Down