Commit 9cbf76bf authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

new type pointer constructor that requires mode

[r1440]
parent 6b74d7d8
......@@ -247,11 +247,7 @@ tarval *get_mode_infinite(ir_mode *mode);
*/
tarval *get_mode_NAN(ir_mode *mode);
/* -- Auxiliary modes necessary for the Firm representation -- */
extern ir_mode *mode_T; /**< tuple (none) */
extern ir_mode *mode_X; /**< execution */
extern ir_mode *mode_M; /**< memory */
extern ir_mode *mode_BB; /**< block */
/* -- A set of predifined, numerical modes according to Techreport 1999-44 -- */
extern ir_mode *mode_F; /**< signed float(32) */
......@@ -266,17 +262,23 @@ extern ir_mode *mode_Iu; /**< unsigned integer */
extern ir_mode *mode_Ls; /**< signed long integer */
extern ir_mode *mode_Lu; /**< unsigned long integer */
extern ir_mode *mode_b; /**< internal boolean */
extern ir_mode *mode_C; /**< 8 bit char */
extern ir_mode *mode_U; /**< 16 bit unicode char */
extern ir_mode *mode_P; /**< pointer */
/* -- Auxiliary modes necessary for the Firm representation -- */
extern ir_mode *mode_b; /**< internal boolean */
extern ir_mode *mode_X; /**< execution */
extern ir_mode *mode_BB; /**< block */
extern ir_mode *mode_T; /**< tuple (none) */
extern ir_mode *mode_ANY;/**< undefined mode */
extern ir_mode *mode_BAD;/**< bad mode */
/*@{*/
/** Access routines for JNI Interface */
ir_mode *get_modeT(void);
ir_mode *get_modeF(void);
ir_mode *get_modeD(void);
ir_mode *get_modeE(void);
......@@ -293,8 +295,9 @@ ir_mode *get_modeU(void);
ir_mode *get_modeP(void);
ir_mode *get_modeb(void);
ir_mode *get_modeX(void);
ir_mode *get_modeM(void);
ir_mode *get_modeBB(void);
ir_mode *get_modeM(void);
ir_mode *get_modeT(void);
ir_mode *get_modeANY(void);
ir_mode *get_modeBAD(void);
......
......@@ -1239,17 +1239,18 @@ bool is_enumeration_type (type *enumeration) {
/*******************************************************************/
/* Create a new type pointer */
INLINE type *new_type_pointer (ident *name, type *points_to) {
INLINE type *new_type_pointer_mode (ident *name, type *points_to, ir_mode *ptr_mode) {
type *res;
res = new_type(type_pointer, mode_P, name);
assert(mode_is_reference(ptr_mode));
res = new_type(type_pointer, ptr_mode, name);
res->attr.pa.points_to = points_to;
assert((get_mode_size_bytes(res->mode) != -1) && "unorthodox modes not implemented");
res->size = get_mode_size_bytes(res->mode);
res->state = layout_fixed;
return res;
}
type *new_d_type_pointer (ident *name, type *points_to, dbg_info* db) {
type *res = new_type_pointer (name, points_to);
type *new_d_type_pointer (ident *name, type *points_to, ir_mode *ptr_mode, dbg_info* db) {
type *res = new_type_pointer_mode (name, points_to, ptr_mode);
set_type_dbg_info(res, db);
return res;
}
......
......@@ -707,14 +707,21 @@ bool is_enumeration_type (type *enumeration);
/**
* @page pointer_type Representation of a pointer type
*
* The mode of the pointer type must be a mode_reference.
*
* Pointer types:
* - points_to: The type of the entity this pointer points to.
*/
/** Creates a new type pointer. */
type *new_type_pointer (ident *name, type *points_to);
/** Creates a new type pointer with debug information. */
type *new_d_type_pointer (ident *name, type *points_to, dbg_info* db);
/** Creates a new type pointer with mode mode_p. */
#define new_type_pointer(N, P) new_type_pointer_mode(N, P, mode_P)
//type *new_type_pointer (ident *name, type *points_to);
/** Creates a new type pointer with given pointer mode. */
type *new_type_pointer_mode (ident *name, type *points_to, ir_mode *ptr_mode);
/** Creates a new type pointer given pointer mode and with debug information. */
type *new_d_type_pointer (ident *name, type *points_to, ir_mode *ptr_mode, dbg_info* db);
/* --- manipulate fields of type_pointer --- */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment