Fix some typos.

This commit is contained in:
Bruce Mitchener
2018-03-05 10:48:48 +07:00
committed by Dan Gohman
parent 162ca42b08
commit 125270e2b0
17 changed files with 30 additions and 30 deletions

View File

@@ -440,7 +440,7 @@ Cretonne provides fully general :inst:`load` and :inst:`store` instructions for
accessing memory, as well as :ref:`extending loads and truncating stores
<extload-truncstore>`.
If the memory at the given addresss is not :term:`addressable`, the behavior of
If the memory at the given address is not :term:`addressable`, the behavior of
these instructions is undefined. If it is addressable but not
:term:`accessible`, they :term:`trap`.
@@ -559,7 +559,7 @@ runtime data structures.
The address of GV can be computed by first loading a pointer from BaseGV
and adding Offset to it.
It is assumed the BaseGV resides in readable memory with the apropriate
It is assumed the BaseGV resides in readable memory with the appropriate
alignment for storing a pointer.
Chains of ``deref`` global variables are possible, but cycles are not

View File

@@ -37,7 +37,7 @@ fn handle_module(
let test_file = parse_test(&buffer).map_err(|e| format!("{}: {}", name, e))?;
// If we have an isa from the command-line, use that. Otherwise if the
// file contins a unique isa, use that.
// file contains a unique isa, use that.
let isa = if let Some(isa) = fisa.isa {
isa
} else if let Some(isa) = test_file.isa_spec.unique_isa() {

View File

@@ -119,7 +119,7 @@ fn worker_thread(
loop {
// Lock the mutex only long enough to extract a request.
let Request(jobid, path) = match requests.lock().unwrap().recv() {
Err(..) => break, // TX end shuit down. exit thread.
Err(..) => break, // TX end shut down. exit thread.
Ok(req) => req,
};

View File

@@ -221,7 +221,7 @@ impl TestRunner {
}
self.tests[jobid].state = State::Done(result);
// Rports jobs in order.
// Reports jobs in order.
while self.report_job() {
self.reported_tests += 1;
}

View File

@@ -298,7 +298,7 @@ impl<'a> Context<'a> {
}
}
// Find reload candidates for `inst` and add them to `self.condidates`.
// Find reload candidates for `inst` and add them to `self.candidates`.
//
// These are uses of spilled values where the operand constraint requires a register.
fn find_candidates(&mut self, inst: Inst, constraints: &RecipeConstraints) {

View File

@@ -19,7 +19,7 @@ pub enum Error {
UndefVariable(String),
/// A pattern contains a back-reference to a variable that was defined in the same pattern.
///
/// For example, `check: Hello $(world=.*) $world`. Backreferences are not support. Often the
/// For example, `check: Hello $(world=.*) $world`. Backreferences are not supported. Often the
/// desired effect can be achieved with the `sameln` check:
///
/// ```text

View File

@@ -42,7 +42,7 @@ pub enum Part {
}
impl Part {
/// Get the variabled referenced by this part, if any.
/// Get the variable referenced by this part, if any.
pub fn ref_var(&self) -> Option<&str> {
match *self {
Part::Var(ref var) |
@@ -217,10 +217,10 @@ impl Pattern {
}
/// Compute the length of a regular expression terminated by `)` or `}`.
/// Handle nested and escaped parentheses in the rx, but don't actualy parse it.
/// Handle nested and escaped parentheses in the rx, but don't actually parse it.
/// Return the position of the terminating brace or the length of the string.
fn regex_prefix(s: &str) -> usize {
// The prevous char was a backslash.
// The previous char was a backslash.
let mut escape = false;
// State around parsing charsets.
enum State {

View File

@@ -3,7 +3,7 @@ use std::borrow::Cow;
/// A variable name is one or more ASCII alphanumerical characters, including underscore.
/// Note that numerical variable names like `$45` are allowed too.
///
/// Try to parse a variable name from the begining of `s`.
/// Try to parse a variable name from the beginning of `s`.
/// Return the index of the character following the varname.
/// This returns 0 if `s` doesn't have a prefix that is a variable name.
pub fn varname_prefix(s: &str) -> usize {

View File

@@ -153,7 +153,7 @@ fn nextln() {
#[test]
fn leading_nextln() {
// A leading nextln directive should match from line 2.
// This is somewhat arbitrary, but consistent with a preceeding 'check: $()' directive.
// This is somewhat arbitrary, but consistent with a preceding 'check: $()' directive.
let c = CheckerBuilder::new()
.text(
"

View File

@@ -12,7 +12,7 @@ use cretonne::packed_option::PackedOption;
/// Structure used for translating a series of functions into Cretonne IL.
///
/// In order to reduce memory reallocations whem compiling multiple functions,
/// In order to reduce memory reallocations when compiling multiple functions,
/// `ILBuilder` holds various data structures which are cleared between
/// functions, rather than dropped, preserving the underlying allocations.
pub struct ILBuilder<Variable>
@@ -259,7 +259,7 @@ where
/// block, in the order they are declared. You must declare the types of the Ebb arguments
/// you will use here.
///
/// When inserting the terminator instruction (which doesn't have a falltrough to its immediate
/// When inserting the terminator instruction (which doesn't have a fallthrough to its immediate
/// successor), the block will be declared filled and it will not be possible to append
/// instructions to it.
pub fn switch_to_block(&mut self, ebb: Ebb) {
@@ -283,7 +283,7 @@ where
/// Declares that all the predecessors of this block are known.
///
/// Function to call with `ebb` as soon as the last branch instruction to `ebb` has been
/// created. Forgetting to call this method on every block will cause inconsistences in the
/// created. Forgetting to call this method on every block will cause inconsistencies in the
/// produced functions.
pub fn seal_block(&mut self, ebb: Ebb) {
let side_effects = self.builder.ssa.seal_ebb_header_block(ebb, self.func);

View File

@@ -35,7 +35,7 @@ pub struct SSABuilder<Variable>
where
Variable: EntityRef,
{
// Records for every variable and for every revelant block, the last definition of
// Records for every variable and for every relevant block, the last definition of
// the variable in the block.
variables: EntityMap<Variable, EntityMap<Block, PackedOption<Value>>>,
// Records the position of the basic blocks and the list of values used but not defined in the
@@ -81,7 +81,7 @@ enum BlockData<Variable> {
// A block at the top of an `Ebb`.
EbbHeader(EbbHeaderBlockData<Variable>),
// A block inside an `Ebb` with an unique other block as its predecessor.
// The block is implicitely sealed at creation.
// The block is implicitly sealed at creation.
EbbBody { predecessor: Block },
}
@@ -394,7 +394,7 @@ where
/// Remove a previously declared Ebb predecessor by giving a reference to the jump
/// instruction. Returns the basic block containing the instruction.
///
/// Note: use only when you know what you are doing, this might break the SSA bbuilding problem
/// Note: use only when you know what you are doing, this might break the SSA building problem
pub fn remove_ebb_predecessor(&mut self, ebb: Ebb, inst: Inst) -> Block {
debug_assert!(!self.is_sealed(ebb));
let header_block = self.header_block(ebb);
@@ -422,7 +422,7 @@ where
pub fn seal_all_ebb_header_blocks(&mut self, func: &mut Function) -> SideEffects {
// Seal all `Ebb`s currently in the function. This can entail splitting
// and creation of new blocks, however such new blocks are sealed on
// the fly, so we don't need to accout for them here.
// the fly, so we don't need to account for them here.
for ebb in self.ebb_headers.keys() {
self.seal_one_ebb_header_block(ebb, func);
}
@@ -470,8 +470,8 @@ where
}
}
/// Look up in the predecessors of an Ebb the def for a value an decides wether or not
/// to keep the eeb arg, and act accordingly. Returns the chosen value and optionnaly a
/// Look up in the predecessors of an Ebb the def for a value an decides whether or not
/// to keep the eeb arg, and act accordingly. Returns the chosen value and optionally a
/// list of Ebb that are the middle of newly created critical edges splits.
fn predecessors_lookup(
&mut self,
@@ -554,7 +554,7 @@ where
ZeroOneOrMore::One(pred_val) => {
// Here all the predecessors use a single value to represent our variable
// so we don't need to have it as an ebb argument.
// We need to replace all the occurences of val with pred_val but since
// We need to replace all the occurrences of val with pred_val but since
// we can't afford a re-writing pass right now we just declare an alias.
// Resolve aliases eagerly so that we can check for cyclic aliasing,
// which can occur in unreachable code.
@@ -1119,7 +1119,7 @@ mod tests {
#[test]
fn undef() {
// Use vars of varous types which have not been defined.
// Use vars of various types which have not been defined.
let mut func = Function::new();
let mut ssa: SSABuilder<Variable> = SSABuilder::new();
let ebb0 = func.dfg.make_ebb();

View File

@@ -9,7 +9,7 @@
//!
//! The options are either a single identifier flag, or setting values like `identifier=value`.
//!
//! The parser does not understand the test commands or which options are alid. It simply parses
//! The parser does not understand the test commands or which options are valid. It simply parses
//! the general format into a `TestCommand` data structure.
use std::fmt::{self, Display, Formatter};

View File

@@ -42,7 +42,7 @@ pub struct Details<'a> {
/// A comment in a parsed function.
///
/// The comment belongs to the immediately preceeding entity, whether that is an EBB header, and
/// The comment belongs to the immediately preceding entity, whether that is an EBB header, and
/// instruction, or one of the preamble declarations.
///
/// Comments appearing inside the function but before the preamble, as well as comments appearing

View File

@@ -51,7 +51,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
match *op {
/********************************** Locals ****************************************
* `get_local` and `set_local` are treated as non-SSA variables and will completely
* diseappear in the Cretonne Code
* disappear in the Cretonne Code
***********************************************************************************/
Operator::GetLocal { local_index } => state.push1(builder.use_var(Local(local_index))),
Operator::SetLocal { local_index } => {
@@ -1003,7 +1003,7 @@ fn translate_unreachable_operator(
builder.switch_to_block(frame.following_code());
builder.seal_block(frame.following_code());
// And add the return values of the block but only if the next block is reachble
// And add the return values of the block but only if the next block is reachable
// (which corresponds to testing if the stack depth is 1)
stack.extend_from_slice(builder.ebb_params(frame.following_code()));
state.reachable = true;

View File

@@ -146,7 +146,7 @@ pub trait FuncEnvironment {
) -> ir::Value;
}
/// An object satisfyng the `ModuleEnvironment` trait can be passed as argument to the
/// An object satisfying the `ModuleEnvironment` trait can be passed as argument to the
/// [`translate_module`](fn.translate_module.html) function. These methods should not be called
/// by the user, they are only for `cretonne-wasm` internal use.
pub trait ModuleEnvironment<'data> {

View File

@@ -1,4 +1,4 @@
//! Translation skeletton that traverses the whole WebAssembly module and call helper functions
//! Translation skeleton that traverses the whole WebAssembly module and call helper functions
//! to deal with each part of it.
use cretonne::timing;
use wasmparser::{ParserState, SectionCode, ParserInput, Parser, WasmDecoder, BinaryReaderError};

View File

@@ -115,7 +115,7 @@ pub fn parse_import_section<'data>(
Ok(())
}
/// Retrieves the correspondances between functions and signatures from the function section
/// Retrieves the correspondences between functions and signatures from the function section
pub fn parse_function_section(
parser: &mut Parser,
environ: &mut ModuleEnvironment,