package mopsa
Install
Dune Dependency
Authors
Maintainers
Sources
md5=fdee20e988343751de440b4f6b67c0f4
sha512=f5cbf1328785d3f5ce40155dada2d95e5de5cce4f084ea30cfb04d1ab10cc9403a26cfb3fa55d0f9da72244482130fdb89c286a9aed0d640bba46b7c00e09500
doc/mopsa.mopsa_c_parser/Mopsa_c_parser/C_utils/index.html
Module Mopsa_c_parser.C_utils
Source
C_utils - Utilities to access the simple C AST
Debug
verbose logging during type comparison, for debugging
Location utilities
From the begining of the first block statement to the end of the last block statement. Raises Invalid_argument for empty blocks.
Size and alignment
Size (in bytes) of an integer type.
Alignment (in bytes) of an integer type.
Signedness of an integer type.
Size (in bytes) of a float type.
Alignment (in bytes) of a float type.
Size (in bytes) of a type. Raises an Invalid_argument if the size is not a constant.
Size (in bytes) of a type, as an expression. Handles variable-length ararys.
Alignment (in bytes) of a type.
Whether we can declare a variable of this type (sizeof defined).
Useful target-specific types
Converts target int to SAST int types.
Base integer type of a derived integer type.
Comments
Ensure that comments are not duplicated.
val comment_macro_unify :
(C_AST.comment * C_AST.macro C_AST.StringMap.t) list ->
(C_AST.comment * C_AST.macro C_AST.StringMap.t) list ->
(C_AST.comment * C_AST.macro C_AST.StringMap.t) list
Type compatibility
type type_cmp = {
cmp_ignore_qual : bool;
(*if true, type_compatible does not take qualifiers into account in comparison
*)cmp_int_size : bool;
(*if true, type_compatible use integer size and signess instead of name
*)cmp_enum_as_int : bool;
(*if true, type_compatible handles an enum as an its integer type
*)cmp_ignore_name : bool;
(*if true, type_compatible disregards type names in comparison
*)cmp_ignore_undefined : bool;
(*if true, an undefined enum, struct or union compares equal to a defined one
*)cmp_ignore_typedef : bool;
(*if true, a typedef is replaced with its defining type during comparison
*)cmp_ignore_array_size : bool;
(*if true, arrays with undefined size compare equal to that of defined size
*)cmp_ignore_vector_size : bool;
(*if true, the size of vector types is ignored in comparison
*)cmp_ignore_vector_kind : bool;
(*if true, the kind of vector types is ignored in comparison
*)
}
Comfigures the test equality functions, to allow various relaxation.
val type_qual_compare :
type_cmp ->
(C_AST.uid * C_AST.uid, unit) Hashtbl.t ->
C.target_info ->
C_AST.type_qual ->
C_AST.type_qual ->
bool
Type compatibility. Two declarations for the same object must have compatible types.
Strict type equality, to allow type merging.
Arguments are eligible to call type_unify.
val type_qual_unify :
(C_AST.uid * C_AST.uid, unit) Hashtbl.t ->
C.target_info ->
C_AST.type_qual ->
C_AST.type_qual ->
C_AST.type_qual
val record_unify :
C.target_info ->
C_AST.record_type ->
C_AST.record_type ->
C_AST.record_type
Type unification.
Expressions utilities
Type of an expression.
(void* )0
(void)0
Statement utilities
Creates a block from a list of statements. Computes the list of local variables declared in the block and not in sub-blocks.
module VarSet : sig ... end
Fill-in scope_update information in the AST. The block is modified in-place, and returned. Call after AST transformations that may change variable scopes.