From e4ef2cbf22155a6955fe9b6d17f4d1188f38daa0 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 5 Oct 2017 10:05:53 -0700 Subject: [PATCH] Support ISA-specific settings in the `--isa` command-line option. --- cranelift/src/utils.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cranelift/src/utils.rs b/cranelift/src/utils.rs index c9cae4cd58..b243b8953b 100644 --- a/cranelift/src/utils.rs +++ b/cranelift/src/utils.rs @@ -104,10 +104,14 @@ pub fn parse_sets_and_isa( let mut words = flag_isa.trim().split_whitespace(); // Look for `isa foo`. if let Some(isa_name) = words.next() { - let isa_builder = isa::lookup(isa_name).map_err(|err| match err { + let mut isa_builder = isa::lookup(isa_name).map_err(|err| match err { isa::LookupError::Unknown => format!("unknown ISA '{}'", isa_name), isa::LookupError::Unsupported => format!("support for ISA '{}' not enabled", isa_name), })?; + // Apply the ISA-specific settings to `isa_builder`. + parse_options(words, &mut isa_builder, &Location { line_number: 0 }) + .map_err(|err| err.to_string())?; + Ok(OwnedFlagsOrIsa::Isa( isa_builder.finish(settings::Flags::new(&flag_builder)), ))