3 * File name: ir/tv/tv_t.h
4 * Purpose: Representation of and static computations on target machine
5 * values -- private header.
10 * Copyright: (c) 2003 Universität Karlsruhe
11 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 #include "firm_config.h"
22 * Initialization of the tarval module.
24 * Call before init_mode().
26 void init_tarval_1(void);
29 * Initialization of the tarval module.
31 * Call after init_mode().
33 void init_tarval_2(void);
36 * Free all memory occupied by the tarval module.
38 void finish_tarval(void);
41 * This struct represents the afore mentioned tarvals.
43 * A tarval struct consists of an internal representation of the
44 * value and some additional fields further describing the value.
47 * - ir_mode *mode The mode of the stored value
48 * - void *value The internal representation
51 * irmode.h for predefined modes
54 firm_kind kind; /**< must be k_tarval */
55 ir_mode *mode; /**< the mode of the stored value */
56 const void *value; /**< the value stored in an internal way... */
57 unsigned int length; /**< the length of the stored value */
60 /** remove tarval representing an entity that is about to be destroyed */
61 void free_tarval_entity(entity *ent);
63 /* inline functions */
65 * Access routines for tarval fields ========================================
67 static INLINE ir_mode *
68 _get_tarval_mode(const tarval *tv) {
73 static INLINE tarval *
74 _get_tarval_bad(void) {
78 static INLINE tarval *
79 _get_tarval_undefined(void) {
80 return tarval_undefined;
83 static INLINE tarval *
84 _get_tarval_b_false(void) {
85 return tarval_b_false;
88 static INLINE tarval *
89 _get_tarval_b_true(void) {
93 static INLINE tarval *
94 _get_tarval_P_void(void) {
98 #define get_tarval_mode(tv) _get_tarval_mode(tv)
99 #define get_tarval_bad() _get_tarval_bad()
100 #define get_tarval_undefined() _get_tarval_undefined()
101 #define get_tarval_b_false() _get_tarval_b_false()
102 #define get_tarval_b_true() _get_tarval_b_true()
103 #define get_tarval_P_void() _get_tarval_P_void()
105 #endif /* _TV_T_H_ */