From b86555e01392afeef5f4b7cd964980694eb91218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Mon, 12 Dec 2011 11:08:47 +0100 Subject: [PATCH] global env misc --- compiler/global/modules.ml | 4 ++-- compiler/heptagon/analysis/typing.ml | 2 +- compiler/minils/main/mls_compiler.ml | 1 - compiler/obc/java/obc2java.ml | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/global/modules.ml b/compiler/global/modules.ml index 1d2fda8..a133a10 100644 --- a/compiler/global/modules.ml +++ b/compiler/global/modules.ml @@ -174,8 +174,8 @@ let replace_const f v = let find_value x = QualEnv.find x g_env.values let find_type x = QualEnv.find x g_env.types -let find_constrs x = Tid (QualEnv.find x g_env.constrs) -let find_field x = QualEnv.find x g_env.fields (* TODO master : the result should be Tid(...) *) +let find_constrs x = QualEnv.find x g_env.constrs +let find_field x = QualEnv.find x g_env.fields let find_const x = QualEnv.find x g_env.consts (** @return the fields of a record type. *) diff --git a/compiler/heptagon/analysis/typing.ml b/compiler/heptagon/analysis/typing.ml index d4107f1..ebe935f 100644 --- a/compiler/heptagon/analysis/typing.ml +++ b/compiler/heptagon/analysis/typing.ml @@ -220,7 +220,7 @@ let find_with_error find_fun f = with Not_found -> error (Eundefined(fullname f)) let find_value v = find_with_error find_value v -let find_constrs c = find_with_error find_constrs c +let find_constrs c = Tid (find_with_error find_constrs c) let find_field f = find_with_error find_field f diff --git a/compiler/minils/main/mls_compiler.ml b/compiler/minils/main/mls_compiler.ml index 0e8fa70..6e59608 100644 --- a/compiler/minils/main/mls_compiler.ml +++ b/compiler/minils/main/mls_compiler.ml @@ -31,7 +31,6 @@ let compile_program p = let p = pass "Level clock" true Level_clock.program p pp in (* Dataglow minimization *) - let p = let call_tomato = !tomato or (List.length !tomato_nodes > 0) in let p = pass "Extended value inlining" call_tomato Inline_extvalues.program p pp in diff --git a/compiler/obc/java/obc2java.ml b/compiler/obc/java/obc2java.ml index b5627e7..26357f5 100644 --- a/compiler/obc/java/obc2java.ml +++ b/compiler/obc/java/obc2java.ml @@ -102,7 +102,7 @@ let translate_constructor_name_2 q q_ty = { qual = QualModule classe; name = String.uppercase q.name } let translate_constructor_name q = - match Modules.unalias_type (Modules.find_constrs q) with + match Modules.unalias_type (Types.Tid (Modules.find_constrs q)) with | Types.Tid q_ty when q_ty = Initial.pbool -> q |> shortname |> local_qn | Types.Tid q_ty -> translate_constructor_name_2 q q_ty | _ -> assert false