Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Use is_entry_point helper on RuntimeType #4678

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions compiler/noirc_evaluator/src/ssa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ fn convert_generated_acir_into_circuit(
..
} = generated_acir;

let locations = locations.clone();
jfecher marked this conversation as resolved.
Show resolved Hide resolved

let (public_parameter_witnesses, private_parameters) =
split_public_and_private_inputs(&func_sig, &input_witnesses);

Expand All @@ -189,7 +187,7 @@ fn convert_generated_acir_into_circuit(
private_parameters,
public_parameters,
return_values,
assert_messages: assert_messages.clone().into_iter().collect(),
assert_messages: assert_messages.into_iter().collect(),
recursive,
};

Expand Down
13 changes: 6 additions & 7 deletions compiler/noirc_evaluator/src/ssa/opt/inlining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::ssa::{
ir::{
basic_block::BasicBlockId,
dfg::{CallStack, InsertInstructionResult},
function::{Function, FunctionId, InlineType, RuntimeType},
function::{Function, FunctionId},
instruction::{Instruction, InstructionId, TerminatorInstruction},
value::{Value, ValueId},
},
Expand Down Expand Up @@ -351,14 +351,13 @@ impl<'function> PerFunctionContext<'function> {
for id in block.instructions() {
match &self.source_function.dfg[*id] {
Instruction::Call { func, arguments } => match self.get_function(*func) {
Some(function) => match ssa.functions[&function].runtime() {
RuntimeType::Acir(InlineType::Inline) => {
self.inline_function(ssa, *id, function, arguments);
}
RuntimeType::Acir(InlineType::Fold) | RuntimeType::Brillig => {
Some(function) => {
if ssa.functions[&function].runtime().is_entry_point() {
self.push_instruction(*id);
} else {
self.inline_function(ssa, *id, function, arguments);
}
},
}
None => self.push_instruction(*id),
},
_ => self.push_instruction(*id),
Expand Down
Loading