Skip to content

Commit

Permalink
chore: remove warnings field from DebugArtifact (#5118)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

I'm not sure why the SSA warnings were ever added onto the
`DebugArtifact` but we don't use it at all so we can just remove them
(which avoids a dependency on `noirc_evaluator`)

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
TomAFrench authored May 28, 2024
1 parent 70f374c commit 33c2b6b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 34 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions tooling/debugger/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,7 @@ mod tests {

let debug_symbols = vec![];
let file_map = BTreeMap::new();
let warnings = vec![];
let debug_artifact = &DebugArtifact { debug_symbols, file_map, warnings };
let debug_artifact = &DebugArtifact { debug_symbols, file_map };

let initial_witness = BTreeMap::from([(Witness(1), fe_1)]).into();

Expand Down Expand Up @@ -789,8 +788,7 @@ mod tests {

let debug_symbols = vec![];
let file_map = BTreeMap::new();
let warnings = vec![];
let debug_artifact = &DebugArtifact { debug_symbols, file_map, warnings };
let debug_artifact = &DebugArtifact { debug_symbols, file_map };

let initial_witness = BTreeMap::from([(Witness(1), fe_1), (Witness(2), fe_1)]).into();

Expand Down Expand Up @@ -847,8 +845,7 @@ mod tests {
Opcode::AssertZero(Expression::default()),
];
let circuit = Circuit { opcodes, ..Circuit::default() };
let debug_artifact =
DebugArtifact { debug_symbols: vec![], file_map: BTreeMap::new(), warnings: vec![] };
let debug_artifact = DebugArtifact { debug_symbols: vec![], file_map: BTreeMap::new() };
let brillig_funcs = &vec![brillig_bytecode];
let context = DebugContext::new(
&StubbedBlackBoxSolver,
Expand Down
6 changes: 1 addition & 5 deletions tooling/debugger/src/dap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,7 @@ pub fn run_session<R: Read, W: Write, B: BlackBoxFunctionSolver<FieldElement>>(
program: CompiledProgram,
initial_witness: WitnessMap<FieldElement>,
) -> Result<(), ServerError> {
let debug_artifact = DebugArtifact {
debug_symbols: program.debug,
file_map: program.file_map,
warnings: program.warnings,
};
let debug_artifact = DebugArtifact { debug_symbols: program.debug, file_map: program.file_map };
let mut session = DapSession::new(
server,
solver,
Expand Down
1 change: 0 additions & 1 deletion tooling/nargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fm.workspace = true
noirc_abi.workspace = true
noirc_driver.workspace = true
noirc_errors.workspace = true
noirc_evaluator.workspace = true
noirc_frontend.workspace = true
noirc_printable_type.workspace = true
iter-extended.workspace = true
Expand Down
23 changes: 4 additions & 19 deletions tooling/nargo/src/artifacts/debug.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use codespan_reporting::files::{Error, Files, SimpleFile};
use noirc_driver::{CompiledContract, CompiledProgram, DebugFile};
use noirc_errors::{debug_info::DebugInfo, Location};
use noirc_evaluator::errors::SsaReport;
use serde::{Deserialize, Serialize};
use std::{
collections::{BTreeMap, BTreeSet},
Expand All @@ -18,7 +17,6 @@ use fm::{FileId, FileManager, PathString};
pub struct DebugArtifact {
pub debug_symbols: Vec<DebugInfo>,
pub file_map: BTreeMap<FileId, DebugFile>,
pub warnings: Vec<SsaReport>,
}

impl DebugArtifact {
Expand All @@ -45,7 +43,7 @@ impl DebugArtifact {
);
}

Self { debug_symbols, file_map, warnings: Vec::new() }
Self { debug_symbols, file_map }
}

/// Given a location, returns its file's source code
Expand Down Expand Up @@ -121,11 +119,7 @@ impl DebugArtifact {

impl From<CompiledProgram> for DebugArtifact {
fn from(compiled_program: CompiledProgram) -> Self {
DebugArtifact {
debug_symbols: compiled_program.debug,
file_map: compiled_program.file_map,
warnings: compiled_program.warnings,
}
DebugArtifact { debug_symbols: compiled_program.debug, file_map: compiled_program.file_map }
}
}

Expand All @@ -134,7 +128,6 @@ impl From<ProgramArtifact> for DebugArtifact {
DebugArtifact {
debug_symbols: program_artifact.debug_symbols.debug_infos,
file_map: program_artifact.file_map,
warnings: Vec::new(),
}
}
}
Expand All @@ -147,11 +140,7 @@ impl From<CompiledContract> for DebugArtifact {
.flat_map(|contract_function| contract_function.debug)
.collect();

DebugArtifact {
debug_symbols: all_functions_debug,
file_map: compiled_artifact.file_map,
warnings: compiled_artifact.warnings,
}
DebugArtifact { debug_symbols: all_functions_debug, file_map: compiled_artifact.file_map }
}
}

Expand All @@ -163,11 +152,7 @@ impl From<ContractArtifact> for DebugArtifact {
.flat_map(|contract_function| contract_function.debug_symbols.debug_infos)
.collect();

DebugArtifact {
debug_symbols: all_functions_debug,
file_map: compiled_artifact.file_map,
warnings: Vec::new(),
}
DebugArtifact { debug_symbols: all_functions_debug, file_map: compiled_artifact.file_map }
}
}

Expand Down
1 change: 0 additions & 1 deletion tooling/nargo_cli/src/cli/debug_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ pub(crate) fn debug_program(
let debug_artifact = DebugArtifact {
debug_symbols: compiled_program.debug.clone(),
file_map: compiled_program.file_map.clone(),
warnings: compiled_program.warnings.clone(),
};

noir_debugger::debug_circuit(
Expand Down
1 change: 0 additions & 1 deletion tooling/nargo_cli/src/cli/execute_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ pub(crate) fn execute_program(
let debug_artifact = DebugArtifact {
debug_symbols: compiled_program.debug.clone(),
file_map: compiled_program.file_map.clone(),
warnings: compiled_program.warnings.clone(),
};

if let Some(diagnostic) =
Expand Down

0 comments on commit 33c2b6b

Please sign in to comment.