Rename 'an block' to 'a block'

Missed this in the automatic rename of 'Ebb' to 'Block'.
This commit is contained in:
Ryan Hunt
2020-03-03 13:17:30 -06:00
parent 77e17d8f71
commit 07f335dca6
31 changed files with 96 additions and 96 deletions

View File

@@ -376,7 +376,7 @@ impl DataFlowGraph {
pub enum ValueDef {
/// Value is the n'th result of an instruction.
Result(Inst, usize),
/// Value is the n'th parameter to an block.
/// Value is the n'th parameter to a block.
Param(Block, usize),
}
@@ -393,7 +393,7 @@ impl ValueDef {
pub fn unwrap_block(&self) -> Block {
match *self {
Self::Param(block, _) => block,
_ => panic!("Value is not an block parameter"),
_ => panic!("Value is not a block parameter"),
}
}
@@ -419,7 +419,7 @@ enum ValueData {
/// Value is defined by an instruction.
Inst { ty: Type, num: u16, inst: Inst },
/// Value is an block parameter.
/// Value is a block parameter.
Param { ty: Type, num: u16, block: Block },
/// Value is an alias of another value.
@@ -804,12 +804,12 @@ impl DataFlowGraph {
/// last `block` parameter. This can disrupt all the branch instructions jumping to this
/// `block` for which you have to change the branch argument order if necessary.
///
/// Panics if `val` is not an block parameter.
/// Panics if `val` is not a block parameter.
pub fn swap_remove_block_param(&mut self, val: Value) -> usize {
let (block, num) = if let ValueData::Param { num, block, .. } = self.values[val] {
(block, num)
} else {
panic!("{} must be an block parameter", val);
panic!("{} must be a block parameter", val);
};
self.blocks[block]
.params
@@ -826,7 +826,7 @@ impl DataFlowGraph {
{
*old_num = num;
} else {
panic!("{} should be an Block parameter", last_arg_val);
panic!("{} should be a Block parameter", last_arg_val);
}
}
num as usize
@@ -838,7 +838,7 @@ impl DataFlowGraph {
let (block, num) = if let ValueData::Param { num, block, .. } = self.values[val] {
(block, num)
} else {
panic!("{} must be an block parameter", val);
panic!("{} must be a block parameter", val);
};
self.blocks[block]
.params
@@ -853,7 +853,7 @@ impl DataFlowGraph {
*num -= 1;
}
_ => panic!(
"{} must be an block parameter",
"{} must be a block parameter",
self.blocks[block]
.params
.get(index as usize, &self.value_lists)
@@ -880,7 +880,7 @@ impl DataFlowGraph {
};
}
/// Replace an block parameter with a new value of type `ty`.
/// Replace a block parameter with a new value of type `ty`.
///
/// The `old_value` must be an attached block parameter. It is removed from its place in the list
/// of parameters and replaced by a new value of type `new_type`. The new value gets the same
@@ -894,7 +894,7 @@ impl DataFlowGraph {
let (block, num) = if let ValueData::Param { num, block, .. } = self.values[old_value] {
(block, num)
} else {
panic!("{} must be an block parameter", old_value);
panic!("{} must be a block parameter", old_value);
};
let new_arg = self.make_value(ValueData::Param {
ty: new_type,

View File

@@ -1,6 +1,6 @@
//! Function layout.
//!
//! The order of basic blocks in a function and the order of instructions in an block is
//! The order of basic blocks in a function and the order of instructions in a block is
//! determined by the `Layout` data structure defined in this module.
use crate::entity::SecondaryMap;
@@ -21,7 +21,7 @@ use log::debug;
///
/// - The order of blocks in the function.
/// - Which block contains a given instruction.
/// - The order of instructions with an block.
/// - The order of instructions with a block.
///
/// While data dependencies are not recorded, instruction ordering does affect control
/// dependencies, so part of the semantics of the program are determined by the layout.
@@ -75,7 +75,7 @@ impl Layout {
/// like line numbers in BASIC: 10, 20, 30, ...
///
/// The block sequence numbers are strictly increasing, and so are the instruction sequence numbers
/// within an block. The instruction sequence numbers are all between the sequence number of their
/// within a block. The instruction sequence numbers are all between the sequence number of their
/// containing block and the following block.
///
/// The result is that sequence numbers work like BASIC line numbers for the textual form of the IR.
@@ -335,7 +335,7 @@ impl Layout {
/// Methods for laying out blocks.
///
/// An unknown block starts out as *not inserted* in the block layout. The layout is a linear order of
/// inserted blocks. Once an block has been inserted in the layout, instructions can be added. An block
/// inserted blocks. Once a block has been inserted in the layout, instructions can be added. A block
/// can only be removed from the layout when it is empty.
///
/// Since every block must end with a terminator instruction which cannot fall through, the layout of
@@ -514,7 +514,7 @@ impl<'f> IntoIterator for &'f Layout {
/// Methods for arranging instructions.
///
/// An instruction starts out as *not inserted* in the layout. An instruction can be inserted into
/// an block at a given position.
/// a block at a given position.
impl Layout {
/// Get the block containing `inst`, or `None` if `inst` is not inserted in the layout.
pub fn inst_block(&self, inst: Inst) -> Option<Block> {
@@ -559,12 +559,12 @@ impl Layout {
self.assign_inst_seq(inst);
}
/// Fetch an block's first instruction.
/// Fetch a block's first instruction.
pub fn first_inst(&self, block: Block) -> Option<Inst> {
self.blocks[block].first_inst.into()
}
/// Fetch an block's last instruction.
/// Fetch a block's last instruction.
pub fn last_inst(&self, block: Block) -> Option<Inst> {
self.blocks[block].last_inst.into()
}
@@ -579,7 +579,7 @@ impl Layout {
self.insts[inst].prev.expand()
}
/// Fetch the first instruction in an block's terminal branch group.
/// Fetch the first instruction in a block's terminal branch group.
pub fn canonical_branch_inst(&self, dfg: &DataFlowGraph, block: Block) -> Option<Inst> {
// Basic blocks permit at most two terminal branch instructions.
// If two, the former is conditional and the latter is unconditional.
@@ -724,7 +724,7 @@ struct InstNode {
seq: SequenceNumber,
}
/// Iterate over instructions in an block in layout order. See `Layout::block_insts()`.
/// Iterate over instructions in a block in layout order. See `Layout::block_insts()`.
pub struct Insts<'f> {
layout: &'f Layout,
head: Option<Inst>,

View File

@@ -10,7 +10,7 @@ use core::u32;
/// begin or end. It can be either:
///
/// 1. An instruction or
/// 2. An block header.
/// 2. A block header.
///
/// This corresponds more or less to the lines in the textual form of Cranelift IR.
#[derive(PartialEq, Eq, Clone, Copy)]
@@ -47,7 +47,7 @@ impl From<ValueDef> for ProgramPoint {
pub enum ExpandedProgramPoint {
/// An instruction in the function.
Inst(Inst),
/// An block header.
/// A block header.
Block(Block),
}