Module IR.Typ
module IntegerWidths : sig ... end
type ikind
=
Kinds of integers
val equal_ikind : ikind -> ikind -> bool
val width_of_ikind : IntegerWidths.t -> ikind -> int
val range_of_ikind : IntegerWidths.t -> ikind -> Z.t * Z.t
val ikind_is_char : ikind -> bool
Check whether the integer kind is a char
val ikind_is_unsigned : ikind -> bool
Check whether the integer kind is unsigned
type ptr_kind
=
kind of pointer
val compare_type_quals : type_quals -> type_quals -> int
val mk_type_quals : ?default:type_quals -> ?is_const:bool -> ?is_restrict:bool -> ?is_volatile:bool -> unit -> type_quals
val is_const : type_quals -> bool
val is_restrict : type_quals -> bool
val is_volatile : type_quals -> bool
type t
=
{
desc : desc;
quals : type_quals;
}
types for sil (structured) expressions
and desc
=
|
Tint of ikind
integer type
|
Tfloat of fkind
float type
|
Tvoid
void type
|
Tfun
function type
|
Tptr of t * ptr_kind
pointer type
|
Tstruct of name
structured value type name
|
TVar of string
type variable (ie. C++ template variables)
|
Tarray of
{
elt : t;
length : IntLit.t option;
stride : IntLit.t option;
}
array type with statically fixed length and stride
and name
=
|
CStruct of QualifiedCppName.t
|
CUnion of QualifiedCppName.t
qualified name does NOT contain template arguments of the class. It will contain template args of its parent classes, for example: MyClass<int>::InnerClass<int> will store "MyClass<int>", "InnerClass"
|
CppClass of
{
name : QualifiedCppName.t;
template_spec_info : template_spec_info;
is_union : bool;
}
|
CSharpClass of CSharpClassName.t
|
JavaClass of JavaClassName.t
|
ObjcClass of QualifiedCppName.t * name list
ObjC class that conforms to a list of protocols, e.g. id<NSFastEnumeration, NSCopying>
|
ObjcProtocol of QualifiedCppName.t
and template_arg
=
|
TType of t
|
TInt of IStdlib.IStd.Int64.t
|
TNull
|
TNullPtr
|
TOpaque
and template_spec_info
=
|
NoTemplate
|
Template of
{
mangled : string option;
WARNING: because of type substitutions performed by
sub_type
andsub_tname
, mangling is not guaranteed to be unique to a single type. All the information in the template arguments is also needed for uniqueness.args : template_arg list;
}
val compare : t -> t -> int
val compare_desc : desc -> desc -> int
val compare_name : name -> name -> int
val compare_template_arg : template_arg -> template_arg -> int
val compare_template_spec_info : template_spec_info -> template_spec_info -> int
val yojson_of_t : t -> Ppx_yojson_conv_lib.Yojson.Safe.t
val yojson_of_desc : desc -> Ppx_yojson_conv_lib.Yojson.Safe.t
val yojson_of_name : name -> Ppx_yojson_conv_lib.Yojson.Safe.t
val yojson_of_template_arg : template_arg -> Ppx_yojson_conv_lib.Yojson.Safe.t
val yojson_of_template_spec_info : template_spec_info -> Ppx_yojson_conv_lib.Yojson.Safe.t
val pp_template_spec_info : IStdlib.Pp.env -> F.formatter -> template_spec_info -> unit
val mk : ?default:t -> ?quals:type_quals -> desc -> t
Create Typ.t from given desc. if
default
is passed then use its value to set other fields such as quals
val mk_array : ?default:t -> ?quals:type_quals -> ?length:IntLit.t -> ?stride:IntLit.t -> t -> t
Create an array type from a given element type. If
length
orstride
value is given, use them as static length and size.
val mk_struct : name -> t
val mk_ptr : ?ptr_kind:ptr_kind -> t -> t
make a pointer to
t
, default kind isPk_pointer
val size_t : ikind
ikind of size_t
module Name : sig ... end
val equal_desc : desc -> desc -> bool
val equal_name : name -> name -> bool
val equal_quals : type_quals -> type_quals -> bool
val equal_ignore_quals : t -> t -> bool
Equality for types, but ignoring quals in it.
val pp_full : IStdlib.Pp.env -> F.formatter -> t -> unit
Pretty print a type with all the details.
val pp : IStdlib.Pp.env -> F.formatter -> t -> unit
Pretty print a type.
val pp_desc : IStdlib.Pp.env -> F.formatter -> desc -> unit
Pretty print a type desc.
val pp_java : verbose:bool -> F.formatter -> t -> unit
Pretty print a Java type. Raises if type isn't produced by the Java frontend
val pp_cs : verbose:bool -> F.formatter -> t -> unit
Pretty print a Java type. Raises if type isn't produced by the CSharp frontend
val pp_protocols : IStdlib.Pp.env -> F.formatter -> name list -> unit
val to_string : t -> string
val desc_to_string : desc -> string
val d_full : t -> unit
Dump a type with all the details.
val d_list : t list -> unit
Dump a list of types.
val array_elem : t option -> t -> t
If an array type, return the type of the element. If not, return the default type if given, otherwise raise an exception
val is_objc_class : t -> bool
val is_cpp_class : t -> bool
val is_pointer_to_cpp_class : t -> bool
val is_pointer_to_objc_non_tagged_class : t -> bool
val is_pointer_to_void : t -> bool
val is_void : t -> bool
val is_pointer_to_int : t -> bool
val is_pointer_to_function : t -> bool
val is_pointer : t -> bool
val is_reference : t -> bool
val is_struct : t -> bool
val is_int : t -> bool
val is_unsigned_int : t -> bool
val is_char : t -> bool
val is_csharp_type : t -> bool
is
t
a type produced by the Java frontend?
val is_java_primitive_type : t -> bool
is
t
a primitive type produced by the Java frontend?
val is_java_type : t -> bool
is
t
a type produced by the Java frontend?
module Normalizer : IStdlib.HashNormalizer.S with type t = t