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