Skip to content

Commit

Permalink
Don't have a responsible parameter in the LIR
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelGarus committed Aug 17, 2023
1 parent 5662465 commit 061a726
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions compiler/frontend/src/lir/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,7 @@ impl ToRichIr for Bodies {
builder.push_definition(parameter_id, range);
}

let responsible_parameter_id = body.responsible_parameter_id();
builder.push(
if body.parameter_count == 0 {
" (responsible "
} else {
" (+ responsible "
},
None,
EnumSet::empty(),
);
let range = builder.push(
responsible_parameter_id.to_string(),
TokenType::Parameter,
EnumSet::empty(),
);
builder.push_definition(responsible_parameter_id, range);

builder.push(") =", None, EnumSet::empty());
builder.push(" =", None, EnumSet::empty());

builder.indent();
builder.push_newline();
Expand All @@ -106,7 +89,6 @@ impl ToRichIr for Bodies {
///
/// - captured variables
/// - parameters
/// - responsible parameter
/// - locals
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Body {
Expand Down Expand Up @@ -152,16 +134,12 @@ impl Body {
(self.captured_count..self.captured_count + self.parameter_count).map(Id::from_usize)
}

fn responsible_parameter_id(&self) -> Id {
Id::from_usize(self.captured_count + self.parameter_count)
}

#[must_use]
pub fn expressions(&self) -> &[Expression] {
&self.expressions
}
pub fn ids_and_expressions(&self) -> impl Iterator<Item = (Id, &Expression)> {
let offset = self.captured_count + self.parameter_count + 1;
let offset = self.captured_count + self.parameter_count;
self.expressions
.iter()
.enumerate()
Expand Down

1 comment on commit 061a726

@jwbot
Copy link
Collaborator

@jwbot jwbot commented on 061a726 Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler

Benchmark suite Current: 061a726 Previous: 6a09755 Ratio
Time: Compiler/hello_world 16581217 ns/iter (± 1195276) 16679361 ns/iter (± 281136) 0.99
Time: Compiler/fibonacci 148512715 ns/iter (± 1266591) 148330914 ns/iter (± 860715) 1.00
Time: VM Runtime/hello_world 15500 ns/iter (± 1765) 16300 ns/iter (± 1823) 0.95
Time: VM Runtime/fibonacci/15 241559028 ns/iter (± 809458) 250651046 ns/iter (± 1417601) 0.96
Time: VM Runtime/PLB/binarytrees/6 1117908610 ns/iter (± 5769229) 1166419011 ns/iter (± 7211457) 0.96

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.