diff --git a/cranelift/docs/langref.rst b/cranelift/docs/langref.rst index 476e0a262d..b91f1b3f47 100644 --- a/cranelift/docs/langref.rst +++ b/cranelift/docs/langref.rst @@ -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 `. -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 diff --git a/cranelift/src/compile.rs b/cranelift/src/compile.rs index ae0c87ad36..fd2e5d5552 100644 --- a/cranelift/src/compile.rs +++ b/cranelift/src/compile.rs @@ -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() { diff --git a/cranelift/src/filetest/concurrent.rs b/cranelift/src/filetest/concurrent.rs index cb188577e0..a651c14071 100644 --- a/cranelift/src/filetest/concurrent.rs +++ b/cranelift/src/filetest/concurrent.rs @@ -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, }; diff --git a/cranelift/src/filetest/runner.rs b/cranelift/src/filetest/runner.rs index 320db9d942..09ec3a19a9 100644 --- a/cranelift/src/filetest/runner.rs +++ b/cranelift/src/filetest/runner.rs @@ -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; } diff --git a/lib/cretonne/src/regalloc/reload.rs b/lib/cretonne/src/regalloc/reload.rs index 2cb37d7d6a..12fd8d310a 100644 --- a/lib/cretonne/src/regalloc/reload.rs +++ b/lib/cretonne/src/regalloc/reload.rs @@ -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) { diff --git a/lib/filecheck/src/error.rs b/lib/filecheck/src/error.rs index 5580cc4c3c..f15cb17124 100644 --- a/lib/filecheck/src/error.rs +++ b/lib/filecheck/src/error.rs @@ -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 diff --git a/lib/filecheck/src/pattern.rs b/lib/filecheck/src/pattern.rs index 934150dca7..97977b191c 100644 --- a/lib/filecheck/src/pattern.rs +++ b/lib/filecheck/src/pattern.rs @@ -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 { diff --git a/lib/filecheck/src/variable.rs b/lib/filecheck/src/variable.rs index 1a43f1428a..5977f06354 100644 --- a/lib/filecheck/src/variable.rs +++ b/lib/filecheck/src/variable.rs @@ -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 { diff --git a/lib/filecheck/tests/basic.rs b/lib/filecheck/tests/basic.rs index debced2a1b..1ccc5991a5 100644 --- a/lib/filecheck/tests/basic.rs +++ b/lib/filecheck/tests/basic.rs @@ -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( " diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 432288e4eb..fba2f89a01 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -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 @@ -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); diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 2b758ef18b..aa6aa81166 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -35,7 +35,7 @@ pub struct SSABuilder 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>>, // Records the position of the basic blocks and the list of values used but not defined in the @@ -81,7 +81,7 @@ enum BlockData { // A block at the top of an `Ebb`. EbbHeader(EbbHeaderBlockData), // 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 = SSABuilder::new(); let ebb0 = func.dfg.make_ebb(); diff --git a/lib/reader/src/testcommand.rs b/lib/reader/src/testcommand.rs index ad856e9949..2b848a9348 100644 --- a/lib/reader/src/testcommand.rs +++ b/lib/reader/src/testcommand.rs @@ -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}; diff --git a/lib/reader/src/testfile.rs b/lib/reader/src/testfile.rs index 20e03939a1..8ec5271a07 100644 --- a/lib/reader/src/testfile.rs +++ b/lib/reader/src/testfile.rs @@ -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 diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 21df608f74..086646fa29 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -51,7 +51,7 @@ pub fn translate_operator( 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; diff --git a/lib/wasm/src/environ/spec.rs b/lib/wasm/src/environ/spec.rs index 31e4782918..732438a573 100644 --- a/lib/wasm/src/environ/spec.rs +++ b/lib/wasm/src/environ/spec.rs @@ -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> { diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index d50031fb04..df640cbb49 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -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}; diff --git a/lib/wasm/src/sections_translator.rs b/lib/wasm/src/sections_translator.rs index d02a4a7c2a..359510547a 100644 --- a/lib/wasm/src/sections_translator.rs +++ b/lib/wasm/src/sections_translator.rs @@ -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,