Change name of debug options struct

This commit is contained in:
greg 2018-07-15 15:01:50 -07:00
parent 82502ad0ad
commit 4ca57e4aea
3 changed files with 8 additions and 8 deletions

View File

@ -7,7 +7,7 @@ pub struct LLVMCodeString(pub String);
#[derive(Debug, Default, Serialize, Deserialize)] #[derive(Debug, Default, Serialize, Deserialize)]
pub struct EvalOptions { pub struct EvalOptions {
pub execution_method: ExecutionMethod, pub execution_method: ExecutionMethod,
pub debug_passes: HashMap<String, PassDebugDescriptor>, pub debug_passes: HashMap<String, PassDebugOptionsDescriptor>,
} }
#[derive(Debug, Hash, PartialEq)] #[derive(Debug, Hash, PartialEq)]
@ -17,7 +17,7 @@ pub struct PassDescriptor {
} }
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
pub struct PassDebugDescriptor { pub struct PassDebugOptionsDescriptor {
pub opts: Vec<String>, pub opts: Vec<String>,
} }
@ -164,12 +164,12 @@ macro_rules! pass_chain {
macro_rules! pass_chain_helper { macro_rules! pass_chain_helper {
(($state:expr, $comp:expr, $options:expr); $input:expr, $pass:path $(, $rest:path)*) => { (($state:expr, $comp:expr, $options:expr); $input:expr, $pass:path $(, $rest:path)*) => {
{ {
use schala_repl::PassDebugDescriptor; use schala_repl::PassDebugOptionsDescriptor;
let pass_name = stringify!($pass); let pass_name = stringify!($pass);
let output = { let output = {
let ref debug_map = $options.debug_passes; let ref debug_map = $options.debug_passes;
let debug_handle = match debug_map.get(pass_name) { let debug_handle = match debug_map.get(pass_name) {
Some(PassDebugDescriptor { opts }) => { //(Some(&mut $comp), Some(opts.clone())), Some(PassDebugOptionsDescriptor { opts }) => { //(Some(&mut $comp), Some(opts.clone())),
let ptr = &mut $comp; let ptr = &mut $comp;
ptr.cur_debug_options = opts.clone(); ptr.cur_debug_options = opts.clone();
Some(ptr) Some(ptr)

View File

@ -34,7 +34,7 @@ const VERSION_STRING: &'static str = "0.1.0";
include!(concat!(env!("OUT_DIR"), "/static.rs")); include!(concat!(env!("OUT_DIR"), "/static.rs"));
pub use language::{LLVMCodeString, ProgrammingLanguageInterface, EvalOptions, pub use language::{LLVMCodeString, ProgrammingLanguageInterface, EvalOptions,
ExecutionMethod, TraceArtifact, FinishedComputation, UnfinishedComputation, PassDebugDescriptor, PassDescriptor}; ExecutionMethod, TraceArtifact, FinishedComputation, UnfinishedComputation, PassDebugOptionsDescriptor, PassDescriptor};
pub type PLIGenerator = Box<Fn() -> Box<ProgrammingLanguageInterface> + Send + Sync>; pub type PLIGenerator = Box<Fn() -> Box<ProgrammingLanguageInterface> + Send + Sync>;
@ -113,7 +113,7 @@ fn run_noninteractive(filename: &str, languages: Vec<Box<ProgrammingLanguageInte
for pass in debug_passes.into_iter() { for pass in debug_passes.into_iter() {
if let Some(_) = language.get_passes().iter().find(|desc| desc.name == pass) { if let Some(_) = language.get_passes().iter().find(|desc| desc.name == pass) {
options.debug_passes.insert(pass, PassDebugDescriptor { opts: vec![] }); options.debug_passes.insert(pass, PassDebugOptionsDescriptor { opts: vec![] });
} }
} }
@ -453,7 +453,7 @@ impl Repl {
} }
let msg = format!("{} debug for pass {}", if show { "Enabling" } else { "Disabling" }, debug_pass); let msg = format!("{} debug for pass {}", if show { "Enabling" } else { "Disabling" }, debug_pass);
if show { if show {
self.options.debug_passes.insert(desc.name.clone(), PassDebugDescriptor { opts }); self.options.debug_passes.insert(desc.name.clone(), PassDebugOptionsDescriptor { opts });
} else { } else {
self.options.debug_passes.remove(&desc.name); self.options.debug_passes.remove(&desc.name);
} }