File 0307-Fix-typos-in-lib-compiler.patch of Package erlang
From 145e96537a4ef8494ffb3ce9df47a8b52100ea27 Mon Sep 17 00:00:00 2001
From: "Kian-Meng, Ang" <kianmeng@cpan.org>
Date: Mon, 6 Dec 2021 06:14:28 +0800
Subject: [PATCH] Fix typos in lib/compiler
---
lib/compiler/doc/src/compile.xml | 2 +-
lib/compiler/doc/src/notes.xml | 12 ++++++------
lib/compiler/src/beam_jump.erl | 12 ++++++------
lib/compiler/src/beam_ssa.erl | 2 +-
lib/compiler/src/beam_ssa_bool.erl | 4 ++--
lib/compiler/src/beam_ssa_bsm.erl | 2 +-
lib/compiler/src/beam_ssa_codegen.erl | 2 +-
lib/compiler/src/beam_ssa_opt.erl | 10 +++++-----
lib/compiler/src/beam_ssa_pre_codegen.erl | 4 ++--
lib/compiler/src/beam_ssa_share.erl | 2 +-
lib/compiler/src/beam_ssa_type.erl | 2 +-
lib/compiler/src/cerl_inline.erl | 10 +++++-----
lib/compiler/src/compile.erl | 4 ++--
lib/compiler/src/genop.tab | 4 ++--
lib/compiler/src/rec_env.erl | 2 +-
lib/compiler/src/sys_core_bsm.erl | 2 +-
lib/compiler/src/sys_core_fold.erl | 2 +-
lib/compiler/src/v3_core.erl | 8 ++++----
lib/compiler/src/v3_kernel.erl | 6 +++---
lib/compiler/test/beam_jump_SUITE.erl | 2 +-
lib/compiler/test/beam_ssa_SUITE.erl | 4 ++--
lib/compiler/test/bs_construct_SUITE.erl | 2 +-
.../test/compilation_SUITE_data/compiler_1.erl | 8 ++++----
.../test/compilation_SUITE_data/convopts.erl | 2 +-
.../test/compilation_SUITE_data/opt_crash.erl | 2 +-
.../test/compilation_SUITE_data/otp_4790.erl | 2 +-
lib/compiler/test/compile_SUITE.erl | 4 ++--
lib/compiler/test/compile_SUITE_data/big.erl | 8 ++++----
lib/compiler/test/receive_SUITE.erl | 2 +-
.../test/receive_SUITE_data/ref_opt/yes_10.erl | 2 +-
.../test/receive_SUITE_data/ref_opt/yes_11.erl | 2 +-
lib/compiler/test/trycatch_SUITE.erl | 6 +++---
32 files changed, 69 insertions(+), 69 deletions(-)
diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml
index 58fa04aaee..d9967de0b9 100644
--- a/lib/compiler/doc/src/compile.xml
+++ b/lib/compiler/doc/src/compile.xml
@@ -255,7 +255,7 @@ module.beam: module.erl \
<tag><c>makedep_side_effect</c></tag>
<item>
- <p>The dependecies are created as a side effect to the
+ <p>The dependencies are created as a side effect to the
normal compilation process. This means that the object
file will also be produced. This option override the
<c>makedep</c> option.
diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml
index d6397a60ce..14b3a6cc1b 100644
--- a/lib/compiler/doc/src/notes.xml
+++ b/lib/compiler/doc/src/notes.xml
@@ -1071,7 +1071,7 @@
<item>
<p>The type optimization pass of the compiler could hang
or loop for a long time when analyzing a
- <c>setelement/3</c> call with a varible position.</p>
+ <c>setelement/3</c> call with a variable position.</p>
<p>
Own Id: OTP-15828 Aux Id: ERL-948 </p>
</item>
@@ -1788,7 +1788,7 @@
<item>
<p>The compiler could issue an incorrect internal
consistency failure diagnostic for some complicated bit
- syntax maches.</p>
+ syntax matches.</p>
<p>
Own Id: OTP-14640 Aux Id: ERL-490 </p>
</item>
@@ -3529,7 +3529,7 @@
Own Id: OTP-8579</p>
</item>
<item>
- <p>The undocumented, unsupport, and deprecated function
+ <p>The undocumented, unsupported, and deprecated function
<c>lists:flat_length/1</c> has been removed.</p>
<p>
Own Id: OTP-8584</p>
@@ -3578,7 +3578,7 @@
<item>
<p>
Using complex boolean expressions in ifs could cause the
- compiler to either crash or teminate with an internal
+ compiler to either crash or terminate with an internal
error. (Thanks to Simon Cornish.)</p>
<p>
Own Id: OTP-8338</p>
@@ -3778,7 +3778,7 @@
<p>Using <c>andalso</c>/<c>orelse</c> or record access in
a <c>try</c>...<c>catch</c> could cause a compiler
crash.</p>
- <p>Som large and complex functions could require
+ <p>Some large and complex functions could require
extremely long compilation times (hours or days).</p>
<p>
Own Id: OTP-7905</p>
@@ -4678,7 +4678,7 @@
string could cause the compiler to generate dangerous
code that could cause a crash at run-time (e.g.
<c><![CDATA[R#r{a="abc",b=1}]]></c>). (Thanks to Mikael Karlsson.)</p>
- <p>Unecessary tests (such as a 'case' with two case
+ <p>Unnecessary tests (such as a 'case' with two case
branches that were identical) could cause the compiler to
crash. (Thanks to Fredrik Thulin.)</p>
<p>The validation pass of the compiler could generate an
diff --git a/lib/compiler/src/beam_jump.erl b/lib/compiler/src/beam_jump.erl
index 25f7a1fb88..c7d05c5a81 100644
--- a/lib/compiler/src/beam_jump.erl
+++ b/lib/compiler/src/beam_jump.erl
@@ -107,7 +107,7 @@
%%% Note: This modules depends on (almost) all branches and jumps only
%%% going forward, so that we can remove instructions (including definition
%%% of labels) after any label that has not been referenced by the code
-%%% preceeding the labels. Regarding the few instructions that have backward
+%%% preceding the labels. Regarding the few instructions that have backward
%%% references to labels, we assume that they only transfer control back
%%% to an instruction that has already been executed. That is, code such as
%%%
@@ -411,7 +411,7 @@ unambigous_exit_call([{call_ext,A,{extfunc,M,F,A}}|Is]) ->
case erl_bifs:is_exit_bif(M, F, A) of
true ->
%% beam_validator requires that the size of the stack
- %% frame is unambigously known when a function is called.
+ %% frame is unambiguously known when a function is called.
%%
%% That means that we must be careful when sharing function
%% calls.
@@ -421,7 +421,7 @@ unambigous_exit_call([{call_ext,A,{extfunc,M,F,A}}|Is]) ->
%% rare circumstances. (See the undecided_allocation_1/1
%% function in beam_jump_SUITE.)
%%
- %% To ensure that the frame size is unambigous, only allow
+ %% To ensure that the frame size is unambiguous, only allow
%% sharing of a call to exit BIFs if the call is followed
%% by an instruction that indicates the size of the stack
%% frame (that is almost always the case in real-world
@@ -471,7 +471,7 @@ is_shareable([]) -> true.
%%
%% Classify labels according to where the instructions that branch to
%% the labels are located. Each label is assigned a set of scope
-%% identifers (but usually just one). If two labels have different
+%% identifiers (but usually just one). If two labels have different
%% scope identfiers, sharing a sequence that raises an exception
%% between the labels may not be safe, because one label is inside a
%% try/catch, and the other label is outside. Note that we don't care
@@ -708,7 +708,7 @@ collect_labels_1(Is, _Label, _Entry, Acc, St) ->
%% label_defined(Is, Label) -> true | false.
%% Test whether the label Label is defined at the start of the instruction
-%% sequence, possibly preceeded by other label definitions.
+%% sequence, possibly preceded by other label definitions.
%%
is_label_defined([{label,L}|_], L) -> true;
is_label_defined([{label,_}|Is], L) -> is_label_defined(Is, L);
@@ -821,7 +821,7 @@ drop_upto_label([]) -> [].
%% unshare([Instruction]) -> [Instruction].
%% Replace a jump to a return sequence (a `return` instruction
-%% optionally preced by a `deallocate` instruction) with the return
+%% optionally precede by a `deallocate` instruction) with the return
%% sequence. This always saves execution time and may also save code
%% space (depending on the architecture). Eliminating `jump`
%% instructions also gives beam_trim more opportunities to trim the
diff --git a/lib/compiler/src/beam_ssa.erl b/lib/compiler/src/beam_ssa.erl
index 37d0b4b364..2087e1aa88 100644
--- a/lib/compiler/src/beam_ssa.erl
+++ b/lib/compiler/src/beam_ssa.erl
@@ -602,7 +602,7 @@ between(From, To, Preds, Blocks) ->
%% skipping the blocks that don't precede `To`.
%%
%% As an optimization we initialize the predecessor set with `From` to stop
- %% gathering once seen since we're only interested in the blocks inbetween.
+ %% gathering once seen since we're only interested in the blocks in between.
%% Uninteresting blocks can still be added if `From` doesn't dominate `To`,
%% but that has no effect on the final result.
Filter = between_make_filter([To], Preds, sets:from_list([From], [{version, 2}])),
diff --git a/lib/compiler/src/beam_ssa_bool.erl b/lib/compiler/src/beam_ssa_bool.erl
index 2830339410..240160228a 100644
--- a/lib/compiler/src/beam_ssa_bool.erl
+++ b/lib/compiler/src/beam_ssa_bool.erl
@@ -938,7 +938,7 @@ opt_digraph_instr(#b_set{dst=Dst}=I, G0, St) ->
%% 'xor' is almost never used in practice.
not_possible();
#b_set{op={bif,'not'}} ->
- %% This is suprisingly rare. The previous attempt to
+ %% This is surprisingly rare. The previous attempt to
%% optimize it was broken, which wasn't noticed because
%% very few test cases triggered this code.
not_possible();
@@ -1030,7 +1030,7 @@ eaten_by_phi(V, G) ->
%% order_args([Arg1,Arg2], G, St) -> {First,Second}.
%% Order arguments for a boolean operator so that there is path in the
%% digraph from the instruction referered to by the first operand to
-%% the instruction refered to by the second operand.
+%% the instruction referred to by the second operand.
order_args([#b_var{}=VarA,#b_var{}=VarB], G, St) ->
{VA,VB} = {get_vertex(VarA, St),get_vertex(VarB, St)},
diff --git a/lib/compiler/src/beam_ssa_bsm.erl b/lib/compiler/src/beam_ssa_bsm.erl
index 59872290a6..b453211b9b 100644
--- a/lib/compiler/src/beam_ssa_bsm.erl
+++ b/lib/compiler/src/beam_ssa_bsm.erl
@@ -422,7 +422,7 @@ is_var_in_args(_Var, []) -> false.
%%% Subpasses
%%%
-%% Removes superflous chained bs_start_match instructions in the same
+%% Removes superfluous chained bs_start_match instructions in the same
%% function. When matching on an extracted tail binary, or on a binary we've
%% already matched on, we reuse the original match context.
%%
diff --git a/lib/compiler/src/beam_ssa_codegen.erl b/lib/compiler/src/beam_ssa_codegen.erl
index 3ed13064b8..c67ebcdef7 100644
--- a/lib/compiler/src/beam_ssa_codegen.erl
+++ b/lib/compiler/src/beam_ssa_codegen.erl
@@ -878,7 +878,7 @@ opt_allocate_is([]) -> none.
%% fix_wait_timeout([Block]) -> [Block].
%% In SSA code, the `wait_timeout` instruction is a three-way branch
%% (because there will be an exception for a bad timeout value). In
-%% BEAM code, the potential rasing of an exception for a bad timeout
+%% BEAM code, the potential raising of an exception for a bad timeout
%% duration is not explicitly represented. Thus we will need to
%% rewrite the following code:
%%
diff --git a/lib/compiler/src/beam_ssa_opt.erl b/lib/compiler/src/beam_ssa_opt.erl
index 91db5c6400..84a0f4c81d 100644
--- a/lib/compiler/src/beam_ssa_opt.erl
+++ b/lib/compiler/src/beam_ssa_opt.erl
@@ -1071,7 +1071,7 @@ cse_suitable(#b_set{}) -> false.
%%% will take special care to keep not using them in guards. Using
%%% them in guards would require a new version of the 'fconv'
%%% instruction that would take a failure label. Since it is unlikely
-%%% that using float instructions in guards would be benefical, why
+%%% that using float instructions in guards would be beneficial, why
%%% bother implementing a new instruction?
%%%
@@ -1123,7 +1123,7 @@ float_opt_1(L, #b_blk{is=Is0}=Blk0, Bs0, Count0, Fs0) ->
end.
%% Split out {float,convert} instructions into separate blocks, number
-%% the blocks, and add {succeded,body} in each {float,convert} block.
+%% the blocks, and add {succeeded,body} in each {float,convert} block.
float_fixup_conv(L, Is, Blk, Count0) ->
Split = float_split_conv(Is, Blk),
{Blks,Count} = float_number(Split, L, Count0),
@@ -1420,7 +1420,7 @@ live_opt_is([], Live, Acc) ->
%%%
%%% try/catch optimization.
%%%
-%%% Attemps to rewrite try/catches as guards when we know the exception won't
+%%% Attempts to rewrite try/catches as guards when we know the exception won't
%%% be inspected in any way, and removes try/catches whose expressions will
%%% never throw.
%%%
@@ -2931,8 +2931,8 @@ unfold_arg(Expr, _LitMap, _X) -> Expr.
%%% ret @ssa_ret
%%%
%%% The beam_ssa_codegen pass will not recognize this code as a tail
-%%% call and will generate an unncessary stack frame. It may also
-%%% generate unecessary `kill` instructions.
+%%% call and will generate an unnecessary stack frame. It may also
+%%% generate unnecessary `kill` instructions.
%%%
%%% To avoid those extra instructions, this optimization will
%%% eliminate the `succeeded:body` and `br` instructions and insert
diff --git a/lib/compiler/src/beam_ssa_pre_codegen.erl b/lib/compiler/src/beam_ssa_pre_codegen.erl
index ba11360974..6f27f613cc 100644
--- a/lib/compiler/src/beam_ssa_pre_codegen.erl
+++ b/lib/compiler/src/beam_ssa_pre_codegen.erl
@@ -712,7 +712,7 @@ sanitize_instr(phi, PhiArgs, _I) ->
%% turned off.)
%%
%% This phi node always produces the same literal value.
- %% We must do constant progation of the value to ensure
+ %% We must do constant propagation of the value to ensure
%% that we can sanitize any instructions that don't accept
%% literals (such as `get_hd`). This is necessary for
%% correctness, because beam_ssa_codegen:prefer_xregs/2
@@ -1096,7 +1096,7 @@ place_frames_1([], _, _, Tried, Frames) ->
%% do_place_frame(Label, Blocks, Dominators, Tried0, Frames0) -> {Frames,Tried}.
%% Try to place a frame in this block. This function returns
-%% successfully if it either succeds at placing a frame in this
+%% successfully if it either succeeds at placing a frame in this
%% block, if an ancestor that dominates this block has already placed
%% a frame, or if we have already tried to put a frame in this block.
%%
diff --git a/lib/compiler/src/beam_ssa_share.erl b/lib/compiler/src/beam_ssa_share.erl
index ae8f582430..50151e6449 100644
--- a/lib/compiler/src/beam_ssa_share.erl
+++ b/lib/compiler/src/beam_ssa_share.erl
@@ -151,7 +151,7 @@ are_equivalent(_Succ, #b_blk{is=Is1,last=#b_ret{arg=RetVal1}=Ret1},
false
end;
{#b_var{},#b_var{}} ->
- %% The return values are varibles. We must canonicalize
+ %% The return values are variables. We must canonicalize
%% the blocks (including returns) and compare them.
Can1 = canonical_is(Is1 ++ [Ret1]),
Can2 = canonical_is(Is2 ++ [Ret2]),
diff --git a/lib/compiler/src/beam_ssa_type.erl b/lib/compiler/src/beam_ssa_type.erl
index 65acb3f813..b5eb69723b 100644
--- a/lib/compiler/src/beam_ssa_type.erl
+++ b/lib/compiler/src/beam_ssa_type.erl
@@ -2382,7 +2382,7 @@ wl_changed(#worklist{counter=Same}, #worklist{counter=Same}) -> false;
wl_changed(#worklist{}, #worklist{}) -> true.
%% Adds the given elements to the back of the worklist, skipping the elements
-%% that are already present. This lets us append elements arbitrarly after the
+%% that are already present. This lets us append elements arbitrarily after the
%% current front without changing the work order.
wl_defer_list(Elements, #worklist{counter=Counter,elements=Es,indexes=Is}) ->
wl_defer_list_1(Elements, Counter, Es, Is).
diff --git a/lib/compiler/src/cerl_inline.erl b/lib/compiler/src/cerl_inline.erl
index 3f3d162302..54b56d2449 100644
--- a/lib/compiler/src/cerl_inline.erl
+++ b/lib/compiler/src/cerl_inline.erl
@@ -615,7 +615,7 @@ i_case(E, Ctxt, Ren, Env, S) ->
%% the arguments of the application to be evaluated *after* the
%% switch expression, but *before* the body of the selected clause.
%% Such interleaving is not allowed in general, and it does not seem
- %% worthwile to make a more powerful transformation here. Therefore,
+ %% worthwhile to make a more powerful transformation here. Therefore,
%% the clause bodies are conservatively visited for value if the
%% context is `application'.
Ctxt1 = safe_context(Ctxt),
@@ -967,7 +967,7 @@ i_letrec(Es, B, Xs, Ctxt, Ren, Env, NoInline, S) ->
%% Finally, we create new letrec-bindings for any and all
%% residualised definitions. All referenced functions should have
- %% been visited; the call to `visit' below is expected to retreive a
+ %% been visited; the call to `visit' below is expected to retrieve a
%% cached expression.
Rs1 = keep_referenced(Rs, S4),
{Es1, S5} = mapfoldl(fun (R, S) ->
@@ -1013,7 +1013,7 @@ i_apply(E, Ctxt, Ren, Env, S) ->
%% location could be recycled after the flag has been tested, but
%% there is no real advantage to that, because in practice, only
%% 4-5% of all created store locations will ever be reused, while
- %% there will be a noticable overhead for managing the free list.)
+ %% there will be a noticeable overhead for managing the free list.)
case st__get_app_inlined(L, S3) of
true ->
%% The application was inlined, so we have the final
@@ -1124,7 +1124,7 @@ i_call_2(M, F, As, E, S) ->
%% to rewrite the expression.
i_call_3(M, F, As, E, Ctxt, Env, S) ->
- %% Note that we extract the results of argument expessions here; the
+ %% Note that we extract the results of argument expressions here; the
%% expressions could still be sequences with side effects.
Vs = [concrete(result(A)) || A <- As],
try apply(atom_val(M), atom_val(F), Vs) of
@@ -2096,7 +2096,7 @@ residualize_operand(Opnd, E, S) ->
case st__get_opnd_effect(Opnd#opnd.loc, S) of
true ->
%% The operand has not been visited, so we do that now, but
- %% in `effect' context. (Waddell's algoritm does some stuff
+ %% in `effect' context. (Waddell's algorithm does some stuff
%% here to account specially for the operand size, which
%% appears unnecessary.)
{E1, S1} = i(Opnd#opnd.expr, effect, Opnd#opnd.ren,
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 840824af0f..53c349123f 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -1400,7 +1400,7 @@ makedep_output(Code, #compile{options=Opts,ofile=Ofile}=St) ->
if
is_list(Output) ->
- %% Write the depedencies to a file.
+ %% Write the dependencies to a file.
case file:write_file(Output, Code) of
ok ->
{ok,Code,St};
@@ -1409,7 +1409,7 @@ makedep_output(Code, #compile{options=Opts,ofile=Ofile}=St) ->
{error,St#compile{errors=St#compile.errors++[Err]}}
end;
true ->
- %% Write the depedencies to a device.
+ %% Write the dependencies to a device.
try io:fwrite(Output, "~ts", [Code]) of
ok ->
{ok,Code,St}
diff --git a/lib/compiler/src/genop.tab b/lib/compiler/src/genop.tab
index 68935b1980..a11bb6be03 100755
--- a/lib/compiler/src/genop.tab
+++ b/lib/compiler/src/genop.tab
@@ -170,7 +170,7 @@ BEAM_FORMAT_NUMBER=0
## receive loop at Label.
25: wait/1
-## @spec wait_timeout Lable Time
+## @spec wait_timeout Label Time
## @doc Sets up a timeout of Time milliseconds and saves the address of the
## following instruction as the entry point if the timeout triggers.
26: wait_timeout/2
@@ -192,7 +192,7 @@ BEAM_FORMAT_NUMBER=0
38: -int_bnot/3
#
-# Comparision operators.
+# Comparison operators.
#
## @spec is_lt Lbl Arg1 Arg2
diff --git a/lib/compiler/src/rec_env.erl b/lib/compiler/src/rec_env.erl
index 48d39776dc..753eca4c66 100644
--- a/lib/compiler/src/rec_env.erl
+++ b/lib/compiler/src/rec_env.erl
@@ -478,7 +478,7 @@ get(Key, Env) ->
-define(MINIMUM_RANGE, 1000).
-define(START_RANGE_FACTOR, 50).
-define(MAX_RETRIES, 2). % retries before enlarging range
--define(ENLARGE_FACTOR, 10). % range enlargment factor
+-define(ENLARGE_FACTOR, 10). % range enlargement factor
-ifdef(DEBUG).
%% If you want to use these process dictionary counters, make sure to
diff --git a/lib/compiler/src/sys_core_bsm.erl b/lib/compiler/src/sys_core_bsm.erl
index 97f0dab194..81b2635243 100644
--- a/lib/compiler/src/sys_core_bsm.erl
+++ b/lib/compiler/src/sys_core_bsm.erl
@@ -41,7 +41,7 @@ function([{#c_var{name={F,Arity}}=Name,B0}|Fs]) ->
function([]) ->
[].
-%%% Reorder bit syntax matching to faciliate optimization in further passes.
+%%% Reorder bit syntax matching to facilitate optimization in further passes.
bsm_reorder(#c_case{arg=#c_var{}=V}=Case) ->
bsm_reorder_1([V], Case);
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index f0f764680f..2b30fb09cd 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -2745,7 +2745,7 @@ void() -> #c_literal{val=ok}.
%%% While optimizing this code fragment, two warnings for useless
%%% building will be generated: one for the list and one for the tuple
%%% inside. Before the introduction of column numbers, those two warnings
-%%% would be coalesced to one becuase they had the same line number.
+%%% would be coalesced to one because they had the same line number.
%%%
%%% With column numbers, we will need a more sophisticated solution to
%%% avoid emitting annoying duplicate warnings.
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index 1eb7f9778b..864d444f18 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -204,7 +204,7 @@ form({attribute,_,module,Mod}, Module, _Opts) ->
form({attribute,_,file,{File,_Line}}=F, #imodule{attrs=As}=Module, _Opts) ->
Module#imodule{file=File, attrs=[attribute(F)|As]};
form({attribute,_,import,_}, Module, _Opts) ->
- %% Ignore. We have no futher use for imports.
+ %% Ignore. We have no further use for imports.
Module;
form({attribute,_,export,Es}, #imodule{exports=Exp0}=Module, _Opts) ->
Exp = ordsets:union(ordsets:from_list(Es), Exp0),
@@ -282,7 +282,7 @@ clause({clause,Lc,H0,G0,B0}, St0) ->
catch
throw:nomatch ->
%% This pattern can't possibly match. If we simply remove
- %% the clause, varibles that are used later might not be
+ %% the clause, variables that are used later might not be
%% bound. Therefore, we must keep the clause, but rewrite
%% the pattern to a pattern that will bind the same
%% variables and ensure that the clause can't be executed
@@ -303,7 +303,7 @@ head(Ps, St) ->
pattern_list(Ps, St).
%% guard([Expr], State) -> {[Cexpr],State}.
-%% Build an explict and/or tree of guard alternatives, then traverse
+%% Build an explicit and/or tree of guard alternatives, then traverse
%% top-level and/or tree and "protect" inner tests.
guard([], St) -> {[],St};
@@ -422,7 +422,7 @@ gexpr_not(A, Bools0, St0, Line) ->
%% which will produce the same result, but may eliminate
%% redundant is_boolean/1 tests (see unforce/3).
%%
- %% Note that this tranformation would not be safe if the
+ %% Note that this transformation would not be safe if the
%% original expression had been:
%%
%% not(Expr =:= true)
diff --git a/lib/compiler/src/v3_kernel.erl b/lib/compiler/src/v3_kernel.erl
index c764c814a2..bf3fd01986 100644
--- a/lib/compiler/src/v3_kernel.erl
+++ b/lib/compiler/src/v3_kernel.erl
@@ -337,7 +337,7 @@ expr(#c_call{anno=A,module=M0,name=F0,args=Cargs}, Sub, St0) ->
{#k_call{anno=A,op=Remote,args=Kargs},Ap,St1};
error ->
%% Invalid call (e.g. M:42/3). Issue a warning, and let
- %% the generated code use the old explict apply.
+ %% the generated code use the old explicit apply.
St = add_warning(get_location(A), {failed,bad_call}, A, St0),
Call = #c_call{anno=A,
module=#c_literal{val=erlang},
@@ -1216,7 +1216,7 @@ expand_pat_lit(Lit, A) ->
%% comparing with the literal (that is especially true for binaries).
%%
%% It is important not to do this transformation for atomic literals
-%% (such as `[]`), since that would cause the test for an emtpy list
+%% (such as `[]`), since that would cause the test for an empty list
%% to be executed before the test for a nonempty list.
opt_single_valued(Ttcs) ->
@@ -1610,7 +1610,7 @@ new_clauses(Cs0, U, St) ->
%% will be grouped next.
%%
%% We also try to not create too large groups. If we have too many clauses,
-%% it is preferrable to match on 8-bits, select a branch, then match on the
+%% it is preferable to match on 8-bits, select a branch, then match on the
%% next 8-bits, rather than match on 16-bits which would force us to have
%% to select to many values at the same time, which would not be efficient.
%%
diff --git a/lib/compiler/test/beam_jump_SUITE.erl b/lib/compiler/test/beam_jump_SUITE.erl
index 569d0f7b26..7c8de55177 100644
--- a/lib/compiler/test/beam_jump_SUITE.erl
+++ b/lib/compiler/test/beam_jump_SUITE.erl
@@ -169,7 +169,7 @@ expects_h(7, Atom) ->
ok.
%% When compiled with +no_copt, beam_validator would complain about
-%% ambigous try/catch state.
+%% ambiguous try/catch state.
ambiguous_catch_try_state_1(<<42:false>>) ->
%% The beam_ssa_bsm pass will duplicate the entire second clause.
%% beam_jump will share the blocks with the build_stacktrace
diff --git a/lib/compiler/test/beam_ssa_SUITE.erl b/lib/compiler/test/beam_ssa_SUITE.erl
index 6bada57a2a..e1b45fd0f1 100644
--- a/lib/compiler/test/beam_ssa_SUITE.erl
+++ b/lib/compiler/test/beam_ssa_SUITE.erl
@@ -714,7 +714,7 @@ do_beam_ssa_dead_crash(A, B) ->
%% paths happens to end up in the same place.
%%
%% During the simulated execution of this function, the boolean
- %% varible for a `br` instruction would be replaced with the
+ %% variable for a `br` instruction would be replaced with the
%% literal atom `nil`, which is not allowed, and would crash the
%% compiler. In practice, during the actual execution, control
%% would never be transferred to that `br` instruction when the
@@ -999,7 +999,7 @@ grab_bag_11() ->
_ -> other
catch
_:_ ->
- catched
+ caught
end.
grab_bag_12() ->
diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl
index d61054bb09..7334ca303a 100644
--- a/lib/compiler/test/bs_construct_SUITE.erl
+++ b/lib/compiler/test/bs_construct_SUITE.erl
@@ -164,7 +164,7 @@ l(I_13, I_big1, I_16, Bin) ->
?T(<<869:16/little,3479:I_13,Bin/binary,7:1/unit:3,Bin/binary>>,
[101,3,108,189,42,214,31,165,90,195]),
- %% Test of aligment flag.
+ %% Test of alignment flag.
?T(<<0:I_13/unit:8,1:6,0:2>>,
[0,0,0,0,0,0,0,0,0,0,0,0,0,4]),
diff --git a/lib/compiler/test/compilation_SUITE_data/compiler_1.erl b/lib/compiler/test/compilation_SUITE_data/compiler_1.erl
index 87985bdf80..ad65677275 100644
--- a/lib/compiler/test/compilation_SUITE_data/compiler_1.erl
+++ b/lib/compiler/test/compilation_SUITE_data/compiler_1.erl
@@ -116,13 +116,13 @@ compiler_1() -> ok.
%%% test/0
%%%
%%% Run the complete test suite.
-%%% Reads Nodes from nodes.profile and starts them if neccessary.
+%%% Reads Nodes from nodes.profile and starts them if necessary.
%%% Kills Mnesia and wipes out the Mnesia directories as a starter.
%%%
%%% test/1
%%%
%%% Run parts of the test suite.
-%%% Reads Nodes from nodes.profile and starts them if neccessary.
+%%% Reads Nodes from nodes.profile and starts them if necessary.
%%% Kills Mnesia and wipes out the Mnesia directories as a starter.
%%%
%%% test/2
@@ -615,7 +615,7 @@ replica_management(Nodes) ->
done.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Add and drop indecies
+%% Add and drop indices
index_lifecycle(suite) ->
[ add_table_index, create_live_table_index, del_table_index ].
@@ -689,7 +689,7 @@ del_table_index(Nodes) ->
done.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Syncronize table with log or disc
+%% Synchronize table with log or disc
%%
table_sync(suite) ->
[ dump_tables, dump_log, change_dump_log_config, wait_for_tables, force_load_table ].
diff --git a/lib/compiler/test/compilation_SUITE_data/convopts.erl b/lib/compiler/test/compilation_SUITE_data/convopts.erl
index 8404eb82fd..3a0f1c5b07 100644
--- a/lib/compiler/test/compilation_SUITE_data/convopts.erl
+++ b/lib/compiler/test/compilation_SUITE_data/convopts.erl
@@ -108,7 +108,7 @@ convopts(Opts) ->
%% This undocumented clause uses an undocumented
%% feature of the TIPC socket interface that takes
%% advantage of some gory internals of the protocol.
- %% It is protocol implementation dependant and
+ %% It is protocol implementation dependent and
%% breaks the whole idea of location transparency
%% for name addressed messages. Therefore it should
%% only be used when all other possibilities are
diff --git a/lib/compiler/test/compilation_SUITE_data/opt_crash.erl b/lib/compiler/test/compilation_SUITE_data/opt_crash.erl
index 4643ce61f6..4ea08e97f1 100644
--- a/lib/compiler/test/compilation_SUITE_data/opt_crash.erl
+++ b/lib/compiler/test/compilation_SUITE_data/opt_crash.erl
@@ -45,7 +45,7 @@ test() ->
nil},
{query,nil}}} = URI_Before,
- %% ... some funky code ommitted, not relevant ...
+ %% ... some funky code omitted, not relevant ...
{absoluteURI,
{scheme,_},
diff --git a/lib/compiler/test/compilation_SUITE_data/otp_4790.erl b/lib/compiler/test/compilation_SUITE_data/otp_4790.erl
index 08769c5303..aec102b581 100644
--- a/lib/compiler/test/compilation_SUITE_data/otp_4790.erl
+++ b/lib/compiler/test/compilation_SUITE_data/otp_4790.erl
@@ -32,7 +32,7 @@
% causing a crash at run-time.
% The same error could cause tuple tests to be removed,
-% but that would propbably only cause a crash if the
+% but that would probably only cause a crash if the
% Erlang code was incorrect or if it depended on a catch
% to catch exceptions. Therefore, I consider it unlikely
% that Erlang programs that don't use floating point
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl
index 3a622fe2f8..4860837912 100644
--- a/lib/compiler/test/compile_SUITE.erl
+++ b/lib/compiler/test/compile_SUITE.erl
@@ -428,7 +428,7 @@ makedep_canonicalize_result(Mf, DataDir) ->
%% Replace the Datadir by "$(srcdir)".
Mf1 = re:replace(Mf0, DataDir, "$(srcdir)/",
[global,multiline,{return,list}]),
- %% Long lines are splitted, put back everything on one line.
+ %% Long lines are split, put back everything on one line.
Mf2 = re:replace(Mf1, "\\\\\n ", "", [global,multiline,{return,list}]),
list_to_binary(Mf2).
@@ -774,7 +774,7 @@ install_crypto_key(Key) ->
end,
ok = beam_lib:crypto_key_fun(F).
-%% Miscellanous tests, mainly to get better coverage.
+%% Miscellaneous tests, mainly to get better coverage.
debug_info(erlang_v1, Module, ok, _Opts) ->
{ok, [Module]};
debug_info(erlang_v1, _Module, error, _Opts) ->
diff --git a/lib/compiler/test/compile_SUITE_data/big.erl b/lib/compiler/test/compile_SUITE_data/big.erl
index 765c71c07d..359fbf5c97 100644
--- a/lib/compiler/test/compile_SUITE_data/big.erl
+++ b/lib/compiler/test/compile_SUITE_data/big.erl
@@ -116,13 +116,13 @@ compiler_1() -> ok.
%%% test/0
%%%
%%% Run the complete test suite.
-%%% Reads Nodes from nodes.profile and starts them if neccessary.
+%%% Reads Nodes from nodes.profile and starts them if necessary.
%%% Kills Mnesia and wipes out the Mnesia directories as a starter.
%%%
%%% test/1
%%%
%%% Run parts of the test suite.
-%%% Reads Nodes from nodes.profile and starts them if neccessary.
+%%% Reads Nodes from nodes.profile and starts them if necessary.
%%% Kills Mnesia and wipes out the Mnesia directories as a starter.
%%%
%%% test/2
@@ -615,7 +615,7 @@ replica_management(Nodes) ->
done.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Add and drop indecies
+%% Add and drop indices
index_lifecycle(suite) ->
[ add_table_index, create_live_table_index, del_table_index ].
@@ -689,7 +689,7 @@ del_table_index(Nodes) ->
done.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Syncronize table with log or disc
+%% Synchronize table with log or disc
%%
table_sync(suite) ->
[ dump_tables, dump_log, change_dump_log_config, wait_for_tables, force_load_table ].
diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl
index ca14b2a4b5..1bda3d3623 100644
--- a/lib/compiler/test/receive_SUITE.erl
+++ b/lib/compiler/test/receive_SUITE.erl
@@ -527,7 +527,7 @@ recv_in_try_1(Timeout, Format) ->
%% {test,test_arity,{f,148},[{x,0},2]}.
%% {get_tuple_element,{x,0},0,{y,1}}. %y1 is fragile.
%%
- %% %% Here the fragility of y1 would be be progated to
+ %% %% Here the fragility of y1 would be be propagated to
%% %% the 'catch' below. Incorrect, since get_tuple_element
%% %% can't fail.
%% {get_tuple_element,{x,0},1,{x,2}}.
diff --git a/lib/compiler/test/receive_SUITE_data/ref_opt/yes_10.erl b/lib/compiler/test/receive_SUITE_data/ref_opt/yes_10.erl
index 7ce6e6103c..ea228d4ac6 100644
--- a/lib/compiler/test/receive_SUITE_data/ref_opt/yes_10.erl
+++ b/lib/compiler/test/receive_SUITE_data/ref_opt/yes_10.erl
@@ -7,7 +7,7 @@
f() ->
Ref = make_ref(),
receive
- %% Artifical example to cover more code in beam_receive.
+ %% Artificial example to cover more code in beam_receive.
{X,Y} when Ref =/= X, Ref =:= Y ->
ok
end.
diff --git a/lib/compiler/test/receive_SUITE_data/ref_opt/yes_11.erl b/lib/compiler/test/receive_SUITE_data/ref_opt/yes_11.erl
index 62f439fc42..b58d9f7561 100644
--- a/lib/compiler/test/receive_SUITE_data/ref_opt/yes_11.erl
+++ b/lib/compiler/test/receive_SUITE_data/ref_opt/yes_11.erl
@@ -4,7 +4,7 @@
?MODULE() ->
ok.
-%% Artifical example to cover more code in beam_receive.
+%% Artificial example to cover more code in beam_receive.
do_call(Process, Request) ->
Mref = erlang:monitor(process, Process),
Process ! Request,
diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl
index 1cde10adce..17cf7ff4d5 100644
--- a/lib/compiler/test/trycatch_SUITE.erl
+++ b/lib/compiler/test/trycatch_SUITE.erl
@@ -121,7 +121,7 @@ basic(Conf) when is_list(Conf) ->
%% Try/of
ok = try V of
{a,variable} -> ok
- catch nisse -> erro
+ catch nisse -> error
end,
%% Unmatchable clauses.
@@ -1015,7 +1015,7 @@ do_plain_catch_list(X) ->
andalso_orelse(Config) when is_list(Config) ->
{2,{a,42}} = andalso_orelse_1(true, {a,42}),
{b,{b}} = andalso_orelse_1(false, {b}),
- {catched,no_tuple} = andalso_orelse_1(false, no_tuple),
+ {caught,no_tuple} = andalso_orelse_1(false, no_tuple),
ok = andalso_orelse_2({type,[a]}),
also_ok = andalso_orelse_2({type,[]}),
@@ -1031,7 +1031,7 @@ andalso_orelse_1(A, B) ->
element(1, B)
end
catch error:_ ->
- catched
+ caught
end,B}.
andalso_orelse_2({Type,Keyval}) ->
--
2.31.1