package clangml

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Clang.TypeSource

AST types.

Sourceval of_node : ?options:Ast.Options.t -> 'a Ast.node -> t

of_node ?options node returns the type associated to node. If node comes from libclang's AST, the function calls get_cursor_type to the associated cursor. If node has been constructed and decorated with a type ty, ty is returned. If node has been constructed without type decoration, Invalid_arg _ is raised. It is equivalent to Clang.Type.of_decoration ?options (Clang.Ast.decoration_of_node node).

Sourceval make : ?const:bool -> ?volatile:bool -> ?restrict:bool -> Ast.type_desc -> t

make ?const ?volatile ?restrict desc returns a type from a description, associated to an invalid libclang's type. This function can be useful to construct types from OCaml programs, for instance to describe a program transformation.

Sourceval of_cxtype : ?options:Ast.Options.t -> Clang__.Clang__bindings.cxtype -> t

of_cxtype ?options ty translates ty into its high-level representation.

Sourceval of_type_loc : ?options:Ast.Options.t -> Clang__.Clang__bindings.clang_ext_typeloc -> t

of_type_loc ?options ty translates ty into its high-level representation.

Sourceval of_cursor : ?options:Ast.Options.t -> Clang__.Clang__bindings.cxcursor -> t

of_cxcursor ?options cu returns the type associated to cu.

Sourceval of_decoration : ?options:Ast.Options.t -> Ast.decoration -> t

of_decoration ?options d returns the type associated to d.

Sourceval iter_fields : ?options:Ast.Options.t -> (Ast.decl -> unit) -> t -> unit

iter_fields ?options f ty calls f over all the declaration nodes of the fields belonging to the record type ty (either a struct or union). It is equivalent to Clang.iter_type_fields (fun d -> f (Clang.Decl.of_cursor ?options d)) ty.cxtype.

Sourceval list_of_fields : ?options:Ast.Options.t -> t -> Ast.decl list

list_of_fields ?options f ty returns the list of all the declaration nodes of the fields belonging to the record type ty (either a struct or union). It is equivalent to List.map (Clang.Decl.of_cursor ?options) (Clang.list_of_type_fields ty.cxtype).

Sourceval get_declaration : ?options:Ast.Options.t -> t -> Ast.decl

get_declaration ?options ty returns the declaration node of ty. It is equivalent to Clang.Decl.of_cxcursor ?options (Clang.get_type_declaration ty.cxtype).

Sourceval get_typedef_underlying_type : ?options:Ast.Options.t -> ?recursive:bool -> t -> t

get_typedef_underlying_type ?options ?recursive ty returns the underlying type of ty if ty is a typedef, and ty otherwise. If recursive is true (default: false), typedefs are followed until the underlying type is not a typedef.

Sourceval get_align_of : t -> int

get_align_of ty returns the alignment of ty in bytes. It is equivalent to Clang.type_get_align_of ty.cxtype.

Sourceval get_size_of : t -> int

get_align_of ty returns the size of ty in bytes. It is equivalent to Clang.type_get_size_of ty.cxtype.

Sourceval get_offset_of : t -> string -> int

get_offset_of ty field returns the offset of field in the elaborated type ty in bits.

Sourceval compare : t -> t -> int
Sourceval equal : t -> t -> bool
Sourceval hash : t -> int
Sourceval show : t -> string
Sourcemodule Set : Stdcompat.Set.S with type elt = t
Sourcemodule Map : Stdcompat.Map.S with type key = t
Sourcemodule Hashtbl : Stdcompat.Hashtbl.S with type key = t
OCaml

Innovation. Community. Security.