aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cutil.mli
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-01-22 19:26:05 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2015-01-22 19:26:05 +0100
commit1e97bb4f6297b6fa7949684e522a592aab754d99 (patch)
tree1273d3699c14c586b36173ff86bf04f516aae940 /cparser/Cutil.mli
parentfe7da33a1992c3023a2e7e3f36c532ad10e3f236 (diff)
downloadcompcert-kvx-1e97bb4f6297b6fa7949684e522a592aab754d99.tar.gz
compcert-kvx-1e97bb4f6297b6fa7949684e522a592aab754d99.zip
Delay reads from !Machine.config before it is properly initialized.
Several definitions in Cutil and elsewhere were accessing the default value of !Machine.config, before it is properly initialized in Driver. Delay evaluation of these definitions, and initialize Machine.config to nonsensical values so that lack of initialization is caught early (e.g. in Cutil.find_matching_*_kind). Also, following up on commit [3b8a094], don't use "wchar_t" typedef to type wide string literals, even if this typedef is in scope. The risk here is to hide an inconsistency between "wchar_t"'s definition in standard headers and CompCert's built-in definition.
Diffstat (limited to 'cparser/Cutil.mli')
-rw-r--r--cparser/Cutil.mli12
1 files changed, 6 insertions, 6 deletions
diff --git a/cparser/Cutil.mli b/cparser/Cutil.mli
index 53bcfcea..bd52badf 100644
--- a/cparser/Cutil.mli
+++ b/cparser/Cutil.mli
@@ -156,20 +156,20 @@ val default_argument_conversion : Env.t -> typ -> typ
(* Special types *)
val enum_ikind : ikind
(* Integer kind for enum values. Always [IInt]. *)
-val wchar_ikind : ikind
- (* Integer kind for wchar_t type. Unsigned. *)
-val size_t_ikind : ikind
+val wchar_ikind : unit -> ikind
+ (* Integer kind for wchar_t type. *)
+val size_t_ikind : unit -> ikind
(* Integer kind for size_t type. Unsigned. *)
-val ptr_t_ikind : ikind
+val ptr_t_ikind : unit -> ikind
(* Integer kind for ptr_t type. Smallest unsigned kind large enough
to contain a pointer without information loss. *)
-val ptrdiff_t_ikind : ikind
+val ptrdiff_t_ikind : unit -> ikind
(* Integer kind for ptrdiff_t type. Smallest signed kind large enough
to contain the difference between two pointers. *)
(* Helpers for type-checking *)
-val type_of_constant : Env.t -> constant -> typ
+val type_of_constant : constant -> typ
(* Return the type of the given constant. *)
val type_of_member : Env.t -> field -> typ
(* Return the type of accessing the given field [fld].