Skip to content

Commit

Permalink
More warnings when compiling the compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
alainfrisch committed Mar 15, 2016
1 parent f4a29c6 commit 502e4f9
Show file tree
Hide file tree
Showing 125 changed files with 1,084 additions and 1,125 deletions.
2 changes: 1 addition & 1 deletion Makefile.shared
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include stdlib/StdlibModules

CAMLC=$(CAMLRUN) boot/ocamlc -g -nostdlib -I boot -use-prims byterun/primitives
CAMLOPT=$(CAMLRUN) ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink
COMPFLAGS=-strict-sequence -principal -w +33..39+48+50 -warn-error A \
COMPFLAGS=-strict-sequence -principal -absname -w +a-4-9-41-42-44-45-48 -warn-error A \
-bin-annot -safe-string -strict-formats $(INCLUDES)
LINKFLAGS=

Expand Down
4 changes: 2 additions & 2 deletions asmcomp/CSEgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ let remove_load_numbering n =

let kill_addr_regs n =
{ n with num_reg =
Reg.Map.filter (fun r n -> r.Reg.typ <> Cmm.Addr) n.num_reg }
Reg.Map.filter (fun r _n -> r.Reg.typ <> Cmm.Addr) n.num_reg }

(* Prepend a set of moves before [i] to assign [srcs] to [dsts]. *)

Expand All @@ -207,7 +207,7 @@ let insert_move srcs dsts i =
match Array.length srcs with
| 0 -> i
| 1 -> instr_cons (Iop Imove) srcs dsts i
| l -> (* Parallel move: first copy srcs into tmps one by one,
| _ -> (* Parallel move: first copy srcs into tmps one by one,
then copy tmps into dsts one by one *)
let tmps = Reg.createv_like srcs in
let i1 = array_fold2 insert_single_move i tmps dsts in
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/amd64/CSE.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open Arch
open Mach
open CSEgen

class cse = object (self)
class cse = object

inherit cse_generic as super

Expand Down
10 changes: 5 additions & 5 deletions asmcomp/amd64/arch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ let offset_addressing addr delta =
| Iindexed2scaled(scale, n) -> Iindexed2scaled(scale, n + delta)

let num_args_addressing = function
Ibased(s, n) -> 0
| Iindexed n -> 1
| Iindexed2 n -> 2
| Iscaled(scale, n) -> 1
| Iindexed2scaled(scale, n) -> 2
Ibased _ -> 0
| Iindexed _ -> 1
| Iindexed2 _ -> 2
| Iscaled _ -> 1
| Iindexed2scaled _ -> 2

(* Printing operations and addressing modes *)

Expand Down
18 changes: 5 additions & 13 deletions asmcomp/amd64/proc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ let win64 =
| "win64" | "mingw64" | "cygwin" -> true
| _ -> false

(* Which asm conventions to use *)

let masm =
match Config.ccomp_type with
| "msvc" -> true
| _ -> false

(* Registers available for register allocation *)

(* Register map:
Expand Down Expand Up @@ -138,7 +131,6 @@ let phys_reg n =
if n < 100 then hard_int_reg.(n) else hard_float_reg.(n - 100)

let rax = phys_reg 0
let rcx = phys_reg 5
let rdx = phys_reg 4
let rbp = phys_reg 12
let rxmm15 = phys_reg 115
Expand Down Expand Up @@ -181,14 +173,14 @@ let calling_conventions first_int last_int first_float last_float make_stack

let incoming ofs = Incoming ofs
let outgoing ofs = Outgoing ofs
let not_supported ofs = fatal_error "Proc.loc_results: cannot call"
let not_supported _ofs = fatal_error "Proc.loc_results: cannot call"

let loc_arguments arg =
calling_conventions 0 9 100 109 outgoing arg
let loc_parameters arg =
let (loc, ofs) = calling_conventions 0 9 100 109 incoming arg in loc
let (loc, _ofs) = calling_conventions 0 9 100 109 incoming arg in loc
let loc_results res =
let (loc, ofs) = calling_conventions 0 0 100 100 not_supported res in loc
let (loc, _ofs) = calling_conventions 0 0 100 100 not_supported res in loc

(* C calling conventions under Unix:
first integer args in rdi, rsi, rdx, rcx, r8, r9
Expand All @@ -204,7 +196,7 @@ let loc_results res =
Return value in rax or xmm0. *)

let loc_external_results res =
let (loc, ofs) = calling_conventions 0 0 100 100 not_supported res in loc
let (loc, _ofs) = calling_conventions 0 0 100 100 not_supported res in loc

let unix_loc_external_arguments arg =
calling_conventions 2 7 100 107 outgoing arg
Expand Down Expand Up @@ -253,7 +245,7 @@ let loc_exn_bucket = rax

(* Volatile registers: none *)

let regs_are_volatile rs = false
let regs_are_volatile _rs = false

(* Registers destroyed by operations *)

Expand Down
2 changes: 1 addition & 1 deletion asmcomp/amd64/reload.ml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ method! reload_operation op arg res =

method! reload_test tst arg =
match tst with
Iinttest cmp ->
Iinttest _ ->
(* One of the two arguments can reside on stack *)
if stackp arg.(0) && stackp arg.(1)
then [| self#makereg arg.(0); arg.(1) |]
Expand Down
4 changes: 2 additions & 2 deletions asmcomp/amd64/selection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ method! is_simple_expr e =
| _ ->
super#is_simple_expr e

method select_addressing chunk exp =
method select_addressing _chunk exp =
let (a, d) = select_addr exp in
(* PR#4625: displacement must be a signed 32-bit immediate *)
if d < -0x8000_0000 || d > 0x7FFF_FFFF
Expand Down Expand Up @@ -175,7 +175,7 @@ method! select_operation op args =
(* Recognize the LEA instruction *)
Caddi | Caddv | Cadda | Csubi ->
begin match self#select_addressing Word_int (Cop(op, args)) with
(Iindexed d, _) -> super#select_operation op args
(Iindexed _, _)
| (Iindexed2 0, _) -> super#select_operation op args
| (addr, arg) -> (Ispecific(Ilea addr), [arg])
end
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/arm/CSE.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open Arch
open Mach
open CSEgen

class cse = object (self)
class cse = object

inherit cse_generic as super

Expand Down
2 changes: 1 addition & 1 deletion asmcomp/arm/arch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ let identity_addressing = Iindexed 0

let offset_addressing (Iindexed n) delta = Iindexed(n + delta)

let num_args_addressing (Iindexed n) = 1
let num_args_addressing (Iindexed _) = 1

(* Printing operations and addressing modes *)

Expand Down
4 changes: 2 additions & 2 deletions asmcomp/arm/proc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ let calling_conventions first_int last_int first_float last_float make_stack

let incoming ofs = Incoming ofs
let outgoing ofs = Outgoing ofs
let not_supported ofs = fatal_error "Proc.loc_results: cannot call"
let not_supported _ofs = fatal_error "Proc.loc_results: cannot call"

(* OCaml calling convention:
first integer args in r0...r7
Expand Down Expand Up @@ -224,7 +224,7 @@ let loc_exn_bucket = phys_reg 0

(* Volatile registers: none *)

let regs_are_volatile rs = false
let regs_are_volatile _rs = false

(* Registers destroyed by operations *)

Expand Down
2 changes: 1 addition & 1 deletion asmcomp/arm/scheduling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open Mach

(* Instruction scheduling for the ARM *)

class scheduler = object(self)
class scheduler = object

inherit Schedgen.scheduler_generic as super

Expand Down
1 change: 0 additions & 1 deletion asmcomp/arm/selection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ exception Use_default
let r1 = phys_reg 1
let r6 = phys_reg 6
let r7 = phys_reg 7
let r12 = phys_reg 8

let pseudoregs_for_operation op arg res =
match op with
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/arm64/CSE.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open Arch
open Mach
open CSEgen

class cse = object (self)
class cse = object

inherit cse_generic as super

Expand Down
6 changes: 2 additions & 4 deletions asmcomp/arm64/arch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
(* *)
(**************************************************************************)

let command_line_options = []

(* Specific operations for the ARM processor, 64-bit mode *)

open Format
Expand Down Expand Up @@ -81,8 +79,8 @@ let offset_addressing addr delta =
| Ibased(s, n) -> Ibased(s, n + delta)

let num_args_addressing = function
| Iindexed n -> 1
| Ibased(s, n) -> 0
| Iindexed _ -> 1
| Ibased _ -> 0

(* Printing operations and addressing modes *)

Expand Down
9 changes: 4 additions & 5 deletions asmcomp/arm64/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ let reg_trap_ptr = phys_reg 23
let reg_alloc_ptr = phys_reg 24
let reg_alloc_limit = phys_reg 25
let reg_tmp1 = phys_reg 26
let reg_tmp2 = phys_reg 27
let reg_x15 = phys_reg 15

(* Output a label *)
Expand Down Expand Up @@ -362,7 +361,7 @@ let num_call_gc_and_check_bound_points instr =
in
loop instr (0, 0)

let max_out_of_line_code_offset instr ~num_call_gc ~num_check_bound =
let max_out_of_line_code_offset ~num_call_gc ~num_check_bound =
if num_call_gc < 1 && num_check_bound < 1 then 0
else begin
let size_of_call_gc = 2 in
Expand Down Expand Up @@ -606,7 +605,7 @@ let emit_instr i =
let dst = i.res.(0) in
let base =
match addr with
| Iindexed ofs -> i.arg.(0)
| Iindexed _ -> i.arg.(0)
| Ibased(s, ofs) ->
` adrp {emit_reg reg_tmp1}, {emit_symbol_offset s ofs}\n`;
reg_tmp1 in
Expand All @@ -633,7 +632,7 @@ let emit_instr i =
let src = i.arg.(0) in
let base =
match addr with
| Iindexed ofs -> i.arg.(1)
| Iindexed _ -> i.arg.(1)
| Ibased(s, ofs) ->
` adrp {emit_reg reg_tmp1}, {emit_symbol_offset s ofs}\n`;
reg_tmp1 in
Expand Down Expand Up @@ -905,7 +904,7 @@ let fundecl fundecl =
num_call_gc_and_check_bound_points fundecl.fun_body
in
let max_out_of_line_code_offset =
max_out_of_line_code_offset fundecl.fun_body ~num_call_gc
max_out_of_line_code_offset ~num_call_gc
~num_check_bound
in
BR.relax fundecl.fun_body ~max_out_of_line_code_offset;
Expand Down
4 changes: 2 additions & 2 deletions asmcomp/arm64/proc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ let calling_conventions

let incoming ofs = Incoming ofs
let outgoing ofs = Outgoing ofs
let not_supported ofs = fatal_error "Proc.loc_results: cannot call"
let not_supported _ofs = fatal_error "Proc.loc_results: cannot call"

(* OCaml calling convention:
first integer args in r0...r15
Expand Down Expand Up @@ -171,7 +171,7 @@ let loc_exn_bucket = phys_reg 0

(* Volatile registers: none *)

let regs_are_volatile rs = false
let regs_are_volatile _rs = false

(* Registers destroyed by operations *)

Expand Down
4 changes: 0 additions & 4 deletions asmcomp/arm64/selection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ let rec run_automata nbits state input =
let is_logical_immediate n =
n <> 0 && n <> -1 && run_automata 64 0 n

let is_intconst = function
Cconst_int _ -> true
| _ -> false

let inline_ops =
[ "sqrt"; "caml_bswap16_direct"; "caml_int32_direct_bswap";
"caml_int64_direct_bswap"; "caml_nativeint_direct_bswap" ]
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/asmlink.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ let is_required name =
try ignore (Hashtbl.find missing_globals name); true
with Not_found -> false

let add_required by (name, crc) =
let add_required by (name, _crc) =
try
let rq = Hashtbl.find missing_globals name in
rq := by :: !rq
Expand Down
7 changes: 2 additions & 5 deletions asmcomp/asmpackager.ml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ let make_package_object ppf members targetobj targetname coercion
let source_provenance = Timings.Pack targetname in
let prefixname = chop_extension_if_any objtemp in
if Config.flambda then begin
let size, lam =
Translmod.transl_package_flambda
components module_ident coercion
in
let size, lam = Translmod.transl_package_flambda components coercion in
let flam =
Middle_end.middle_end ppf
~source_provenance
Expand Down Expand Up @@ -150,7 +147,7 @@ let build_package_cmx members cmxfile =
let unit_names =
List.map (fun m -> m.pm_name) members in
let filter lst =
List.filter (fun (name, crc) -> not (List.mem name unit_names)) lst in
List.filter (fun (name, _crc) -> not (List.mem name unit_names)) lst in
let union lst =
List.fold_left
(List.fold_left
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/clambda.ml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ let rec compare_float_lists l1 l2 =

let compare_constants c1 c2 =
match c1, c2 with
| Uconst_ref(lbl1, c1), Uconst_ref(lbl2, c2) -> String.compare lbl1 lbl2
| Uconst_ref(lbl1, _c1), Uconst_ref(lbl2, _c2) -> String.compare lbl1 lbl2
(* Same labels -> same constants.
Different labels -> different constants, even if the contents
match, because of string constants that must not be
Expand Down
Loading

0 comments on commit 502e4f9

Please sign in to comment.