<commit_before>pub mod gen;
pub mod dump;

use std::cell::RefCell;
use std::rc::Rc;
use std::slice::{Iter, IterMut};
use std::fmt;
use std::fmt::{Debug, Display, Formatter};
use ast::{BinOp, UnOp};
use interner::Name;
use sym::BuiltinType;

pub struct Fct {
    blocks: Vec<Rc<RefCell<Block>>>,
    start_id: BlockId,
    end_ids: Vec<BlockId>,
    vars: Vec<Var>,
    params: Vec<Var>,
}


impl Debug for Fct {
    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
        write!(f, "fct")
    }
}

impl Fct {
    pub fn new() -> Fct {
        Fct {
            blocks: Vec::new(),
            start_id: BlockId(0),
            end_ids: Vec::new(),
            vars: Vec::new(),
            params: Vec::new(),
        }
    }

    pub fn block(&self, id: BlockId) -> Rc<RefCell<Block>> {
        self.blocks[id.0].clone()
    }

    pub fn increase_var(&mut self, id: VarId) -> u32 {
        let var = self.var_mut(id);
        var.next_ssa += 1;

        var.next_ssa
    }

    pub fn var_mut(&mut self, id: VarId) -> &mut Var {
        &mut self.vars[id.0]
    }

    pub fn var(&self, id: VarId) -> &Var {
        &self.vars[id.0]
    }

    pub fn add_block(&mut self) -> BlockId {
        let id = BlockId(self.blocks.len());
        self.blocks.push(Rc::new(RefCell::new(Block::new(id))));

        id
    }

    pub fn add_var(&mut self, name: Name, data_type: BuiltinType) -> VarId {<commit_msg>MIR: removed params from Fct<commit_after>pub mod gen;
pub mod dump;

use std::cell::RefCell;
use std::rc::Rc;
use std::slice::{Iter, IterMut};
use std::fmt;
use std::fmt::{Debug, Display, Formatter};
use ast::{BinOp, UnOp};
use interner::Name;
use sym::BuiltinType;

pub struct Fct {
    blocks: Vec<Rc<RefCell<Block>>>,
    start_id: BlockId,
    end_ids: Vec<BlockId>,
    vars: Vec<Var>,
}


impl Debug for Fct {
    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
        write!(f, "fct")
    }
}

impl Fct {
    pub fn new() -> Fct {
        Fct {
            blocks: Vec::new(),
            start_id: BlockId(0),
            end_ids: Vec::new(),
            vars: Vec::new(),
        }
    }

    pub fn block(&self, id: BlockId) -> Rc<RefCell<Block>> {
        self.blocks[id.0].clone()
    }

    pub fn increase_var(&mut self, id: VarId) -> u32 {
        let var = self.var_mut(id);
        var.next_ssa += 1;

        var.next_ssa
    }

    pub fn var_mut(&mut self, id: VarId) -> &mut Var {
        &mut self.vars[id.0]
    }

    pub fn var(&self, id: VarId) -> &Var {
        &self.vars[id.0]
    }

    pub fn add_block(&mut self) -> BlockId {
        let id = BlockId(self.blocks.len());
        self.blocks.push(Rc::new(RefCell::new(Block::new(id))));

        id
    }

    pub fn add_var(&mut self, name: Name, data_type: BuiltinType) -> VarId {
{'fraction_non_alphanumeric': 0.16913090515686982, 'fraction_numerical': 0.005048683736025965, 'mean_word_length': 2.306317044100119, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3253577', 'n_tokens_mistral': 1038, 'n_tokens_neox': 1021, 'n_words': 248}