aboutsummaryrefslogtreecommitdiffstats
path: root/caml/Main2.ml
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2006-07-17 15:43:52 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2006-07-17 15:43:52 +0000
commitc79434827bf2bd71f857f4471f7bbf381fddd189 (patch)
tree3df2fcad9be3ed0907280ab2490cad5b07a89435 /caml/Main2.ml
parent28e9b3e7b8237c99f8f395d8edd8cb1dbe8c183c (diff)
downloadcompcert-c79434827bf2bd71f857f4471f7bbf381fddd189.tar.gz
compcert-c79434827bf2bd71f857f4471f7bbf381fddd189.zip
Ajout d'un type-checker (non certifie) pour Cminor
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@51 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'caml/Main2.ml')
-rw-r--r--caml/Main2.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/caml/Main2.ml b/caml/Main2.ml
index b7014193..41815758 100644
--- a/caml/Main2.ml
+++ b/caml/Main2.ml
@@ -6,7 +6,9 @@ let process_cminor_file sourcename =
let ic = open_in sourcename in
let lb = Lexing.from_channel ic in
try
- match Main.transf_cminor_program (CMparser.prog CMlexer.token lb) with
+ match Main.transf_cminor_program
+ (CMtypecheck.type_program
+ (CMparser.prog CMlexer.token lb)) with
| None ->
eprintf "Compiler failure\n";
exit 2
@@ -22,6 +24,10 @@ let process_cminor_file sourcename =
eprintf "File %s, character %d: %s\n"
sourcename (Lexing.lexeme_start lb) msg;
exit 2
+ | CMtypecheck.Error msg ->
+ eprintf "File %s, type-checking error:\n%s"
+ sourcename msg;
+ exit 2
let process_file filename =
if Filename.check_suffix filename ".cm" then