Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
cwh_auxst.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 /* ====================================================================
00037  * ====================================================================
00038  *
00039  *
00040  * Revision history:
00041  *  dd-mmm-95 - Original Version
00042  *
00043  * Description: Exports interfaces from cwh_stab.c (symbol tables).
00044  *              Most descriptions are in cwh_stab.{c,i}
00045  *
00046  * ====================================================================
00047  * ====================================================================
00048  */
00049 
00050 #ifndef CWH_AUXST_INCLUDED
00051 #define CWH_AUXST_INCLUDED
00052 
00053 #ifdef _KEEP_RCS_ID
00054 #endif /* _KEEP_RCS_ID */
00055 
00056 /* de/allocation */
00057 extern void   cwh_auxst_register_table(void);
00058 extern void   cwh_auxst_un_register_table(void);
00059 extern void   cwh_auxst_alloc_container_table(void);
00060 extern void   cwh_auxst_clear_per_PU(void) ;
00061 extern void   cwh_auxst_free(void) ;
00062 extern void   cwh_auxst_free_list (LIST ** lp) ;
00063 
00064 extern void   cwh_auxst_clear(ST *st);
00065 
00066 
00067 /* ----------------------------------------------------
00068    TAGS for processing lists of additional information 
00069     used as flags to AUXST lookup routine.              
00070 */
00071 
00072 enum list_name {
00073   l_COMLIST,               /* STs in a COMMON ordered by offset          */
00074   l_ALTENTRY,              /* STs of alternate entry points              */
00075   l_RETURN_TEMPS,          /* STs of alternate entry return temps        */
00076   l_NAMELIST,              /* STs of Namelist items                      */
00077   l_SPLITLIST,             /* STs of split commons, for pragmas          */
00078   l_EQVLIST,               /* STs in Equivalence                         */
00079   l_DST_COMLIST,           /* COMMON STs (Global) for DST info in PU     */
00080   l_DST_PARMLIST,          /* Parameter STs (Global) for DST info in PU  */
00081   l_TYMDLIST               /* STs of derived type or imported variable   */
00082 };
00083 
00084 
00085 /* ----------------------------------------------------
00086     enum for flags in AUXST - used as mask 
00087     cwh_auxst.i has details, macros below,
00088 */
00089 
00090 enum flags_a { 
00091         f_RSLTTMP = 0x01,     /* fn has rslt temp as 1st arg      */
00092         f_ELEM    = 0x02,     /* is elemental function            */
00093         f_ALTENT  = 0x04,     /* is alternate entry point         */
00094         f_ALTTY   = 0x08,     /* all alternate entries share a TY */
00095         f_VISITED = 0x10,     /* visited on IO walk               */
00096         f_NONCONT = 0x20,     /* is non-contiguous                */
00097         f_AUTO_OR_CPTR = 0x40,/* Auto or Cray Pointer             */
00098         f_F90_PTR = 0x80,     /* F90 Pointer                      */
00099         f_MODULE  = 0x100,    /* Common represents module data    */
00100         f_XP_COPY = 0x200,    /* Have emitted XPRAGMA COPYIN      */
00101         f_IS_TMP  = 0x400,    /* is a compiler temp               */
00102         f_ALLOC   = 0x800,    /* Allocatable                      */
00103         f_ASSUMED = 0x1000,   /* Assumed shape                    */
00104         f_A_SIZE  = 0x2000,   /* Assumed size                     */
00105         f_IS_RSLTTMP = 0x4000 /* is the fn rslt temp (1st arg)    */
00106 } ;
00107 
00108 
00109 #define Set_ST_auxst_has_rslt_tmp(st,val) cwh_auxst_set_flag(st,f_RSLTTMP,val)
00110 #define ST_auxst_has_rslt_tmp(st) cwh_auxst_read_flag(st,f_RSLTTMP)
00111 
00112 #define Set_ST_auxst_is_rslt_tmp(st,val) cwh_auxst_set_flag(st,f_IS_RSLTTMP,val)
00113 #define ST_auxst_is_rslt_tmp(st) cwh_auxst_read_flag(st,f_IS_RSLTTMP)
00114 
00115 #define Set_ST_auxst_is_elemental(st,val) cwh_auxst_set_flag(st,f_ELEM,val)
00116 #define ST_auxst_is_elemental(st) cwh_auxst_read_flag(st,f_ELEM)
00117 
00118 #define Set_ST_auxst_is_altentry(st,val) cwh_auxst_set_flag(st,f_ALTENT,val)
00119 #define ST_auxst_is_altentry(st) cwh_auxst_read_flag(st,f_ALTENT)
00120 
00121 #define Set_ST_auxst_altentry_shareTY(st,val) cwh_auxst_set_flag(st,f_ALTTY,val)
00122 #define ST_auxst_altentry_shareTY(st) cwh_auxst_read_flag(st,f_ALTTY)
00123 
00124 #define Set_ST_auxst_visited(st,val) cwh_auxst_set_flag(st,f_VISITED,val)
00125 #define ST_auxst_visited(st) cwh_auxst_read_flag(st,f_VISITED)
00126 
00127 #define Set_ST_auxst_is_non_contiguous(st,val) cwh_auxst_set_flag(st,f_NONCONT,val)
00128 #define ST_auxst_is_non_contiguous(st) cwh_auxst_read_flag(st,f_NONCONT)
00129 
00130 #define Set_ST_auxst_is_auto_or_cpointer(st,val) cwh_auxst_set_flag(st,f_AUTO_OR_CPTR,val)
00131 #define ST_auxst_is_auto_or_cpointer(st) cwh_auxst_read_flag(st,f_AUTO_OR_CPTR)
00132 
00133 #define Set_ST_auxst_is_f90_pointer(st,val) cwh_auxst_set_flag(st,f_F90_PTR,val)
00134 #define ST_auxst_is_f90_pointer(st) cwh_auxst_read_flag(st,f_F90_PTR)
00135 
00136 #define Set_ST_auxst_is_module_data(st,val) cwh_auxst_set_flag(st,f_MODULE,val)
00137 #define ST_auxst_is_module_data(st) cwh_auxst_read_flag(st,f_MODULE)
00138 
00139 #define Set_ST_auxst_xpragma_copyin(st,val) cwh_auxst_set_flag(st,f_XP_COPY,val)
00140 #define ST_auxst_xpragma_copyin(st) cwh_auxst_read_flag(st,f_XP_COPY)
00141 
00142 #define Set_ST_auxst_is_tmp(st,val) cwh_auxst_set_flag(st,f_IS_TMP,val)
00143 #define ST_auxst_is_tmp(st) cwh_auxst_read_flag(st,f_IS_TMP)
00144 
00145 #define Set_ST_auxst_is_allocatable(st,val) cwh_auxst_set_flag(st,f_ALLOC,val)
00146 #define ST_auxst_is_allocatable(st) cwh_auxst_read_flag(st,f_ALLOC)
00147 
00148 #define Set_ST_auxst_is_assumed_shape(st,val) cwh_auxst_set_flag(st,f_ASSUMED,val)
00149 #define ST_auxst_is_assumed_shape(st) cwh_auxst_read_flag(st,f_ASSUMED)
00150 
00151 #define Set_ST_auxst_is_assumed_size(st,val) cwh_auxst_set_flag(st,f_A_SIZE,val)
00152 #define ST_auxst_is_assumed_size(st) cwh_auxst_read_flag(st,f_A_SIZE)
00153 
00154 extern void   cwh_auxst_set_flag(ST * st,enum flags_a f, BOOL val) ;
00155 extern BOOL   cwh_auxst_read_flag(ST * st,enum flags_a f);
00156 
00157 /* Forward reference, defined in cwh_data.cxx */
00158 
00159 struct data_info_s;
00160 extern void   Set_ST_auxst_data_info(ST *st, data_info_s * data_info);
00161 extern data_info_s * ST_auxst_data_info(ST *st);
00162 
00163 
00164 /* individual items */
00165 
00166 extern ITEM * cwh_auxst_add_to_list(LIST ** lp, ST *st, BOOL order);
00167 extern void   cwh_auxst_add_list(ST * parent, LIST *l, enum list_name list) ;
00168 extern LIST * cwh_auxst_get_list(ST * st, enum list_name list);
00169 extern void   cwh_auxst_add_item(ST * parent, ST *st, enum list_name list);
00170 extern ITEM * cwh_auxst_next_element(ST * parent, ITEM *i, enum list_name list) ;
00171 extern BOOL   cwh_auxst_read_flag(ST * st, enum flags_a f) ;
00172 extern void   cwh_auxst_set_flag(ST * st, enum flags_a f, BOOL val);
00173 extern ST *   cwh_auxst_find_item(LIST *l, char * name);
00174 
00175 
00176 
00177 /* procedure details */
00178 
00179 extern void   cwh_auxst_alloc_proc_entry(ST *st,INT32 num_dum_args, TY_IDX ret_type);
00180 extern void   cwh_auxst_patch_proc(TY_IDX rty_idx);
00181 extern BOOL   cwh_auxst_find_dummy(ST * arg);
00182 extern INT16  cwh_auxst_num_dummies(ST * entry);
00183 extern ST **  cwh_auxst_arglist(ST * entry);
00184 extern ST *   cwh_auxst_find_dummy_len(ST * arg);
00185 extern void   cwh_auxst_add_dummy(ST * dummy, BOOL result);
00186 extern void   cwh_auxst_set_tylist(ST *en);
00187 
00188 /* sundry utilities */
00189 
00190 extern ST *      cwh_auxst_cri_pointee(ST * ptr, ST * pointee);
00191 extern PREG_det  cwh_auxst_distr_preg(ST * st);
00192 extern USRCPOS   cwh_auxst_srcpos_val(ST * st);
00193 extern USRCPOS * cwh_auxst_srcpos_addr(ST * st) ;
00194 extern WN *      cwh_auxst_pragma(ST * ptr, WN * wn = NULL);
00195 extern char *    cwh_auxst_stem_name(ST * st, char * name = NULL) ;
00196 INT32 *          cwh_auxst_assign_id(SYMTAB_IDX level, LABEL_IDX idx) ;
00197 
00198 /* dump routines */
00199 
00200 extern void cwh_auxst_dump (ST * st);
00201 extern void cwh_auxst_dump_list (LIST * l, BOOL verbose);
00202 
00203 #endif /* CWH_AUXST_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines