Skip to content

Commit d13f1e2

Browse files
m-schmidtbschommer
authored andcommitted
Various improvements in the wording of diagnostics.
Fix various typos in diagnostic messages and unified wording and capitalization. Bug 23850
1 parent a206419 commit d13f1e2

13 files changed

+98
-99
lines changed

backend/Regalloc.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ let add_interfs_instr g instr live =
644644
(* Reloads from incoming slots can occur when some 64-bit
645645
parameters are split and passed as two 32-bit stack locations. *)
646646
begin match src with
647-
| L(Locations.S(Incoming, _, _)) ->
647+
| L(Locations.S(Incoming, _, _)) ->
648648
add_interfs_def g (vmreg temp_for_parent_frame) live
649649
| _ -> ()
650650
end
@@ -1210,9 +1210,9 @@ let regalloc f =
12101210
Errors.OK(first_round f3 liveness)
12111211
with
12121212
| Timeout ->
1213-
Errors.Error(Errors.msg (coqstring_of_camlstring "Spilling fails to converge"))
1213+
Errors.Error(Errors.msg (coqstring_of_camlstring "spilling fails to converge"))
12141214
| Type_error_at pc ->
1215-
Errors.Error [Errors.MSG(coqstring_of_camlstring "Ill-typed XTL code at PC ");
1215+
Errors.Error [Errors.MSG(coqstring_of_camlstring "ill-typed XTL code at PC ");
12161216
Errors.POS pc]
12171217
| Bad_LTL ->
1218-
Errors.Error(Errors.msg (coqstring_of_camlstring "Bad LTL after spilling"))
1218+
Errors.Error(Errors.msg (coqstring_of_camlstring "bad LTL after spilling"))

cparser/Elab.ml

+73-74
Large diffs are not rendered by default.

cparser/Lexer.mll

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ open Pre_parser_aux
2121
module SSet = Set.Make(String)
2222

2323
let lexicon : (string, Cabs.cabsloc -> token) Hashtbl.t = Hashtbl.create 17
24-
let ignored_keyworkds : SSet.t ref = ref SSet.empty
24+
let ignored_keywords : SSet.t ref = ref SSet.empty
2525

2626
let () =
2727
List.iter (fun (key, builder) -> Hashtbl.add lexicon key builder)
@@ -85,7 +85,7 @@ let () =
8585
("while", fun loc -> WHILE loc)];
8686
if Configuration.system <> "diab" then
8787
(* We can ignore the __extension__ GCC keyword. *)
88-
ignored_keyworkds := SSet.add "__extension__" !ignored_keyworkds
88+
ignored_keywords := SSet.add "__extension__" !ignored_keywords
8989

9090
let init_ctx = SSet.singleton "__builtin_va_list"
9191
let types_context : SSet.t ref = ref init_ctx
@@ -329,7 +329,7 @@ rule initial = parse
329329
| "," { COMMA(currentLoc lexbuf) }
330330
| "." { DOT(currentLoc lexbuf) }
331331
| identifier as id {
332-
if SSet.mem id !ignored_keyworkds then
332+
if SSet.mem id !ignored_keywords then
333333
initial lexbuf
334334
else
335335
try Hashtbl.find lexicon id (currentLoc lexbuf)

cparser/Parse.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ let preprocessed_file transfs name sourcefile =
6969
| Parser.Parser.Inter.Fail_pr ->
7070
(* Theoretically impossible : implies inconsistencies
7171
between grammars. *)
72-
Diagnostics.fatal_error Diagnostics.no_loc "Internal error while parsing"
72+
Diagnostics.fatal_error Diagnostics.no_loc "internal error while parsing"
7373
| Parser.Parser.Inter.Timeout_pr -> assert false
7474
| Parser.Parser.Inter.Parsed_pr (ast, _ ) -> ast) in
7575
let p1 = Timing.time "Elaboration" Elab.elab_file ast in

cparser/Unblock.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ let rec local_initializer env path init k =
3131
let (ty_elt, sz) =
3232
match unroll env path.etyp with
3333
| TArray(ty_elt, Some sz, _) -> (ty_elt, sz)
34-
| _ -> Diagnostics.fatal_error Diagnostics.no_loc "Wrong type for array initializer" in
34+
| _ -> Diagnostics.fatal_error Diagnostics.no_loc "wrong type for array initializer" in
3535
let rec array_init pos il =
3636
if pos >= sz then k else begin
3737
let (i1, il') =

debug/DwarfPrinter.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ module DwarfPrinter(Target: DWARF_TARGET):
241241
let abbrev = !curr_abbrev in
242242
incr curr_abbrev;abbrev
243243

244-
(* Mapping from abbreviation string to abbrevaiton id *)
244+
(* Mapping from abbreviation string to abbreviaton id *)
245245
let abbrev_mapping: (string,int) Hashtbl.t = Hashtbl.create 7
246246

247247
(* Look up the id of the abbreviation and add it if it is missing *)

driver/Assembler.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ val assemble: string -> string -> unit
1515
(** From asm to object file *)
1616

1717
val assembler_actions: (Commandline.pattern * Commandline.action) list
18-
(** Commandline optins affecting the assembler *)
18+
(** Commandline options affecting the assembler *)
1919

2020
val assembler_help: string
2121
(** Commandline help description *)

driver/Commandline.ml

+6-6
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ let parse_array spec argv first last =
7474
with Not_found -> find_action s inexact_cases in
7575
match optact with
7676
| None ->
77-
let msg = sprintf "Unknown argument `%s'" s in
77+
let msg = sprintf "unknown argument `%s'" s in
7878
raise (CmdError msg)
7979
| Some(Set r) ->
8080
r := true; parse (i+1)
@@ -86,7 +86,7 @@ let parse_array spec argv first last =
8686
if i + 1 <= last then begin
8787
fn argv.(i+1); parse (i+2)
8888
end else begin
89-
let msg = sprintf "Option `%s' expects an argument" s in
89+
let msg = sprintf "option `%s' expects an argument" s in
9090
raise (CmdError msg)
9191
end
9292
| Some(Integer fn) ->
@@ -95,19 +95,19 @@ let parse_array spec argv first last =
9595
try
9696
int_of_string argv.(i+1)
9797
with Failure _ ->
98-
let msg = sprintf "Argument to option `%s' must be an integer" s in
98+
let msg = sprintf "argument to option `%s' must be an integer" s in
9999
raise (CmdError msg)
100100
in
101101
fn n; parse (i+2)
102102
end else begin
103-
let msg = sprintf "Option `%s' expects an argument" s in
103+
let msg = sprintf "option `%s' expects an argument" s in
104104
raise (CmdError msg)
105105
end
106106
| Some (Ignore) ->
107107
if i + 1 <= last then begin
108108
parse (i+2)
109109
end else begin
110-
let msg = sprintf "Option `%s' expects an argument" s in
110+
let msg = sprintf "option `%s' expects an argument" s in
111111
raise (CmdError msg)
112112
end
113113
| Some (Unit f) -> f (); parse (i+1)
@@ -131,7 +131,7 @@ let long_int_action key s =
131131
try
132132
int_of_string s
133133
with Failure _ ->
134-
let msg = sprintf "Argument to option `%s' must be an integer" key in
134+
let msg = sprintf "argument to option `%s' must be an integer" key in
135135
raise (CmdError msg)
136136

137137
let longopt_int key f =

driver/Driver.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ let _ =
404404
parse_cmdline cmdline_actions;
405405
DebugInit.init (); (* Initialize the debug functions *)
406406
if nolink () && !option_o <> None && !num_source_files >= 2 then
407-
fatal_error no_loc "Ambiguous '-o' option (multiple source files)";
407+
fatal_error no_loc "ambiguous '-o' option (multiple source files)";
408408
if !num_input_files = 0 then
409409
fatal_error no_loc "no input file";
410410
let linker_args = time "Total compilation time" perform_actions () in

driver/Driveraux.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let command stdout args =
4747
match status with
4848
| Unix.WEXITED rc -> rc
4949
| Unix.WSIGNALED n | Unix.WSTOPPED n ->
50-
error no_loc "Command '%s' killed on a signal." argv.(0); -1
50+
error no_loc "command '%s' killed on a signal." argv.(0); -1
5151
with Unix.Unix_error(err, fn, param) ->
5252
error no_loc "executing '%s': %s: %s %s"
5353
argv.(0) fn (Unix.error_message err) param;

driver/Frontend.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ val parse_c_file: string -> string -> Csyntax.coq_function Ctypes.program
1818
(** From preprocessed C to Csyntax *)
1919

2020
val prepro_actions: (Commandline.pattern * Commandline.action) list
21-
(** Commandline optins affecting the frontend *)
21+
(** Commandline options affecting the frontend *)
2222

2323
val prepro_help: string
2424
(** Commandline help description *)

driver/Linker.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
(* *********************************************************************)
1313

1414
val linker: string -> string list -> unit
15-
(** Link files into executbale *)
15+
(** Link files into executable *)
1616

1717
val linker_actions: (Commandline.pattern * Commandline.action) list
18-
(** Commandline optins affecting the assembler *)
18+
(** Commandline options affecting the assembler *)
1919

2020
val linker_help: string
2121
(** Commandline help description *)

lib/Readconfig.mll

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ let error msg lexbuf =
4343
lexbuf.lex_curr_p.pos_lnum,
4444
msg)))
4545

46-
let ill_formed_line lexbuf = error "Ill-formed line" lexbuf
47-
let unterminated_quote lexbuf = error "Unterminated quote" lexbuf
48-
let lone_backslash lexbuf = error "Lone \\ (backslash) at end of file" lexbuf
46+
let ill_formed_line lexbuf = error "ill-formed line" lexbuf
47+
let unterminated_quote lexbuf = error "unterminated quote" lexbuf
48+
let lone_backslash lexbuf = error "lone \\ (backslash) at end of file" lexbuf
4949

5050
}
5151

0 commit comments

Comments
 (0)