Fix typos.

This commit is contained in:
Bruce Mitchener
2018-12-24 10:20:32 -05:00
committed by Dan Gohman
parent 4224a95f0d
commit 4f8753fa11
26 changed files with 41 additions and 41 deletions

View File

@@ -2,7 +2,7 @@
Cranelift DSL classes.
This module defines the classes that are used to define Cranelift instructions
and other entitties.
and other entities.
"""
from __future__ import absolute_import
import re

View File

@@ -2,7 +2,7 @@
Abstract syntax trees.
This module defines classes that can be used to create abstract syntax trees
for patern matching an rewriting of cranelift instructions.
for pattern matching an rewriting of cranelift instructions.
"""
from __future__ import absolute_import
from . import instructions
@@ -79,7 +79,7 @@ class Def(object):
# type: (VarAtomMap) -> Def
"""
Return a copy of this Def with vars replaced with fresh variables,
in accordance with the map m. Update m as neccessary.
in accordance with the map m. Update m as necessary.
"""
new_expr = self.expr.copy(m)
new_defs = [] # type: List[Var]
@@ -423,7 +423,7 @@ class Apply(Expr):
# type: (VarAtomMap) -> Apply
"""
Return a copy of this Expr with vars replaced with fresh variables,
in accordance with the map m. Update m as neccessary.
in accordance with the map m. Update m as necessary.
"""
return Apply(self.inst, tuple(map(lambda e: replace_var(e, m),
self.args)))
@@ -441,7 +441,7 @@ class Apply(Expr):
def substitution(self, other, s):
# type: (Apply, VarAtomMap) -> Optional[VarAtomMap]
"""
If there is a substituion from Var->Atom that converts self to other,
If there is a substitution from Var->Atom that converts self to other,
return it, otherwise return None. Note that this is strictly weaker
than unification (see TestXForm.test_subst_enum_bad_var_const for
example).
@@ -513,7 +513,7 @@ class ConstantInt(Literal):
A value of an integer immediate operand.
Immediate operands like `imm64` or `offset32` can be specified in AST
expressions using the call syntax: `imm64(5)` which greates a `ConstantInt`
expressions using the call syntax: `imm64(5)` which creates a `ConstantInt`
node.
"""

View File

@@ -502,7 +502,7 @@ class TestXForm(TypeCheckingBaseTest):
# For any patterns where the type env includes constraints, at
# least one of the "theoretically possible" concrete typings must
# be prevented by the constraints. (i.e. we are not emitting
# unneccessary constraints).
# unnecessary constraints).
# We check that by asserting that the number of concrete typings is
# less than the number of all possible free typevar assignments
if (len(xform.ti.constraints) > 0):

View File

@@ -233,7 +233,7 @@ class TestTypeVar(TestCase):
intersect = ts1.copy()
intersect &= ts2
# Propagate instersections backward
# Propagate intersections backward
ts1_src = reduce(lambda ts, func: ts.preimage(func),
reversed(i1),
intersect)

View File

@@ -276,7 +276,7 @@ class SameWidth(TypeConstraint):
class TypeEnv(object):
"""
Class encapsulating the neccessary book keeping for type inference.
Class encapsulating the necessary book keeping for type inference.
:attribute type_map: dict holding the equivalence relations between tvs
:attribute constraints: a list of accumulated constraints - tuples
(tv1, tv2)) where tv1 and tv2 are equal
@@ -331,7 +331,7 @@ class TypeEnv(object):
"""
Record a that the free tv1 is part of the same equivalence class as
tv2. The canonical representative of the merged class is tv2's
cannonical representative.
canonical representative.
"""
assert not tv1.is_derived
assert self[tv1] == tv1
@@ -376,7 +376,7 @@ class TypeEnv(object):
non-derived TVs implicitly get the lowest rank (0). Derived variables
get their rank from their free typevar. Singletons have the highest
rank. TVs associated with vars in a source pattern have a higher rank
than TVs associted with temporary vars.
than TVs associated with temporary vars.
"""
default_rank = TypeEnv.RANK_INTERNAL if tv.singleton_type() is None \
else TypeEnv.RANK_SINGLETON
@@ -837,7 +837,7 @@ def ti_def(definition, typ):
fresh_formal_tvs = move_first(fresh_formal_tvs, idx)
actual_tvs = move_first(actual_tvs, idx)
# Unify each actual typevar with the correpsonding fresh formal tv
# Unify each actual typevar with the corresponding fresh formal tv
for (actual_tv, formal_tv) in zip(actual_tvs, fresh_formal_tvs):
typ_or_err = unify(actual_tv, formal_tv, typ)
err = get_error(typ_or_err)

View File

@@ -51,7 +51,7 @@ class Rtl(object):
# type: (VarAtomMap) -> Rtl
"""
Return a copy of this rtl with all Vars substituted with copies or
according to m. Update m as neccessary.
according to m. Update m as necessary.
"""
return Rtl(*[d.copy(m) for d in self.rtl])

View File

@@ -32,10 +32,10 @@ except ImportError:
def get_runtime_typechecks(xform):
# type: (XForm) -> List[TypeConstraint]
"""
Given a XForm build a list of runtime type checks neccessary to determine
Given a XForm build a list of runtime type checks necessary to determine
if it applies. We have 2 types of runtime checks:
1) typevar tv belongs to typeset T - needed for free tvs whose
typeset is constrainted by their use in the dst pattern
typeset is constrained by their use in the dst pattern
2) tv1 == tv2 where tv1 and tv2 are derived TVs - caused by unification
of non-bijective functions

View File

@@ -201,7 +201,7 @@ def equivalent(r1, r2, inp_m, out_m):
assert isinstance(v2, Var)
results_eq_exp.append(mk_eq(m1[v1], m2[v2]))
# Put the whole query toghether
# Put the whole query together
return q1 + q2 + args_eq_exp + [Not(And(*results_eq_exp))]

View File

@@ -49,7 +49,7 @@ pub enum Reloc {
impl fmt::Display for Reloc {
/// Display trait implementation drops the arch, since its used in contexts where the arch is
/// already unambigious, e.g. clif syntax with isa specified. In other contexts, use Debug.
/// already unambiguous, e.g. clif syntax with isa specified. In other contexts, use Debug.
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Reloc::Abs4 => write!(f, "Abs4"),

View File

@@ -505,7 +505,7 @@ impl DominatorTree {
/// - An ordering of EBBs according to a dominator tree pre-order.
/// - Constant time dominance checks at the EBB granularity.
///
/// The information in this auxillary data structure is not easy to update when the control flow
/// The information in this auxiliary data structure is not easy to update when the control flow
/// graph changes, which is why it is kept separate.
pub struct DominatorTreePreorder {
nodes: SecondaryMap<Ebb, ExtraNode>,

View File

@@ -162,7 +162,7 @@ where
{
let dfg = self.inserter.data_flow_graph_mut();
inst = dfg.make_inst(data);
// Make an `Interator<Item = Option<Value>>`.
// Make an `Iterator<Item = Option<Value>>`.
let ru = self.reuse.as_ref().iter().cloned();
dfg.make_inst_results_reusing(inst, ctrl_typevar, ru);
}

View File

@@ -92,8 +92,8 @@ impl MemFlags {
/// Test if the `readonly` flag is set.
///
/// Loads with this flag have no memory dependendies.
/// This results in indefined behavior if the dereferenced memory is mutated at any time
/// Loads with this flag have no memory dependencies.
/// This results in undefined behavior if the dereferenced memory is mutated at any time
/// between when the function is called and when it is exited.
pub fn readonly(self) -> bool {
self.read(FlagBit::Readonly)

View File

@@ -118,7 +118,7 @@ impl LoopAnalysis {
self.valid
}
/// Clear all the data structures contanted in the loop analysis. This will leave the
/// Clear all the data structures contained in the loop analysis. This will leave the
/// analysis in a similar state to a context returned by `new()` except that allocated
/// memory be retained.
pub fn clear(&mut self) {
@@ -191,7 +191,7 @@ impl LoopAnalysis {
let mut node_loop_parent_option = self.loops[node_loop].parent;
while let Some(node_loop_parent) = node_loop_parent_option.expand() {
if node_loop_parent == lp {
// We have encounterd lp so we stop (already visited)
// We have encountered lp so we stop (already visited)
break;
} else {
//

View File

@@ -157,7 +157,7 @@ mod details {
continue;
}
// Write a duration as secs.milis, trailing space.
// Write a duration as secs.millis, trailing space.
fn fmtdur(mut dur: Duration, f: &mut fmt::Formatter) -> fmt::Result {
// Round to nearest ms by adding 500us.
dur += Duration::new(0, 500_000);

View File

@@ -377,7 +377,7 @@ fn write_instruction(
write_operands(w, &func.dfg, isa, inst)?;
writeln!(w)?;
// Value aliases come out on lines after the instruction defining the referrent.
// Value aliases come out on lines after the instruction defining the referent.
for r in func.dfg.inst_results(inst) {
write_value_aliases(w, aliases, *r, indent)?;
}