Skip to content

Commit

Permalink
move error printout to the end (after dump) (#43)
Browse files Browse the repository at this point in the history
also add template vs. function to the "Running" debug line
  • Loading branch information
tim-hoffman authored Aug 16, 2023
1 parent 479715d commit f70978d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion circuit_passes/src/bucket_interpreter/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl<'a> Env<'a> {
observe: bool,
) -> Value {
if cfg!(debug_assertions) {
println!("Running {}", name);
println!("Running function {}", name);
}
let code = &self.functions_library[name].body;
let mut function_env =
Expand Down
2 changes: 1 addition & 1 deletion circuit_passes/src/passes/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl PassMemory {
pub fn run_template(&self, observer: &dyn InterpreterObserver, template: &TemplateCode) {
assert!(!self.current_scope.is_empty());
if cfg!(debug_assertions) {
println!("Running {}", self.current_scope);
println!("Running template {}", self.current_scope);
}
let interpreter = self.build_interpreter(observer);
let env = Env::new(&self.templates_library, &self.functions_library, self);
Expand Down
10 changes: 3 additions & 7 deletions code_producers/src/llvm_elements/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ pub trait BodyCtx<'a> {
index: IntValue<'a>,
) -> AnyValueEnum<'a>;

fn get_variable_array(
&self,
producer: &dyn LLVMIRProducer<'a>,
) -> AnyValueEnum<'a>;
fn get_variable_array(&self, producer: &dyn LLVMIRProducer<'a>) -> AnyValueEnum<'a>;
}

pub trait LLVMIRProducer<'a> {
Expand All @@ -63,7 +60,6 @@ pub trait LLVMIRProducer<'a> {

pub type IndexMapping = HashMap<usize, Range<usize>>;


#[derive(Default, Eq, PartialEq, Debug)]
pub struct LLVMCircuitData {
pub field_tracking: Vec<String>,
Expand Down Expand Up @@ -294,13 +290,13 @@ impl<'a> LLVM<'a> {
}
// Run module verification
self.module.verify().map_err(|llvm_err| {
eprintln!("Generated LLVM:");
self.module.print_to_stderr();
eprintln!(
"{}: {}",
Colour::Red.paint("LLVM Module verification failed"),
llvm_err.to_string()
);
eprintln!("Generated LLVM:");
self.module.print_to_stderr();
})?;
// Verify that bitcode can be written, parsed, and re-verified
{
Expand Down

0 comments on commit f70978d

Please sign in to comment.