<commit_before>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use instruction::Instruction;

/// When is this edge taken? Conditionally or unconditionally?
#[derive(Clone,Copy,Debug)]
pub enum EdgeType {
    /// This edge is taken when a conditional is true.
    ConditionalTrue,
    /// This edge is taken when a conditional is false.
    ConditionalFalse,
    /// This is edge is always taken.
    Unconditional,
}

/// Which direction is this edge going? Inwards or outwards from this `BasicBlock`?
#[derive(Clone,Copy,Debug)]
pub enum EdgeDirection {
    /// This is an inbound edge with this [`BasicBlock`] as the target.
    ///
    /// [`BasicBlock`]: struct.BasicBlock.html
    In,
    /// This is an outbound edge with this [`BasicBlock`] as the source.
    ///
    /// [`BasicBlock`]: struct.BasicBlock.html
    Out,
}

/// A [basic block] is a sequence of instructions with no inward-bound
/// branches except to the entry point and no outward-bound branches
/// except at the exit.
///
/// [basic block]: https://en.wikipedia.org/wiki/Basic_block
#[derive(Debug)]
pub struct BasicBlock<'f> {
    /// The ID # for this basic block. This is artificial information and
    /// not something from the disassembly.
    pub id: usize,
    /// The name of the basic block. Not all blocks have meaningful names.
    pub name: Option<String>,
    /// The instructions within this basic block.
    pub instructions: Vec<&'f Box<Instruction>>,
    /// The basic blocks that point to this one.
    pub in_edges: Vec<BasicBlockEdge<'f>>,<commit_msg>Edge type and direction derive Eq, PartialEq.<commit_after>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use instruction::Instruction;

/// When is this edge taken? Conditionally or unconditionally?
#[derive(Clone,Copy,Debug,Eq,PartialEq)]
pub enum EdgeType {
    /// This edge is taken when a conditional is true.
    ConditionalTrue,
    /// This edge is taken when a conditional is false.
    ConditionalFalse,
    /// This is edge is always taken.
    Unconditional,
}

/// Which direction is this edge going? Inwards or outwards from this `BasicBlock`?
#[derive(Clone,Copy,Debug,Eq,PartialEq)]
pub enum EdgeDirection {
    /// This is an inbound edge with this [`BasicBlock`] as the target.
    ///
    /// [`BasicBlock`]: struct.BasicBlock.html
    In,
    /// This is an outbound edge with this [`BasicBlock`] as the source.
    ///
    /// [`BasicBlock`]: struct.BasicBlock.html
    Out,
}

/// A [basic block] is a sequence of instructions with no inward-bound
/// branches except to the entry point and no outward-bound branches
/// except at the exit.
///
/// [basic block]: https://en.wikipedia.org/wiki/Basic_block
#[derive(Debug)]
pub struct BasicBlock<'f> {
    /// The ID # for this basic block. This is artificial information and
    /// not something from the disassembly.
    pub id: usize,
    /// The name of the basic block. Not all blocks have meaningful names.
    pub name: Option<String>,
    /// The instructions within this basic block.
    pub instructions: Vec<&'f Box<Instruction>>,
    /// The basic blocks that point to this one.
    pub in_edges: Vec<BasicBlockEdge<'f>>,
{'fraction_non_alphanumeric': 0.1190606226105953, 'fraction_numerical': 0.002184598580010923, 'mean_word_length': 3.0519911504424777, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '3901983', 'n_tokens_mistral': 1017, 'n_tokens_neox': 1032, 'n_words': 419}