diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-01-12 14:20:31 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-01-12 14:20:31 +0100 |
commit | 81e91f965e7b1afbea8d1630015e75f11f0a3afd (patch) | |
tree | 270a85299f33d783e33745c917796f080f7300e1 /cparser/Cutil.mli | |
parent | 3304820b870e4524c7d1f14fcd62506634f7922b (diff) | |
parent | 06841a5bb7ca27bc436e87e7991d0d05dbf5267c (diff) | |
download | compcert-kvx-81e91f965e7b1afbea8d1630015e75f11f0a3afd.tar.gz compcert-kvx-81e91f965e7b1afbea8d1630015e75f11f0a3afd.zip |
Merge branch 'master' into dwarf
Conflicts:
powerpc/PrintAsm.ml
Diffstat (limited to 'cparser/Cutil.mli')
-rw-r--r-- | cparser/Cutil.mli | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/cparser/Cutil.mli b/cparser/Cutil.mli index 0de0c827..53bcfcea 100644 --- a/cparser/Cutil.mli +++ b/cparser/Cutil.mli @@ -58,12 +58,28 @@ val attr_inherited_by_members: attribute -> bool (* Is an attribute of a composite inherited by members of the composite? *) (* Type compatibility *) -val compatible_types : ?noattrs: bool -> Env.t -> typ -> typ -> bool + +type attr_handling = + | AttrCompat + | AttrIgnoreTop + | AttrIgnoreAll + +val compatible_types : attr_handling -> Env.t -> typ -> typ -> bool (* Check that the two given types are compatible. - If [noattrs], ignore attributes (recursively). *) -val combine_types : ?noattrs: bool -> Env.t -> typ -> typ -> typ option + The attributes in the types are compared according to the first argument: +- [AttrCompat]: the types must have the same standard attributes + ([const], [volatile], [restrict]) but may differ on custom attributes. +- [AttrIgnoreTop]: the top-level attributes of the two types are ignored, + but attributes of e.g. types of pointed objects (for pointer types) + are compared as per [AttrCompat]. +- [AttrIgnoreAll]: recursively ignore the attributes in the two types. *) +val combine_types : attr_handling -> Env.t -> typ -> typ -> typ option (* Like [compatible_types], but if the two types are compatible, - return the most precise type compatible with both. *) + return the most precise type compatible with both. + The attributes are compared according to the first argument, + with the same meaning as for [compatible_types]. + When two sets of attributes are compatible, the result of + [combine_types] carries the union of these two sets of attributes. *) (* Size and alignment *) @@ -153,7 +169,7 @@ val ptrdiff_t_ikind : ikind (* Helpers for type-checking *) -val type_of_constant : constant -> typ +val type_of_constant : Env.t -> 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]. |