<commit_before>//! A frontend for building Cretonne IL from other languages.
use cretonne::cursor::{Cursor, FuncCursor};
use cretonne::ir;
use cretonne::ir::{Ebb, Type, Value, Function, Inst, JumpTable, StackSlot, JumpTableData,
                   StackSlotData, DataFlowGraph, InstructionData, ExtFuncData, FuncRef, SigRef,
                   Signature, InstBuilderBase, GlobalVarData, GlobalVar, HeapData, Heap};
use cretonne::ir::instructions::BranchInfo;
use cretonne::ir::function::DisplayFunction;
use cretonne::isa::TargetIsa;
use ssa::{SSABuilder, SideEffects, Block};
use cretonne::entity::{EntityRef, EntityMap, EntitySet};

/// Permanent structure used for translating into Cretonne IL.
///
/// In order to reduce memory reallocations whem compiling multiple functions,
/// `ILBuilder` holds various data structures which are cleared between
/// functions, rather than dropped, preserving the underlying allocations.
pub struct ILBuilder<Variable>
where
    Variable: EntityRef + Default,
{
    ssa: SSABuilder<Variable>,
    ebbs: EntityMap<Ebb, EbbData>,
    types: EntityMap<Variable, Type>,
    function_params_values: Vec<Value>,
}


/// Temporary object used to build a Cretonne IL `Function`.
pub struct FunctionBuilder<'a, Variable: 'a>
where
    Variable: EntityRef + Default,
{
    /// The function currently being built.
    /// This field is public so the function can be re-borrowed.
    pub func: &'a mut Function,

    /// Source location to assign to all new instructions.
    srcloc: ir::SourceLoc,
<commit_msg>Clarify some comments.<commit_after>//! A frontend for building Cretonne IL from other languages.
use cretonne::cursor::{Cursor, FuncCursor};
use cretonne::ir;
use cretonne::ir::{Ebb, Type, Value, Function, Inst, JumpTable, StackSlot, JumpTableData,
                   StackSlotData, DataFlowGraph, InstructionData, ExtFuncData, FuncRef, SigRef,
                   Signature, InstBuilderBase, GlobalVarData, GlobalVar, HeapData, Heap};
use cretonne::ir::instructions::BranchInfo;
use cretonne::ir::function::DisplayFunction;
use cretonne::isa::TargetIsa;
use ssa::{SSABuilder, SideEffects, Block};
use cretonne::entity::{EntityRef, EntityMap, EntitySet};

/// Structure used for translating a series of functions into Cretonne IL.
///
/// In order to reduce memory reallocations whem compiling multiple functions,
/// `ILBuilder` holds various data structures which are cleared between
/// functions, rather than dropped, preserving the underlying allocations.
pub struct ILBuilder<Variable>
where
    Variable: EntityRef + Default,
{
    ssa: SSABuilder<Variable>,
    ebbs: EntityMap<Ebb, EbbData>,
    types: EntityMap<Variable, Type>,
    function_params_values: Vec<Value>,
}


/// Temporary object used to build a single Cretonne IL `Function`.
pub struct FunctionBuilder<'a, Variable: 'a>
where
    Variable: EntityRef + Default,
{
    /// The function currently being built.
    /// This field is public so the function can be re-borrowed.
    pub func: &'a mut Function,

    /// Source location to assign to all new instructions.
    srcloc: ir::SourceLoc,

{'fraction_non_alphanumeric': 0.10528010302640052, 'fraction_numerical': 0.0, 'mean_word_length': 4.338487972508591, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2857649', 'n_tokens_mistral': 898, 'n_tokens_neox': 875, 'n_words': 306}