Skip to content

Commit a048d42

Browse files
committed
Ajout du module Formatmsg pour rediriger les messages du systeme vers stdout ou stderr suivant le contexte
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2486 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1 parent bad71c1 commit a048d42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+250
-154
lines changed

.depend

+12-10
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ typing/mtype.cmo: typing/btype.cmi typing/ctype.cmi typing/env.cmi \
141141
typing/mtype.cmx: typing/btype.cmx typing/ctype.cmx typing/env.cmx \
142142
typing/ident.cmx typing/path.cmx typing/types.cmx typing/mtype.cmi
143143
typing/parmatch.cmo: parsing/asttypes.cmi typing/ctype.cmi \
144-
typing/datarepr.cmi typing/env.cmi utils/formatmsg.cmi typing/ident.cmi \
145-
parsing/location.cmi utils/misc.cmi typing/path.cmi typing/typedtree.cmi \
146-
typing/types.cmi utils/warnings.cmi typing/parmatch.cmi
144+
typing/datarepr.cmi typing/env.cmi typing/ident.cmi parsing/location.cmi \
145+
utils/misc.cmi typing/path.cmi typing/typedtree.cmi typing/types.cmi \
146+
utils/warnings.cmi typing/parmatch.cmi
147147
typing/parmatch.cmx: parsing/asttypes.cmi typing/ctype.cmx \
148-
typing/datarepr.cmx typing/env.cmx utils/formatmsg.cmx typing/ident.cmx \
149-
parsing/location.cmx utils/misc.cmx typing/path.cmx typing/typedtree.cmx \
150-
typing/types.cmx utils/warnings.cmx typing/parmatch.cmi
148+
typing/datarepr.cmx typing/env.cmx typing/ident.cmx parsing/location.cmx \
149+
utils/misc.cmx typing/path.cmx typing/typedtree.cmx typing/types.cmx \
150+
utils/warnings.cmx typing/parmatch.cmi
151151
typing/path.cmo: typing/ident.cmi typing/path.cmi
152152
typing/path.cmx: typing/ident.cmx typing/path.cmi
153153
typing/predef.cmo: typing/btype.cmi typing/ident.cmi typing/path.cmi \
@@ -511,10 +511,12 @@ asmcomp/linearize.cmo: asmcomp/cmm.cmi asmcomp/mach.cmi asmcomp/proc.cmi \
511511
asmcomp/reg.cmi asmcomp/linearize.cmi
512512
asmcomp/linearize.cmx: asmcomp/cmm.cmx asmcomp/mach.cmx asmcomp/proc.cmx \
513513
asmcomp/reg.cmx asmcomp/linearize.cmi
514-
asmcomp/liveness.cmo: asmcomp/mach.cmi utils/misc.cmi asmcomp/printmach.cmi \
515-
asmcomp/proc.cmi asmcomp/reg.cmi asmcomp/liveness.cmi
516-
asmcomp/liveness.cmx: asmcomp/mach.cmx utils/misc.cmx asmcomp/printmach.cmx \
517-
asmcomp/proc.cmx asmcomp/reg.cmx asmcomp/liveness.cmi
514+
asmcomp/liveness.cmo: utils/formatmsg.cmi asmcomp/mach.cmi utils/misc.cmi \
515+
asmcomp/printmach.cmi asmcomp/proc.cmi asmcomp/reg.cmi \
516+
asmcomp/liveness.cmi
517+
asmcomp/liveness.cmx: utils/formatmsg.cmx asmcomp/mach.cmx utils/misc.cmx \
518+
asmcomp/printmach.cmx asmcomp/proc.cmx asmcomp/reg.cmx \
519+
asmcomp/liveness.cmi
518520
asmcomp/mach.cmo: asmcomp/arch.cmo asmcomp/cmm.cmi utils/nativeint.cmi \
519521
asmcomp/reg.cmi asmcomp/mach.cmi
520522
asmcomp/mach.cmx: asmcomp/arch.cmx asmcomp/cmm.cmx utils/nativeint.cmx \

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ MKDIR=mkdir -p
1717

1818
INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel
1919

20-
UTILS=utils/misc.cmo utils/tbl.cmo utils/config.cmo \
20+
UTILS=utils/misc.cmo utils/formatmsg.cmo utils/tbl.cmo utils/config.cmo \
2121
utils/clflags.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo
2222

2323
OPTUTILS=$(UTILS) utils/nativeint.cmo
@@ -83,7 +83,7 @@ TOPOBJS=$(TOPLIB) $(TOPLEVELMAIN)
8383

8484
OPTOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) $(OPTDRIVER)
8585

86-
EXPUNGEOBJS=utils/misc.cmo utils/tbl.cmo \
86+
EXPUNGEOBJS=utils/misc.cmo utils/formatmsg.cmo utils/tbl.cmo \
8787
utils/config.cmo utils/clflags.cmo \
8888
typing/ident.cmo typing/path.cmo typing/types.cmo typing/btype.cmo \
8989
typing/predef.cmo bytecomp/runtimedef.cmo bytecomp/symtable.cmo \

Makefile.Mac

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CAMLRUN = :byterun:ocamlrun
1515
INCLUDES = -I :utils: -I :parsing: -I :typing: -I :bytecomp: �
1616
-I :driver: -I :toplevel:
1717

18-
UTILS = :utils:misc.cmo :utils:tbl.cmo :utils:config.cmo �
18+
UTILS = :utils:misc.cmo :utils:formatmsg.cmo :utils:tbl.cmo :utils:config.cmo �
1919
:utils:clflags.cmo :utils:terminfo.cmo :utils:ccomp.cmo �
2020
:utils:warnings.cmo
2121

@@ -61,7 +61,7 @@ COMPOBJS = {UTILS} {PARSING} {TYPING} {COMP} {BYTECOMP} {DRIVER}
6161

6262
TOPLIB = {UTILS} {PARSING} {TYPING} {COMP} {BYTECOMP} {TOPLEVEL}
6363

64-
EXPUNGEOBJS = :utils:misc.cmo :utils:tbl.cmo �
64+
EXPUNGEOBJS = :utils:misc.cmo :utils:formatmsg.cmo :utils:tbl.cmo �
6565
:utils:config.cmo :utils:clflags.cmo �
6666
:typing:ident.cmo :typing:path.cmo �
6767
:typing:types.cmo :typing:btype.cmo :typing:predef.cmo �

Makefile.nt

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CAMLRUN=byterun\ocamlrun
1515

1616
INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel
1717

18-
UTILS=utils\misc.cmo utils\tbl.cmo utils\config.cmo \
18+
UTILS=utils\misc.cmo utils\formatmsg.cmo utils\tbl.cmo utils\config.cmo \
1919
utils\clflags.cmo utils\terminfo.cmo utils\ccomp.cmo utils\warnings.cmo
2020

2121
OPTUTILS=$(UTILS) utils\nativeint.cmo
@@ -80,7 +80,7 @@ TOPOBJS=$(TOPLIB) $(TOPLEVELMAIN)
8080

8181
OPTOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) $(OPTDRIVER)
8282

83-
EXPUNGEOBJS=utils\misc.cmo utils\tbl.cmo \
83+
EXPUNGEOBJS=utils\misc.cmo utils\formatmsg.cmo utils\tbl.cmo \
8484
utils\config.cmo utils\clflags.cmo \
8585
typing\ident.cmo typing\path.cmo typing\types.cmo typing\btype.cmo \
8686
typing\predef.cmo bytecomp\runtimedef.cmo bytecomp\symtable.cmo \

asmcomp/alpha/arch.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* Specific operations for the Alpha processor *)
1515

16-
open Format
16+
open Formatmsg
1717

1818
(* Addressing modes *)
1919

asmcomp/arm/arch.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
(* Specific operations for the ARM processor *)
1515

1616
open Misc
17-
open Format
17+
open Formatmsg
1818

1919
(* Addressing modes *)
2020

asmcomp/asmgen.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* From lambda to assembly code *)
1515

16-
open Format
16+
open Formatmsg
1717
open Config
1818
open Clflags
1919
open Misc

asmcomp/asmlibrarian.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ let create_archive file_list lib_name =
5555
remove_file archive_name;
5656
raise x
5757

58-
open Format
58+
open Formatmsg
5959

6060
let report_error = function
6161
File_not_found name ->

asmcomp/asmlink.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ let link objfiles =
273273

274274
(* Error report *)
275275

276-
open Format
276+
open Formatmsg
277277

278278
let report_error = function
279279
File_not_found name ->

asmcomp/codegen.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* From C-- to assembly code *)
1515

16-
open Format
16+
open Formatmsg
1717
open Cmm
1818

1919
let dump_cmm = ref false

asmcomp/compilenv.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ let save_unit_info filename =
142142

143143
(* Error report *)
144144

145-
open Format
145+
open Formatmsg
146146

147147
let report_error = function
148148
Not_a_unit_info filename ->

asmcomp/hppa/arch.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* Specific operations for the HP PA-RISC processor *)
1515

16-
open Format
16+
open Formatmsg
1717

1818
type specific_operation =
1919
Ishift1add

asmcomp/i386/arch.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ let num_args_addressing = function
6565

6666
(* Printing operations and addressing modes *)
6767

68-
open Format
68+
open Formatmsg
6969

7070
let print_addressing printreg addr arg =
7171
match addr with

asmcomp/i386/proc.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
open Misc
1717
open Arch
18-
open Format
18+
open Formatmsg
1919
open Cmm
2020
open Reg
2121
open Mach

asmcomp/i386/proc_nt.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
open Misc
1717
open Arch
18-
open Format
18+
open Formatmsg
1919
open Cmm
2020
open Reg
2121
open Mach

asmcomp/liveness.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ let fundecl f =
106106
(* Sanity check: only function parameters can be live at entrypoint *)
107107
let wrong_live = Reg.Set.diff initially_live (Reg.set_of_array f.fun_args) in
108108
if not (Reg.Set.is_empty wrong_live) then begin
109-
Printmach.regset wrong_live; Format.print_newline();
109+
Printmach.regset wrong_live; Formatmsg.print_newline();
110110
Misc.fatal_error "Liveness.fundecl"
111111
end

asmcomp/m68k/arch.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ let num_args_addressing = function
5959

6060
(* Printing operations and addressing modes *)
6161

62-
open Format
62+
open Formatmsg
6363

6464
let print_addressing printreg addr arg =
6565
match addr with

asmcomp/m68k/proc.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
open Misc
1717
open Arch
18-
open Format
18+
open Formatmsg
1919
open Cmm
2020
open Reg
2121
open Mach

asmcomp/mips/arch.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
(* Specific operations for the Mips processor *)
1515

1616
open Misc
17-
open Format
17+
open Formatmsg
1818

1919
(* Addressing modes *)
2020

asmcomp/power/arch.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* Specific operations for the PowerPC processor *)
1515

16-
open Format
16+
open Formatmsg
1717

1818
type specific_operation =
1919
Imultaddf (* multiply and add *)

asmcomp/printcmm.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* Pretty-printing of C-- code *)
1515

16-
open Format
16+
open Formatmsg
1717
open Cmm
1818

1919
let machtype_component = function

asmcomp/printlinear.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* Pretty-printing of linearized machine code *)
1515

16-
open Format
16+
open Formatmsg
1717
open Mach
1818
open Printmach
1919
open Linearize

asmcomp/printmach.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* Pretty-printing of pseudo machine code *)
1515

16-
open Format
16+
open Formatmsg
1717
open Cmm
1818
open Reg
1919
open Mach

asmcomp/sparc/arch.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* Specific operations for the Sparc processor *)
1515

16-
open Format
16+
open Formatmsg
1717

1818
type specific_operation = unit (* None worth mentioning *)
1919

boot/ocamlc

18.3 KB
Binary file not shown.

boot/ocamllex

2.77 KB
Binary file not shown.

bytecomp/bytelibrarian.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ let create_archive file_list lib_name =
8282
remove_file lib_name;
8383
raise x
8484

85-
open Format
85+
open Formatmsg
8686

8787
let report_error = function
8888
File_not_found name ->

bytecomp/bytelink.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ let link objfiles =
517517

518518
(* Error report *)
519519

520-
open Format
520+
open Formatmsg
521521

522522
let report_error = function
523523
File_not_found name ->

bytecomp/printinstr.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
(* Pretty-print lists of instructions *)
1515

16-
open Format
16+
open Formatmsg
1717
open Lambda
1818
open Instruct
1919

bytecomp/printlambda.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
(* $Id$ *)
1313

14-
open Format
14+
open Formatmsg
1515
open Asttypes
1616
open Primitive
1717
open Types

bytecomp/simplif.ml

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ let rec eliminate_ref id = function
8282

8383
(* Simplification of lets *)
8484

85-
open Format
8685
let simplify_lambda lam =
8786
(* First pass: count the occurrences of all identifiers *)
8887
let occ = Hashtbl.create 83 in

bytecomp/symtable.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ let filter_global_map p gmap =
292292

293293
(* Error report *)
294294

295-
open Format
295+
open Formatmsg
296296

297297
let report_error = function
298298
Undefined_global s ->

bytecomp/translclass.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ let class_stub =
314314

315315
(* Error report *)
316316

317-
open Format
317+
open Formatmsg
318318

319319
let report_error = function
320320
Illegal_class_expr ->

bytecomp/translcore.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ let transl_exception id path decl =
602602

603603
(* Error report *)
604604

605-
open Format
605+
open Formatmsg
606606

607607
let report_error = function
608608
Illegal_letrec_pat ->

0 commit comments

Comments
 (0)