MCPcopy Create free account
hub / github.com/chc4/lineiform / add_stack_slot

Method add_stack_slot

tangle/src/node.rs:133–151  ·  view source on GitHub ↗
(&mut self, ir: &mut IR)

Source from the content-addressed store, hash-verified

131 }
132
133 pub fn add_stack_slot(&mut self, ir: &mut IR) -> PortIdx {
134 let port = ir.in_region(self.region, |mut r, ir| {
135 let new_state = r.states.len();
136 let port = r.add_port();
137 r.states.push(State {
138 name: "stack".to_string(),
139 variant: StateVariant::Stack(self.stack_slots.len().try_into().unwrap()),
140 producers: vec![],
141 });
142
143 r.constrain(port, Storage::Immaterial(Some(new_state.try_into().unwrap())));
144 r.ports[port].set_variant(EdgeVariant::State);
145 port
146 });
147
148 self.stack_slots.push(port);
149 self.highwater = core::cmp::max(self.highwater, self.stack_slots.len().try_into().unwrap());
150 port
151 }
152 }
153 #[derive(Debug)]
154 pub struct BrEntry; // "Block Entry"; header of a basic block, source of bb params

Callers 4

function_use_stackFunction · 0.80
function_stack_orderingFunction · 0.80
emitMethod · 0.80
shift_stackMethod · 0.80

Calls 5

in_regionMethod · 0.80
add_portMethod · 0.80
pushMethod · 0.80
constrainMethod · 0.80
set_variantMethod · 0.80

Tested by 2

function_use_stackFunction · 0.64
function_stack_orderingFunction · 0.64