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 #ifndef callutil_INCLUDED
00037 #define callutil_INCLUDED
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #ifdef _KEEP_RCS_ID
00061 #endif
00062
00063
00064 struct arg_copy_list;
00065 struct bb;
00066 struct einfo;
00067 struct fld;
00068 struct insch;
00069 struct nd;
00070 struct st;
00071 struct stch;
00072 struct ty;
00073 #ifdef BACK_END
00074 struct op;
00075 #endif
00076
00077 #ifdef OLDCODE
00078
00079 typedef enum {
00080 RSTYLE_NONE,
00081 RSTYLE_REG,
00082 RSTYLE_REG_PAIR,
00083 RSTYLE_VIA_FIRST_ARG,
00084 RSTYLE_VIA_RETURN_ARG,
00085 RSTYLE_INT_REGS,
00086 RSTYLE_FLOAT_REGS,
00087 RSTYLE_VIA_COMMON_BUF,
00088 RSTYLE_VIA_LOCAL_BUF
00089 } RSTYLE;
00090
00091
00092
00093
00094
00095 #ifdef FRONT_END
00096 extern RSTYLE How_To_Return ( struct ty * );
00097 #ifdef OLDCODE
00098
00099 extern RSTYLE How_To_Return_Type ( struct ty *, struct nd * );
00100 #endif
00101 #endif
00102 #endif
00103
00104
00105 extern struct tn * Get_Return_Address_TN
00106 ( struct bb *bb, BOOL gen_load );
00107
00108
00109
00110
00111 extern struct insch * Find_Entry_TN_Adjustment_INSCH
00112 ( struct bb *bb, struct tn *mod_tn );
00113 extern struct insch * Find_Exit_TN_Adjustment_INSCH
00114 ( struct bb *bb, struct tn *mod_tn );
00115 #ifdef BACK_END
00116 extern struct op * Find_Entry_TN_Adjustment_OP
00117 ( struct bb *bb, struct tn *mod_tn );
00118 extern struct op * Find_Exit_TN_Adjustment_OP
00119 ( struct bb *bb, struct tn *mod_tn );
00120 #endif
00121
00122
00123 extern void Mark_Nested_Reference ( struct st *st );
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137 #ifdef FRONT_END_FORTRAN
00138
00139 typedef enum {
00140 FSTYLE_NONE,
00141 FSTYLE_NOMOVE,
00142 FSTYLE_RADICAL,
00143 FSTYLE_MEMORY
00144 } FSTYLE;
00145 #endif
00146
00147
00148
00149
00150 typedef struct arg_ty_comp {
00151 struct arg_ty_comp * next;
00152 struct ty * ctype;
00153 INTSC csize;
00154 struct nd * cnd;
00155 struct tn * tn;
00156 struct tn * tn_val;
00157 INTSC mem_ofst;
00158 INT16 parm_reg;
00159 TOP op_store;
00160 TOP op_copy;
00161 } ARG_TY_COMP;
00162
00163
00164 #define ATC_next(a) ((a)->next)
00165 #define ATC_ctype(a) ((a)->ctype)
00166 #define ATC_csize(a) ((a)->csize)
00167 #define ATC_cnd(a) ((a)->cnd)
00168 #define ATC_cnd(a) ((a)->cnd)
00169 #define ATC_tn(a) ((a)->tn)
00170 #define ATC_tn_val(a) ((a)->tn_val)
00171 #define ATC_mem_ofst(a) ((a)->mem_ofst)
00172 #define ATC_parm_reg(a) ((a)->parm_reg)
00173 #define ATC_op_store(a) ((a)->op_store)
00174 #define ATC_op_copy(a) ((a)->op_copy )
00175
00176
00177
00178
00179
00180 typedef struct arg_ty_list {
00181 struct st *sym;
00182 struct ty *type;
00183 struct nd * pnd;
00184 ARG_TY_COMP atc;
00185 mINT8 flags;
00186 mINT8 fstyle;
00187 struct st *cform;
00188 struct einfo *entry;
00189 struct arg_copy_list *copies;
00190 struct arg_ty_list *next_copy;
00191 } ARG_TY_LIST;
00192
00193
00194 #define ATL_IS_REF 0x01
00195 #define ATL_IS_IN_TN 0x02
00196 #define ATL_ON_COPIES 0x04
00197 #define ATL_IS_VARARGS 0x08
00198 #define ATL_DUP_FLOAT 0x10
00199
00200
00201 #define ATL_next(a) ((a)+1)
00202 #define ATL_sym(a) ((a)->sym)
00203 #define ATL_type(a) ((a)->type)
00204 #define ATL_pnd(a) ((a)->pnd)
00205 #define ATL_atc(a) (&((a)->atc))
00206 # define ATL_ctype(a) (ATC_ctype(ATL_atc(a)))
00207 # define ATL_csize(a) (ATC_csize(ATL_atc(a)))
00208 # define ATL_cnd(a) (ATC_cnd(ATL_atc(a)))
00209 # define ATL_tn(a) (ATC_tn(ATL_atc(a)))
00210 # define ATL_tn_val(a) (ATC_tn_val(ATL_atc(a)))
00211 # define ATL_mem_ofst(a) (ATC_mem_ofst(ATL_atc(a)))
00212 # define ATL_parm_reg(a) (ATC_parm_reg(ATL_atc(a)))
00213 # define ATL_op_store(a) (ATC_op_store(ATL_atc(a)))
00214 # define ATL_op_copy(a) (ATC_op_copy(ATL_atc(a)))
00215 #define ATL_flags(a) ((a)->flags)
00216 #define ATL_fstyle(a) ((a)->fstyle)
00217 #define ATL_cform(a) ((a)->cform)
00218 #define ATL_entry(a) ((a)->entry)
00219 #define ATL_copies(a) ((a)->copies)
00220 #define ATL_next_copy(a) ((a)->next_copy)
00221
00222 #define ATL_is_ref(a) (ATL_flags(a) & ATL_IS_REF)
00223 #define Set_ATL_is_ref(a) (ATL_flags(a) |= ATL_IS_REF)
00224 #define Reset_ATL_is_ref(a) (ATL_flags(a) &= ~ATL_IS_REF)
00225 #define ATL_is_in_tn(a) (ATL_flags(a) & ATL_IS_IN_TN)
00226 #define Set_ATL_is_in_tn(a) (ATL_flags(a) |= ATL_IS_IN_TN)
00227 #define Reset_ATL_is_in_tn(a) (ATL_flags(a) &= ~ATL_IS_IN_TN)
00228 #define ATL_on_copies(a) (ATL_flags(a) & ATL_ON_COPIES)
00229 #define Set_ATL_on_copies(a) (ATL_flags(a) |= ATL_ON_COPIES)
00230 #define Reset_ATL_on_copies(a) (ATL_flags(a) &= ~ATL_ON_COPIES)
00231 #define ATL_is_varargs(a) (ATL_flags(a) & ATL_IS_VARARGS)
00232 #define Set_ATL_is_varargs(a) (ATL_flags(a) |= ATL_IS_VARARGS)
00233 #define ATL_dup_float(a) (ATL_flags(a) & ATL_DUP_FLOAT)
00234 #define Set_ATL_dup_float(a) (ATL_flags(a) |= ATL_DUP_FLOAT)
00235
00236
00237
00238
00239
00240
00241
00242 BOOL No_Overlap ( struct fld *f1, struct fld *f2 );
00243
00244
00245 extern struct ty * Identify_Callee_Type ( struct nd *pu );
00246
00247
00248
00249
00250 extern struct ty * Formal_Parameter_Type ( struct st *parm );
00251
00252
00253
00254
00255 extern struct st * Make_Formal_Base_Symbol ( struct st *formal_sym );
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269 extern ARG_TY_LIST *Prepare_Atl_Of_Call ( struct nd *t );
00270 extern ARG_TY_LIST *Prepare_Atl_Of_Formals ( struct nd *t,
00271 struct stch *args );
00272
00273 extern void Trace_ATL ( ARG_TY_LIST *atl );
00274 extern void Trace_ATL_List ( struct nd *t, ARG_TY_LIST *atl );
00275
00276 #ifdef __cplusplus
00277 }
00278 #endif
00279 #endif