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"
24 * Initialization of the tarval module.
26 * Call before init_mode().
28 * @param null_value The reference mode NULL value, typical 0l
30 void init_tarval_1(long null_value);
33 * Initialization of the tarval module.
35 * Call after init_mode().
37 void init_tarval_2(void);
40 * Free all memory occupied by the tarval module.
42 void finish_tarval(void);
45 * This struct represents the afore mentioned tarvals.
47 * A tarval struct consists of an internal representation of the
48 * value and some additional fields further describing the value.
51 * - ir_mode *mode The mode of the stored value
52 * - void *value The internal representation
55 * irmode.h for predefined modes
58 firm_kind kind; /**< must be k_tarval */
59 ir_mode *mode; /**< the mode of the stored value */
60 const void *value; /**< the value stored in an internal way... */
61 unsigned int length; /**< the length of the stored value */
64 /** remove tarval representing an entity that is about to be destroyed */
65 void free_tarval_entity(entity *ent);
67 /* inline functions */
69 * Access routines for tarval fields ========================================
71 static INLINE ir_mode *
72 _get_tarval_mode(const tarval *tv) {
77 static INLINE tarval *
78 _get_tarval_bad(void) {
82 static INLINE tarval *
83 _get_tarval_undefined(void) {
84 return tarval_undefined;
87 static INLINE tarval *
88 _get_tarval_b_false(void) {
89 return tarval_b_false;
92 static INLINE tarval *
93 _get_tarval_b_true(void) {
97 #define get_tarval_mode(tv) _get_tarval_mode(tv)
98 #define get_tarval_bad() _get_tarval_bad()
99 #define get_tarval_undefined() _get_tarval_undefined()
100 #define get_tarval_b_false() _get_tarval_b_false()
101 #define get_tarval_b_true() _get_tarval_b_true()
102 #define get_tarval_P_void() _get_tarval_P_void()
104 #endif /* _TV_T_H_ */