Add quick_analysis option & disable auto_force_files by default

This commit is contained in:
Luke Street 2023-08-10 00:05:33 -04:00
parent 33a026d0c7
commit 522909907c
1 changed files with 14 additions and 7 deletions

View File

@ -121,6 +121,10 @@ pub struct ProjectConfig {
/// Version of the MW `.comment` section format. /// Version of the MW `.comment` section format.
/// If not present, no `.comment` sections will be written. /// If not present, no `.comment` sections will be written.
pub mw_comment_version: Option<u8>, pub mw_comment_version: Option<u8>,
/// Disables some time-consuming analysis passes.
/// Useful when the symbols file is already created.
#[serde(default)]
pub quick_analysis: bool,
#[serde(default)] #[serde(default)]
pub modules: Vec<ModuleConfig>, pub modules: Vec<ModuleConfig>,
// Analysis options // Analysis options
@ -130,7 +134,8 @@ pub struct ProjectConfig {
pub detect_strings: bool, pub detect_strings: bool,
#[serde(default = "bool_true")] #[serde(default = "bool_true")]
pub write_asm: bool, pub write_asm: bool,
#[serde(default = "bool_true")] /// Adds all objects to FORCEFILES in the linker script.
#[serde(default)]
pub auto_force_files: bool, pub auto_force_files: bool,
} }
@ -325,6 +330,7 @@ fn split(args: SplitArgs) -> Result<()> {
} }
} }
if !config.quick_analysis {
log::info!("Detecting function boundaries"); log::info!("Detecting function boundaries");
state.detect_functions(&obj)?; state.detect_functions(&obj)?;
log::info!("Discovered {} functions", state.function_slices.len()); log::info!("Discovered {} functions", state.function_slices.len());
@ -332,6 +338,7 @@ fn split(args: SplitArgs) -> Result<()> {
FindTRKInterruptVectorTable::execute(&mut state, &obj)?; FindTRKInterruptVectorTable::execute(&mut state, &obj)?;
FindSaveRestSleds::execute(&mut state, &obj)?; FindSaveRestSleds::execute(&mut state, &obj)?;
state.apply(&mut obj)?; state.apply(&mut obj)?;
}
apply_signatures_post(&mut obj)?; apply_signatures_post(&mut obj)?;