Change name of debug options struct
This commit is contained in:
parent
82502ad0ad
commit
4ca57e4aea
@ -7,7 +7,7 @@ pub struct LLVMCodeString(pub String);
|
||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
||||
pub struct EvalOptions {
|
||||
pub execution_method: ExecutionMethod,
|
||||
pub debug_passes: HashMap<String, PassDebugDescriptor>,
|
||||
pub debug_passes: HashMap<String, PassDebugOptionsDescriptor>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Hash, PartialEq)]
|
||||
@ -17,7 +17,7 @@ pub struct PassDescriptor {
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct PassDebugDescriptor {
|
||||
pub struct PassDebugOptionsDescriptor {
|
||||
pub opts: Vec<String>,
|
||||
}
|
||||
|
||||
@ -164,12 +164,12 @@ macro_rules! pass_chain {
|
||||
macro_rules! pass_chain_helper {
|
||||
(($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 output = {
|
||||
let ref debug_map = $options.debug_passes;
|
||||
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;
|
||||
ptr.cur_debug_options = opts.clone();
|
||||
Some(ptr)
|
||||
|
@ -34,7 +34,7 @@ const VERSION_STRING: &'static str = "0.1.0";
|
||||
include!(concat!(env!("OUT_DIR"), "/static.rs"));
|
||||
|
||||
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>;
|
||||
|
||||
@ -113,7 +113,7 @@ fn run_noninteractive(filename: &str, languages: Vec<Box<ProgrammingLanguageInte
|
||||
|
||||
for pass in debug_passes.into_iter() {
|
||||
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);
|
||||
if show {
|
||||
self.options.debug_passes.insert(desc.name.clone(), PassDebugDescriptor { opts });
|
||||
self.options.debug_passes.insert(desc.name.clone(), PassDebugOptionsDescriptor { opts });
|
||||
} else {
|
||||
self.options.debug_passes.remove(&desc.name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user