IR.Typ
The Smallfoot Intermediate Language: Types
type ikind =
| IChar
char
| ISChar
signed char
| IUChar
unsigned char
| IBool
bool
| IInt
int
| IUInt
unsigned int
| IShort
short
| IUShort
unsigned short
| ILong
long
| IULong
unsigned long
| ILongLong
long long
(or _int64
on Microsoft Visual C)
| IULongLong
unsigned long long
(or unsigned _int64
on Microsoft Visual C)
| I128
__int128_t
| IU128
__uint128_t
Kinds of integers
val hash_fold_ikind :
Ppx_hash_lib.Std.Hash.state ->
ikind ->
Ppx_hash_lib.Std.Hash.state
val hash_ikind : ikind -> Ppx_hash_lib.Std.Hash.hash_value
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
Kinds of floating-point numbers
type ptr_kind =
| Pk_pointer
C/C++, Java, Objc standard/__strong pointer
*)| Pk_lvalue_reference
C++ lvalue reference
*)| Pk_rvalue_reference
C++ rvalue reference
*)| Pk_objc_weak
Obj-C __weak pointer
*)| Pk_objc_unsafe_unretained
Obj-C __unsafe_unretained pointer
*)| Pk_objc_autoreleasing
Obj-C __autoreleasing pointer
*)kind of pointer
val compare_type_quals : type_quals -> type_quals -> int
val equal_type_quals : type_quals -> type_quals -> bool
val mk_type_quals :
?default:type_quals ->
?is_const:bool ->
?is_reference: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
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 {
}
array type with statically fixed length and stride
*)and c_function_sig = {
c_name : QualifiedCppName.t;
c_mangled : string option;
c_template_args : template_spec_info;
}
and name =
| CStruct of QualifiedCppName.t
| CUnion of QualifiedCppName.t
| CppClass of {
name : QualifiedCppName.t;
template_spec_info : template_spec_info;
is_union : bool;
}
| CSharpClass of CSharpClassName.t
| ErlangType of ErlangTypeName.t
| HackClass of HackClassName.t
| JavaClass of JavaClassName.t
| ObjcClass of QualifiedCppName.t
| ObjcProtocol of QualifiedCppName.t
| PythonClass of PythonClassName.t
| ObjcBlock of objc_block_sig
| CFunction of c_function_sig
and template_spec_info =
| NoTemplate
| Template of {
mangled : string option;
WARNING: because of type substitutions performed by sub_type
and sub_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_objc_block_sig : objc_block_sig -> objc_block_sig -> int
val compare_c_function_sig : c_function_sig -> c_function_sig -> int
val compare_template_arg : template_arg -> template_arg -> int
val compare_template_spec_info :
template_spec_info ->
template_spec_info ->
int
val equal_objc_block_sig : objc_block_sig -> objc_block_sig -> bool
val equal_c_function_sig : c_function_sig -> c_function_sig -> bool
val equal_template_arg : template_arg -> template_arg -> bool
val equal_template_spec_info : template_spec_info -> template_spec_info -> bool
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_objc_block_sig :
objc_block_sig ->
Ppx_yojson_conv_lib.Yojson.Safe.t
val yojson_of_c_function_sig :
c_function_sig ->
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 hash_normalize_objc_block_sig : objc_block_sig -> objc_block_sig
val hash_normalize_objc_block_sig_opt :
objc_block_sig option ->
objc_block_sig option
val hash_normalize_objc_block_sig_list :
objc_block_sig list ->
objc_block_sig list
val hash_normalize_c_function_sig : c_function_sig -> c_function_sig
val hash_normalize_c_function_sig_opt :
c_function_sig option ->
c_function_sig option
val hash_normalize_c_function_sig_list :
c_function_sig list ->
c_function_sig list
val hash_normalize_template_arg : template_arg -> template_arg
val hash_normalize_template_arg_opt :
template_arg option ->
template_arg option
val hash_normalize_template_arg_list : template_arg list -> template_arg list
val hash_normalize_template_spec_info :
template_spec_info ->
template_spec_info
val hash_normalize_template_spec_info_opt :
template_spec_info option ->
template_spec_info option
val hash_normalize_template_spec_info_list :
template_spec_info list ->
template_spec_info list
val hash_fold_t :
Ppx_hash_lib.Std.Hash.state ->
t ->
Ppx_hash_lib.Std.Hash.state
val hash : t -> Ppx_hash_lib.Std.Hash.hash_value
val hash_fold_desc :
Ppx_hash_lib.Std.Hash.state ->
desc ->
Ppx_hash_lib.Std.Hash.state
val hash_desc : desc -> Ppx_hash_lib.Std.Hash.hash_value
val hash_fold_objc_block_sig :
Ppx_hash_lib.Std.Hash.state ->
objc_block_sig ->
Ppx_hash_lib.Std.Hash.state
val hash_objc_block_sig : objc_block_sig -> Ppx_hash_lib.Std.Hash.hash_value
val hash_fold_c_function_sig :
Ppx_hash_lib.Std.Hash.state ->
c_function_sig ->
Ppx_hash_lib.Std.Hash.state
val hash_c_function_sig : c_function_sig -> Ppx_hash_lib.Std.Hash.hash_value
val hash_fold_name :
Ppx_hash_lib.Std.Hash.state ->
name ->
Ppx_hash_lib.Std.Hash.state
val hash_name : name -> Ppx_hash_lib.Std.Hash.hash_value
val hash_fold_template_arg :
Ppx_hash_lib.Std.Hash.state ->
template_arg ->
Ppx_hash_lib.Std.Hash.state
val hash_template_arg : template_arg -> Ppx_hash_lib.Std.Hash.hash_value
val hash_fold_template_spec_info :
Ppx_hash_lib.Std.Hash.state ->
template_spec_info ->
Ppx_hash_lib.Std.Hash.state
val hash_template_spec_info :
template_spec_info ->
Ppx_hash_lib.Std.Hash.hash_value
val sexp_of_t : t -> Sexplib0.Sexp.t
val sexp_of_desc : desc -> Sexplib0.Sexp.t
val sexp_of_objc_block_sig : objc_block_sig -> Sexplib0.Sexp.t
val sexp_of_c_function_sig : c_function_sig -> Sexplib0.Sexp.t
val sexp_of_name : name -> Sexplib0.Sexp.t
val sexp_of_template_arg : template_arg -> Sexplib0.Sexp.t
val sexp_of_template_spec_info : template_spec_info -> Sexplib0.Sexp.t
val t_of_sexp : Sexplib0.Sexp.t -> t
val desc_of_sexp : Sexplib0.Sexp.t -> desc
val objc_block_sig_of_sexp : Sexplib0.Sexp.t -> objc_block_sig
val c_function_sig_of_sexp : Sexplib0.Sexp.t -> c_function_sig
val name_of_sexp : Sexplib0.Sexp.t -> name
val template_arg_of_sexp : Sexplib0.Sexp.t -> template_arg
val template_spec_info_of_sexp : Sexplib0.Sexp.t -> template_spec_info
val pp_template_spec_info :
IStdlib.Pp.env ->
F.formatter ->
template_spec_info ->
unit
val is_template_spec_info_empty : template_spec_info -> bool
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
Create an array type from a given element type. If length
or stride
value is given, use them as static length and size.
val size_t : ikind
ikind of size_t
val is_weak_pointer : t -> bool
val is_strong_pointer : t -> bool
module Name : sig ... end
overloading_resolution
is a list of predicates that compare whether a type T1 binds a type T2.
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 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 is_ptr_to_const : t -> bool
check if typ is a pointer type to const
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_smart_pointer : t -> bool
val is_pointer_to_unique_pointer : t -> bool
val is_folly_coro : 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_const : t -> bool
val is_pointer_to_function : t -> bool
val is_pointer : t -> bool
val is_reference : t -> bool
val is_rvalue_reference : t -> bool
val is_const_reference_on_source : 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_type : t -> bool
is t
a type produced by the Java frontend?