#ifndef _DPAS_TYPES_H
#define _DPAS_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
#define DPAS_TAG_BOOLEAN 1
#define DPAS_TAG_CBOOLEAN 2
#define DPAS_TAG_CHAR 3
#define DPAS_TAG_NIL 4
#define DPAS_TAG_NAME 5
#define DPAS_TAG_VAR 6
#define DPAS_TAG_SUBRANGE 7
#define DPAS_TAG_ENUM 8
#define DPAS_TAG_SET 9
#define DPAS_TAG_ARRAY 10
#define DPAS_TAG_CONFORMANT_ARRAY 11
extern jit_type_t dpas_type_boolean;
extern jit_type_t dpas_type_cboolean;
extern jit_type_t dpas_type_char;
extern jit_type_t dpas_type_string;
extern jit_type_t dpas_type_address;
extern jit_type_t dpas_type_nil;
extern jit_type_t dpas_type_size_t;
extern jit_type_t dpas_type_ptrdiff_t;
typedef struct
{
jit_constant_t first;
jit_constant_t last;
} dpas_subrange;
typedef struct
{
char *name;
int num_elems;
} dpas_enum;
typedef struct
{
jit_type_t *bounds;
int num_bounds;
} dpas_array;
typedef struct
{
int num_bounds;
int is_packed;
} dpas_conformant_array;
void dpas_init_types(void);
unsigned int dpas_type_find_name(jit_type_t type, const char *name);
jit_type_t dpas_type_get_field(jit_type_t type, const char *name,
jit_nint *offset);
char *dpas_type_name(jit_type_t type);
char *dpas_type_name_with_var(const char *name, jit_type_t type);
jit_type_t dpas_promote_type(jit_type_t type);
jit_type_t dpas_common_type(jit_type_t type1, jit_type_t type2, int int_only);
jit_type_t dpas_create_subrange(jit_type_t underlying, dpas_subrange *values);
jit_type_t dpas_create_enum(jit_type_t underlying, int num_elems);
jit_nuint dpas_type_range_size(jit_type_t type);
jit_type_t dpas_create_array(jit_type_t *bounds, int num_bounds,
jit_type_t elem_type);
jit_type_t dpas_create_conformant_array(jit_type_t elem_type, int num_bounds,
int is_packed);
jit_type_t dpas_type_get_elem(jit_type_t type);
int dpas_type_get_rank(jit_type_t type);
void dpas_type_set_name(jit_type_t type, const char *name);
void dpas_convert_constant(jit_constant_t *result, jit_constant_t *from,
jit_type_t to_type);
char *dpas_constant_name(jit_constant_t *value);
int dpas_is_set_compatible(jit_type_t type);
int dpas_type_is_numeric(jit_type_t type);
int dpas_type_is_integer(jit_type_t type);
int dpas_type_is_boolean(jit_type_t type);
int dpas_type_is_record(jit_type_t type);
int dpas_type_is_array(jit_type_t type);
int dpas_type_is_conformant_array(jit_type_t type);
jit_type_t dpas_type_is_var(jit_type_t type);
int dpas_type_identical(jit_type_t type1, jit_type_t type2, int normalize);
#ifdef __cplusplus
};
#endif
#endif