Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #ifndef CWH_DEFINES_INCLUDED
00050 #define CWH_DEFINES_INCLUDED
00051
00052 #include "defs.h"
00053
00054
00055
00056 typedef INT64 OFFSET_64 ;
00057 typedef unsigned long ULONG ;
00058 typedef long SLONG ;
00059 #define cast_to_TY(x) ((TY_IDX) (mUINT32)x)
00060 #define cast_to_WN(x) ((WN *) (void *)x)
00061 #define cast_to_ST(x) ((ST *) (void *)x)
00062 #define cast_to_LB(x) ((LABEL_IDX) (mUINT32)x)
00063 #define cast_to_uint(x) ((unsigned long) (void *)x)
00064 #define cast_to_int(x) ((long ) (void *)x)
00065 #define cast_to_void(x) ((void *)x)
00066 #define cast_to_STB(x) ((STB_pkt *) (void *)x)
00067
00068
00069
00070
00071 #define DUMP_TY(ty) dump_ty(ty)
00072 #define DUMP_ST(st) dump_st(st)
00073 #define DUMP_LB(lb) dump_label(lb)
00074 #define DUMP_WN(wn) fdump_tree(stdout,wn);
00075 #define DUMP_STK cwh_stk_dump()
00076
00077
00078 extern void dump_ty (TY_IDX ty);
00079 extern void dump_st (ST * st);
00080 extern void dump_label(LABEL_IDX lb);
00081
00082
00083
00084 #define bit_to_byte(a) (a >> 3)
00085 #define bit_to_byte_WN(a) (cwh_expr_bincalc(OPR_DIV,WN_COPY_Tree(a),WN_CreateIntconst (OPC_U4INTCONST,8)))
00086 #define byte_to_bit(a) (a << 3)
00087 #define test_flag(f,sh) ((INT32)((f >> sh) & 1))
00088
00089
00090
00091 #define GLOBAL_LEVEL 1
00092 #define HOST_LEVEL GLOBAL_LEVEL + 1
00093 #define INTERNAL_LEVEL HOST_LEVEL + 1
00094
00095
00096
00097 #define WNOPR(w) (WN_operator(w))
00098 #define WNRTY(w) (WN_rtype(w))
00099 #define IS_GLOBAL_SYMTAB(s) (SYMTAB_level(s) == GLOBAL_LEVEL)
00100 #define IN_HOST_PU (CURRENT_SYMTAB == HOST_LEVEL)
00101 #define IN_NESTED_PU (CURRENT_SYMTAB >= INTERNAL_LEVEL)
00102
00103 #define RESULT_SIZE 16
00104 #define RESULT_ALIGN 8
00105
00106
00107
00108
00109
00110
00111
00112
00113 typedef struct {
00114 WN * wn ;
00115 TY_IDX ty ;
00116 } W_node ;
00117
00118 #define W_wn(a) (a.wn)
00119 #define W_ty(a) (a.ty)
00120 #define iW_wn(a) (a->wn)
00121 #define iW_ty(a) (a->ty)
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 typedef struct blist {
00132 ST * element ;
00133 struct blist * nxt ;
00134 } ITEM ;
00135
00136 #define I_element(i) ((i)->element)
00137 #define I_next(i) ((i)->nxt)
00138
00139 typedef struct clist {
00140 ITEM * first ;
00141 ITEM * last ;
00142 INT32 nitems ;
00143 } LIST ;
00144
00145 #define L_first(l) ((l)->first)
00146 #define L_last(l) ((l)->last)
00147 #define L_num(l) ((l)->nitems)
00148
00149
00150
00151
00152 #define OPC_UNKNOWN 0
00153 #define MAX_ARY_DIMS 7
00154 #define NUM_LOG_KINDS 4
00155
00156 #define ANULL -1
00157
00158
00159 extern MEM_POOL *FE_Mempool;
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194 #ifdef TARG_MIPS
00195 #undef RESULT_SIZE
00196 #define RESULT_SIZE 16
00197 #endif
00198
00199 #ifndef SOURCE_TO_SOURCE
00200 #define SOURCE_TO_SOURCE 1
00201 #endif
00202 #ifdef TARG_IA32
00203 #undef RESULT_SIZE
00204 #define RESULT_SIZE 0
00205 #endif
00206 #ifdef TARG_IA64
00207 #undef RESULT_SIZE
00208 #define RESULT_SIZE 64
00209 #endif
00210
00211 #define STRUCT_BY_VALUE(ty) ((TY_kind(ty) == KIND_STRUCT) \
00212 && (TY_size(ty) <= RESULT_SIZE) \
00213 && !cwh_types_contains_dope(ty))
00214
00215
00216 #endif
00217