Module Clang.Decl

AST declarations.

type t = Ast.decl
val of_cxcursor : ?⁠options:Ast.Options.t -> Clang__.Clang__bindings.cxcursor -> t

of_cxcursor ?options cu translates cu into its high-level representation, supposing that cu points to a declaration.

val get_typedef_underlying_type : ?⁠options:Ast.Options.t -> ?⁠recursive:bool -> t -> Type.t

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

val get_field_bit_width : t -> int

get_field_bit_width d returns the bit width of the field declaration d.

val get_size_expr : ?⁠options:Ast.Options.t -> t -> Expr.t

get_size_expr ?options d returns the expression specifying the size of the array declared by d, and fails if d is not an array declaration.

val get_type_loc : ?⁠options:Ast.Options.t -> t -> Type_loc.t
val get_canonical : t -> Clang__.Clang__bindings.cxcursor

get_canonical d retrieves the canonical cursor declaring an entity.

include Clang__.Ast_sig.S with type t := t
type t
val compare : t -> t -> int
val equal : t -> t -> bool
val hash : t -> int
val pp : Stdcompat.Format.formatter -> t -> unit
val show : t -> string
module Set : Stdcompat.Set.S with type Set.elt = t
module Map : Stdcompat.Map.S with type Map.key = t
module Hashtbl : Stdcompat.Hashtbl.S with type Hashtbl.key = t