From d72ef250527a7176fb333c7415cab90e50116e98 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Tue, 1 Nov 2022 20:54:04 -0700 Subject: [PATCH] WIP. --- src/ir/func.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/ir/func.rs b/src/ir/func.rs index 1238793..af05f36 100644 --- a/src/ir/func.rs +++ b/src/ir/func.rs @@ -55,7 +55,7 @@ impl FunctionBody { id } - pub fn add_edge(&mut self, from: Block, to: Block) { + fn add_edge(&mut self, from: Block, to: Block) { let succ_pos = self.blocks[from].succs.len(); let pred_pos = self.blocks[to].preds.len(); self.blocks[from].succs.push(to); @@ -93,12 +93,6 @@ impl FunctionBody { result } - pub fn add_mutable_inst(&mut self, def: ValueDef) -> Value { - let value = Value(self.values.len() as u32); - self.values.push(def); - value - } - pub fn add_blockparam(&mut self, block: Block, ty: Type) -> Value { let index = self.blocks[block].params.len(); let value = self.add_value(ValueDef::BlockParam(block, index, ty)); @@ -107,7 +101,7 @@ impl FunctionBody { } pub fn add_placeholder(&mut self, ty: Type) -> Value { - self.add_mutable_inst(ValueDef::Placeholder(ty)) + self.add_value(ValueDef::Placeholder(ty)) } pub fn replace_placeholder_with_blockparam(&mut self, block: Block, value: Value) {