Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
globals.m
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 /* USMID:  "\n@(#)5.0_pl/macros/globals.m       5.20    10/27/99 17:06:38\n" */
00037  
00038 
00039 /*****************\
00040 |* MISCELLANEOUS *|
00041 \*****************/
00042 
00043 /* These are the compiler generated integer and logical types.  They  */
00044 /* must always be set to the default types for the machine.           */
00045 
00046 # define CG_INTEGER_DEFAULT_TYPE init_default_linear_type[Fortran_Integer]
00047 
00048 /* These macros are used for the default types.  They are set in init_type. */
00049 
00050 # define CHARACTER_DEFAULT_TYPE      default_linear_type[Fortran_Character]
00051 # define COMPLEX_DEFAULT_TYPE        default_linear_type[Fortran_Complex]
00052 # define DOUBLE_COMPLEX_DEFAULT_TYPE TYP_LINEAR(DOUBLE_COMPLEX_TYPE_IDX)
00053 # define DOUBLE_DEFAULT_TYPE         TYP_LINEAR(DOUBLE_PRECISION_TYPE_IDX)
00054 # define INTEGER_DEFAULT_TYPE        default_linear_type[Fortran_Integer]
00055 # define LOGICAL_DEFAULT_TYPE        default_linear_type[Fortran_Logical]
00056 # define REAL_DEFAULT_TYPE           default_linear_type[Fortran_Real]
00057 
00058 # if !defined(_HOST32) && !defined(_WHIRL_HOST64_TARGET64)
00059 # define TYPELESS_DEFAULT_TYPE       Typeless_8
00060 # else
00061 # define TYPELESS_DEFAULT_TYPE       Typeless_4
00062 # endif
00063 
00064 
00065 # ifdef _TYPE_CODE_64_BIT
00066 # define IO_TYPE_CODE_TYPE           Integer_8
00067 # else
00068 # define IO_TYPE_CODE_TYPE           TYPELESS_DEFAULT_TYPE
00069 # endif
00070 
00071 # define MAX_ID_LEN             31                      /* Num of chars in ID */
00072 # define MAX_EXTERNAL_ID_LEN    255                     /* Num chars in extern*/
00073 
00074 # define FALSE                  0
00075 # define IDENTICAL              0
00076 # define NULL_IDX               0
00077 # define TRUE                   1
00078  
00079 # define DEFAULT_SAFEVL         _MAXVL
00080 
00081 # define AMP                    '&'
00082 # define AT_SIGN                '@'
00083 # define BANG                   '!'
00084 # define BK_SLASH               '\\'
00085 # define BLANK                  ' '
00086 # define COLON                  ':'
00087 # define COMMA                  ','
00088 # define DASH                   '-'
00089 # define DBL_QUOTE              '"'
00090 # define DOLLAR                 '$'
00091 # define DOT                    '.'
00092 # define EOS                    '\0'    /* Use this when you really mean EOS. */
00093 # define EQUAL                  '='
00094 # define GT                     '>'
00095 # define LBRKT                  '['
00096 # define LPAREN                 '('
00097 # define LT                     '<'
00098 # define MINUS                  '-'
00099 # define NEWLINE                '\n'
00100 # define NULL_CHAR              '\0'    /* Use this for generic NULL char.    */
00101 # define PERCENT                '%'
00102 # define PLUS                   '+'
00103 # define QUEST_MARK             '?'
00104 # define QUOTE                  '\''
00105 # define RBRKT                  ']'
00106 # define RPAREN                 ')'
00107 # define SEMI_COLON             ';'
00108 # define SHARP                  '#'
00109 # define SLASH                  '/'
00110 # define STAR                   '*'
00111 # define TAB                    '\t'
00112 # define USCORE                 '_'
00113 # define ZERO                   '0'
00114 
00115 # define EOS_STR                "EOS"
00116 
00117 /* -------------------------------------------------------------------------- */
00118 /*  Define masks to describe Compiler Information File (CIF) command line     */
00119 /*  options.  The combinations are recorded in cif_flags by process_c_option  */
00120 /*  in cmd_line.c.                                                            */
00121 /* -------------------------------------------------------------------------- */
00122 
00123 # define  ALL_RECS              0001            /* a = f + c + i + m + o + x  */
00124 # define  COMPILER_RECS         0002            /* c = c + f                  */
00125 # define  BASIC_RECS            0004            /* f                          */
00126 # define  INFO_RECS             0010            /* i = i + f                  */
00127 # define  MESSAGE_RECS          0020            /* m = m + f                  */
00128 # define  MISC_RECS             0040            /* o = o + f + i              */
00129 # define  OUTPUT_TO_STDOUT      0100            /* s                          */
00130 # define  XREF_RECS             0200            /* x = x + f + i              */
00131 # define  CMD_PROVIDED_CIF      4000            /* The command processor      */
00132                                                 /* passed the CIF name to us  */
00133                                                 /* via -CZ <name>.            */
00134 
00135 
00136 /*******************************************\
00137 |* open mp directive argument index macros *|
00138 \*******************************************/
00139 
00140 # define OPEN_MP_LIST_CNT               19
00141 
00142 # define OPEN_MP_IF_IDX                  0
00143 # define OPEN_MP_PRIVATE_IDX             1
00144 # define OPEN_MP_SHARED_IDX              2
00145 # define OPEN_MP_FIRSTPRIVATE_IDX        3
00146 # define OPEN_MP_DEFAULT_IDX             4
00147 # define OPEN_MP_COPYIN_IDX              5
00148 # define OPEN_MP_REDUCTION_OPR_IDX       6
00149 # define OPEN_MP_REDUCTION_LIST_IDX      7
00150 # define OPEN_MP_LASTPRIVATE_IDX         8
00151 # define OPEN_MP_ORDERED_IDX             9
00152 # define OPEN_MP_SCHEDULE_TYPE_IDX      10
00153 # define OPEN_MP_SCHEDULE_CHUNK_IDX     11
00154 # define OPEN_MP_COPYPRIVATE_IDX        12
00155 # define OPEN_MP_AFFINITY_IDX           13
00156 # define OPEN_MP_IS_THREAD_IDX          14
00157 # define OPEN_MP_THREAD_DATA_IDX        15
00158 # define OPEN_MP_ONTO_IDX               16
00159 # define OPEN_MP_NEST_IDX               17
00160 # define OPEN_MP_FLUSH_IDX              18
00161 
00162 /***************************************\
00163 |* sgi directive argument index macros *|
00164 \***************************************/
00165 
00166 # define MP_DIR_LIST_CNT               14
00167 
00168 # define MP_DIR_IF_IDX                  0
00169 # define MP_DIR_SHARE_IDX               1
00170 # define MP_DIR_LASTLOCAL_IDX           2
00171 # define MP_DIR_REDUCTION_IDX           3
00172 # define MP_DIR_MP_SCHEDTYPE_IDX        4
00173 # define MP_DIR_CHUNK_IDX               5
00174 # define MP_DIR_AFFINITY_IDX            6
00175 # define MP_DIR_IS_THREAD_IDX           7
00176 # define MP_DIR_THREAD_DATA_IDX         8
00177 # define MP_DIR_LOCAL_IDX               9
00178 # define MP_DIR_ONTO_IDX               10
00179 # define MP_DIR_NEST_IDX               11
00180 # define MP_DIR_LASTTHREAD_IDX         12
00181 # define MP_DIR_ORDERED_IDX            13
00182 
00183 /* this is the whirl enum for DEFAULT values. */
00184 /* It comes from common/com/wn_pragmas.h.     */
00185 /*typedef enum {                                */
00186 /*  WN_PRAGMA_DEFAULT_UNKNOWN,                  */
00187 /*  WN_PRAGMA_DEFAULT_NONE,                     */
00188 /*  WN_PRAGMA_DEFAULT_SHARED,                   */
00189 /*  WN_PRAGMA_DEFAULT_PRIVATE,                  */
00190 /* MAX_PRAGMA_DEFAULT                           */
00191 /*} WN_PRAGMA_DEFAULT_KIND;                     */
00192 
00193 # define OPEN_MP_DEFAULT_NONE           1
00194 # define OPEN_MP_DEFAULT_SHARED         2
00195 # define OPEN_MP_DEFAULT_PRIVATE        3
00196 
00197 /* this is the whirl enum for mp_schedtype */
00198 /* typedef enum { */
00199 /*  WN_PRAGMA_SCHEDTYPE_UNKNOWN, */
00200 /*  WN_PRAGMA_SCHEDTYPE_RUNTIME, */
00201 /*  WN_PRAGMA_SCHEDTYPE_SIMPLE, */
00202 /*  WN_PRAGMA_SCHEDTYPE_INTERLEAVE, */
00203 /*  WN_PRAGMA_SCHEDTYPE_DYNAMIC, */
00204 /*  WN_PRAGMA_SCHEDTYPE_GSS, */
00205 /*  WN_PRAGMA_SCHEDTYPE_PSEUDOLOWERED, */
00206 /*  MAX_PRAGMA_SCHEDTYPE */
00207 /*} WN_PRAGMA_SCHEDTYPE_KIND; */
00208 
00209 # define MP_SCHEDTYPE_RUNTIME                           1
00210 # define MP_SCHEDTYPE_SIMPLE                            2
00211 # define MP_SCHEDTYPE_INTERLEAVED                       3
00212 # define MP_SCHEDTYPE_DYNAMIC                           4
00213 # define MP_SCHEDTYPE_GUIDED                            5
00214 
00215 # define OPEN_MP_SCHEDULE_RUNTIME       1
00216 # define OPEN_MP_SCHEDULE_STATIC        2
00217 # define OPEN_MP_SCHEDULE_DYNAMIC       4
00218 # define OPEN_MP_SCHEDULE_GUIDED        5
00219 
00220 # define DOPREFER_SERIAL                                1
00221 # define DOPREFER_CONCURRENT                            2
00222 # define DOPREFER_VECTOR                                3
00223 
00224 # define ASSERT_ARGUMENTALIASING                        1
00225 # define ASSERT_NOARGUMENTALIASING                      2
00226 # define ASSERT_BOUNDSVIOLATIONS                        3
00227 # define ASSERT_NOBOUNDSVIOLATIONS                      4
00228 # define ASSERT_CONCURRENTCALL                          5
00229 # define ASSERT_NOCONCURRENTCALL                        6
00230 # define ASSERT_NORECURRENCE                            7
00231 # define ASSERT_DOPREFER                                8
00232 # define ASSERT_EQUIVALENCEHAZARD                       9
00233 # define ASSERT_NOEQUIVALENCEHAZARD                     10
00234 # define ASSERT_LASTVALUENEEDED                         11
00235 # define ASSERT_LASTVALUESNEEDED                        12
00236 # define ASSERT_NOLASTVALUENEEDED                       13
00237 # define ASSERT_NOLASTVALUESNEEDED                      14
00238 # define ASSERT_PERMUTATION                             15
00239 # define ASSERT_RELATION                                16
00240 # define ASSERT_NOSYNC                                  17
00241 # define ASSERT_TEMPORARIESFORCONSTANTARGUMENTS         18
00242 # define ASSERT_NOTEMPORARIESFORCONSTANTARGUMENTS       19
00243 # define ASSERT_DO                                      20
00244 # define ASSERT_BENIGN                                  21
00245 # define ASSERT_DEPENDENCE                              22
00246 # define ASSERT_FREQUENCY                               23
00247 # define ASSERT_IGNOREANYDEPENDENCES                    24
00248 # define ASSERT_IGNOREANYDEPENDENCE                     25
00249 # define ASSERT_IGNOREASSUMEDDEPENDENCES                26
00250 # define ASSERT_IGNOREASSUMEDDEPENDENCE                 27
00251 # define ASSERT_NOINTERCHANGE                           28
00252 # define ASSERT_USECOMPRESS                             29
00253 # define ASSERT_USEEXPAND                               30
00254 # define ASSERT_USECONTROLLEDSTORE                      31
00255 # define ASSERT_USEGATHER                               32
00256 # define ASSERT_USESCATTER                              33
00257 
00258 /*************************\
00259 |* OPND TYPE initializer *|
00260 \*************************/
00261 
00262 # define INIT_OPND_TYPE {0,0,0,0,0,NO_Tbl_Idx,0}
00263 
00264 
00265 /* -------------------------------------------------------------------------- */
00266 /* Table type to mark the module information table in the PDT                 */
00267 /* -------------------------------------------------------------------------- */
00268 
00269 # define COMPILER_INFO_TABLE_TYPE       026     /* Octal */
00270 
00271 
00272 /* This is the test for dalign on IRIX and Solaris machines.                  */
00273 /* It is used by s_cnstrct.c as well as sytb.c.                      BHJ      */
00274 /* Complex_4 was #if'd out on 4/29/97 by LRR per the following from Rich:     */
00275 /*   I believe we want to do this.  In our compiler, the alignment for a      */
00276 /*   COMPLEX type is the same as the alignment of the underlying REAL type;   */
00277 /*   that is, COMPLEX(4) should be aligned on a 4 byte boundary and           */
00278 /*   COMPLEX(8) should be aligned on an 8 byte boundary.                      */
00279 
00280 # if (defined(_TARGET_OS_IRIX) || defined(_TARGET_OS_LINUX)) 
00281 
00282 # define DALIGN_TEST_CONDITION(TYPE_IDX)                                      \
00283                                 TYP_LINEAR(TYPE_IDX) == Integer_8 ||          \
00284                                 TYP_LINEAR(TYPE_IDX) == Logical_8 ||          \
00285                                 TYP_LINEAR(TYPE_IDX) == Real_8    ||          \
00286                                 TYP_LINEAR(TYPE_IDX) == Real_16   ||          \
00287                                 TYP_LINEAR(TYPE_IDX) == Complex_8 ||          \
00288                                 TYP_LINEAR(TYPE_IDX) == Complex_16 ||         \
00289                                 TYP_LINEAR(TYPE_IDX) == Typeless_8 ||         \
00290                                 TYP_LINEAR(TYPE_IDX) == Long_Typeless ||      \
00291                                 (cmd_line_flags.s_pointer8 &&                 \
00292                                  (TYP_LINEAR(TYPE_IDX) == CRI_Ptr_8 ||        \
00293                                   TYP_LINEAR(TYPE_IDX) == CRI_Ch_Ptr_8)) ||   \
00294                                 (TYP_TYPE(TYPE_IDX) == Structure &&           \
00295                                 ATT_DALIGN_ME(TYP_IDX(TYPE_IDX)))
00296 # else
00297 
00298 # define DALIGN_TEST_CONDITION(TYPE_IDX)                                      \
00299                                 TYP_LINEAR(TYPE_IDX) == Integer_8 ||          \
00300                                 TYP_LINEAR(TYPE_IDX) == Logical_8 ||          \
00301                                 TYP_LINEAR(TYPE_IDX) == Real_8    ||          \
00302                                 TYP_LINEAR(TYPE_IDX) == Real_16   ||          \
00303                                 TYP_LINEAR(TYPE_IDX) == Complex_4 ||          \
00304                                 TYP_LINEAR(TYPE_IDX) == Complex_8 ||          \
00305                                 TYP_LINEAR(TYPE_IDX) == Complex_16 ||         \
00306                                 TYP_LINEAR(TYPE_IDX) == Typeless_8 ||         \
00307                                 TYP_LINEAR(TYPE_IDX) == Long_Typeless ||      \
00308                                 (TYP_TYPE(TYPE_IDX) == Structure &&           \
00309                                 ATT_DALIGN_ME(TYP_IDX(TYPE_IDX)))
00310 # endif
00311 
00312 
00313 # define PACK_HALF_WORD_TEST_CONDITION(TYPE_IDX)                               \
00314                                 TARGET_MAX_HALF_WORD_STORAGE_TYPE(TYPE_IDX) || \
00315                                 (TYP_TYPE(TYPE_IDX) == Structure &&            \
00316                                 ATT_ALIGNMENT(TYP_IDX(TYPE_IDX))== Align_32)
00317 
00318 # define PACK_8_BIT_TEST_CONDITION(TYPE_IDX)                                   \
00319                                 (TYP_LINEAR(TYPE_IDX) == Integer_1 ||          \
00320                                  TYP_LINEAR(TYPE_IDX) == Logical_1 ||          \
00321                                 (TYP_TYPE(TYPE_IDX) == Structure &&            \
00322                                 ATT_ALIGNMENT(TYP_IDX(TYPE_IDX)) == Align_8))
00323 
00324 # define PACK_16_BIT_TEST_CONDITION(TYPE_IDX)                                  \
00325                                 (TYP_LINEAR(TYPE_IDX) == Integer_1 ||          \
00326                                  TYP_LINEAR(TYPE_IDX) == Logical_1 ||          \
00327                                  TYP_LINEAR(TYPE_IDX) == Integer_2 ||          \
00328                                  TYP_LINEAR(TYPE_IDX) == Logical_2 ||          \
00329                                 (TYP_TYPE(TYPE_IDX) == Structure &&            \
00330                                 (ATT_ALIGNMENT(TYP_IDX(TYPE_IDX)) == Align_8 ||\
00331                                  ATT_ALIGNMENT(TYP_IDX(TYPE_IDX)) == Align_16)))
00332 
00333 /********************\
00334 |* SIZES AND LIMITS *|
00335 \********************/
00336 
00337 # define DATE_TIME_STR_SIZE     27
00338 # define RELEASE_LEVEL_LEN      24
00339 
00340 
00341 /********************\
00342 |* IO GLOBAL MACROS *|
00343 \********************/
00344 
00345 # define MAX_CONST_OPT_LENGTH           16
00346 # define MAX_CIITEM_NAME_LENGTH         16
00347 # define MAX_NUM_EXP_FORMS              2
00348 # define MAX_NUM_ALLOWED_TYPES          3
00349 # define MAX_NUM_CONST_OPTS             5
00350 # define NUM_IO_STMT_TYPES              8
00351 # define MAX_NUM_CIITEM                 25
00352 
00353 
00354 /**************************************\
00355 |* MACROS TO HOLD LIBRARY ENTRY NAMES *|
00356 |* THIS IS A MACHINE DEPENDENCY.      *|
00357 \**************************************/
00358 
00359 # define ALLOCATE_LIB_ENTRY             "_ALLOCATE"
00360 # define ALLOCATE_NAME_LEN              9
00361 
00362 # if defined(_TARGET_OS_UNICOS)
00363 # define ARGCHCK_LIB_ENTRY              "$ARGCHCK"
00364 # else
00365 # define ARGCHCK_LIB_ENTRY              "_ARGCHCK"
00366 # endif
00367 # define ARGCHCK_NAME_LEN               8
00368 
00369 # define DEALLOCATE_LIB_ENTRY           "_DEALLOCATE"
00370 # define DEALLOCATE_NAME_LEN            11
00371 
00372 /* this is the no error checking DEALLOCATE */
00373 # define DEALLOC_LIB_ENTRY              "_DEALLOC"
00374 # define DEALLOC_NAME_LEN               8
00375 
00376 # define REALLOC_LIB_ENTRY              "_REALLOC"
00377 # define REALLOC_NAME_LEN               8
00378 
00379 # define BACKSPACE_LIB_ENTRY            "_BACK"
00380 # define BACKSPACE_NAME_LEN             5
00381 
00382 # if defined(_TARGET_OS_MAX)
00383 # define END_LIB_ENTRY                  "$END"
00384 # else
00385 # define END_LIB_ENTRY                  "_END"
00386 # endif
00387 # define END_NAME_LEN                   4
00388 
00389 # define ENDFILE_LIB_ENTRY              "_EOFW"
00390 # define ENDFILE_NAME_LEN               5
00391 
00392 # define INQUIRE_LIB_ENTRY              "_INQUIRE"
00393 # define INQUIRE_NAME_LEN               8
00394 
00395 # define OPEN_LIB_ENTRY                 "_OPEN"
00396 # define OPEN_NAME_LEN                  5
00397 
00398 # define CLOSE_LIB_ENTRY                "_CLOSE"
00399 # define CLOSE_NAME_LEN                 6
00400 
00401 # define BUFFER_IN_LIB_ENTRY            "_BUFFERIN"
00402 # define BUFFER_IN_NAME_LEN             9
00403 
00404 # define BUFFER_OUT_LIB_ENTRY           "_BUFFEROUT"
00405 # define BUFFER_OUT_NAME_LEN            10
00406 
00407 # define REWIND_LIB_ENTRY               "_REWF"
00408 # define REWIND_NAME_LEN                5
00409 
00410 # if (defined(_TARGET_OS_IRIX) || defined(_TARGET_OS_LINUX))
00411 # define PAUSE_LIB_ENTRY                "_F90_PAUSE"
00412 # define PAUSE_NAME_LEN                 10
00413 
00414 # define STOP_LIB_ENTRY                 "_F90_STOP"
00415 # define STOP_NAME_LEN                  9
00416 # else
00417 # define PAUSE_LIB_ENTRY                "_PAUSE"
00418 # define PAUSE_NAME_LEN                 6
00419 
00420 # define STOP_LIB_ENTRY                 "_STOP"
00421 # define STOP_NAME_LEN                  5
00422 # endif
00423 
00424 # define STOP_ALL_LIB_ENTRY             "STOP_ALL"
00425 # define STOP_ALL_NAME_LEN              8
00426 
00427 # define CONFORM_LIB_ENTRY              "_CONFORM_ERROR"
00428 # define CONFORM_NAME_LEN               14
00429 
00430 # define BOUNDS_LIB_ENTRY               "_BOUNDS_ERROR"
00431 # define BOUNDS_NAME_LEN                13
00432 
00433 # define RBOUNDS_LIB_ENTRY              "_RBOUNDS_ERROR"
00434 # define RBOUNDS_NAME_LEN               14
00435 
00436 # define SBOUNDS_LIB_ENTRY              "_SBOUNDS_ERROR"
00437 # define SBOUNDS_NAME_LEN               14
00438 
00439 # define PTR_CHK_LIB_ENTRY              "_POINTER_ERROR"
00440 # define PTR_CHK_NAME_LEN               14
00441 
00442 # if defined(_TARGET_OS_UNICOS)
00443 # define START_PES_LIB_ENTRY            "START_PES"
00444 # define START_PES_NAME_LEN             9
00445 # else
00446 # define START_PES_LIB_ENTRY            "start_pes_"
00447 # define START_PES_NAME_LEN             10
00448 # endif
00449 
00450 # define SET_NUMTHREADS_ENTRY           "mp_set_numthreads_"
00451 # define SET_NUMTHREADS_NAME_LEN        18
00452 /* OPND ACCESS */
00453 
00454 # define OPND_LINE_NUM(OPND)            OPND.line_num
00455 # define OPND_COL_NUM(OPND)             OPND.col_num
00456 # define OPND_FLD(OPND)                 OPND.fld
00457 # define OPND_IDX(OPND)                 OPND.idx
00458 # define OPND_LIST_CNT(OPND)            OPND.line_num
00459 
00460 
00461 /*********************************\
00462 |* CMIC WORK DISTRIBUTION VALUES *|
00463 \*********************************/
00464 
00465 # define CMIC_WORK_DIST_SINGLE          1
00466 # define CMIC_WORK_DIST_VECTOR          2
00467 # define CMIC_WORK_DIST_GUIDED          3
00468 # define CMIC_WORK_DIST_NUMCHUNKS       4
00469 # define CMIC_WORK_DIST_CHUNKSIZE       5
00470 # define CMIC_WORK_DIST_NCPUS_CHUNKS    8
00471 
00472 
00473 /******************************************************************************\
00474 |* Values used to signal the compiler exit status to the driver.              *|
00475 \******************************************************************************/
00476 
00477 /* Header file rcodes.h in the IRIX driver uses the following return codes:   */
00478 /* (comment sentinels for each of their definition comments have been         */
00479 /* with parens)                                                               */
00480 /*                                                                            */
00481 /*  #define RC_OKAY                 0    (* executed successfully *)          */
00482 /*  #define RC_INTERNAL_ERROR       1    (* a compiler error *)               */
00483 /*  #define RC_USER_ERROR           2    (* a user error *)                   */
00484 /*  #define RC_NORECOVER_USER_ERROR 4    (* a user error can't recover from *)*/
00485 /*  #define RC_UNIMPLEMENTED_ERROR  8    (* uses an unimplemented feature *)  */
00486 /*  #define RC_NEED_INLINER         16   (* flag that we need the inliner *)  */
00487 /*  #define RC_SYSTEM_ERROR         32   (* a O/S or environment error *)     */
00488 /*  #define RC_OVERFLOW_ERROR       64   (* an overflow error;                */
00489 /*                                          try recompiling *)                */
00490 /*                                                                            */
00491 /* Since the two chief statuses of "internal error" and "user error" are      */
00492 /* exactly the opposite of our status values, we define the following         */
00493 /* #define constants to be used in place of hard-coded values:                */
00494 
00495 # define RC_OKAY                 0    /* Compiler executed successfully.      */
00496 
00497 # if (defined(_HOST_OS_IRIX) || defined(_HOST_OS_LINUX))
00498 
00499 # define RC_INTERNAL_ERROR       1    /* The compiler error terminated.       */
00500 # define RC_USER_ERROR           2    /* The program contains at least one    */
00501                                       /* user error.                          */
00502 
00503 # else
00504 
00505 # define RC_USER_ERROR           1    /* The program contains at least one    */
00506                                       /* user error.                          */
00507 # define RC_INTERNAL_ERROR       2    /* The compiler error terminated.       */
00508 
00509 # endif
00510 
00511 
00512 /***********************************\
00513 |* CONDITIONAL REPLACEMENT STRINGS *|
00514 \***********************************/
00515 
00516 # define EQUAL_STRS(S1,S2)      (strcmp (S1, S2) == IDENTICAL)
00517 
00518 /***********************************************\
00519 |* STATEMENT/FUNCTION-LIKE REPLACEMENT STRINGS *|
00520 \***********************************************/
00521 
00522 /* Create a word aligned, NULL filled identifier or keyword */
00523 /* NOTE:  This cannot take a 0 for LEN */
00524 
00525 # define CREATE_ID(ID, STR, LEN)                                               \
00526         {       int     _idx;                                                  \
00527                 for (_idx = 0; _idx < NUM_ID_WDS; _idx++) {                    \
00528                    ID.words[_idx]       = 0;                                   \
00529                 }                                                              \
00530                 for (_idx = 0; _idx < LEN; _idx++) {                           \
00531                    ID.string[_idx]      = STR[_idx];                           \
00532                 }                                                              \
00533         }
00534 
00535 /* allocate memory and make sure nothing went wrong */
00536 # define MEM_ALLOC(PTR, TYPE, SIZE)                                            \
00537                 PTR = (TYPE *) malloc ((SIZE)*sizeof(TYPE));                   \
00538                 MALLOC_CHECK(0);                                               \
00539                 if (PTR == NULL) {                                             \
00540                    char _struct_name[20];                                      \
00541                    strncpy (_struct_name, #PTR, 20);                           \
00542                    PRINTMSG (stmt_start_line, 14, Limit, 0, _struct_name);     \
00543                 }                                                              \
00544                 MEM_TRACE(Mem_Alloc,PTR,NULL,((SIZE)*(long)sizeof(TYPE)), SIZE)
00545 
00546 
00547 /* free allocated memory */
00548 # define MEM_FREE(PTR)                                                         \
00549         MALLOC_CHECK(0);                                                       \
00550         free (PTR);                                                            \
00551         MEM_TRACE (Mem_Free, PTR, NULL, 0, 0)                                  \
00552         PTR = NULL_IDX;
00553 
00554 # define TBL_FREE(STRUCT)                                                      \
00555         if (STRUCT != NULL) {           /* wasn't previously alloced */        \
00556            MEM_REPORT(STRUCT);                                                 \
00557            CLEAR_LARGEST_IDX(STRUCT);                                          \
00558            MEM_FREE(STRUCT);                                                   \
00559            STRUCT##_idx = 0;                                                   \
00560            STRUCT##_size = 0;                                                  \
00561         }
00562 
00563 
00564 /* reallocate memory and make sure nothing went wrong.                        */
00565 /* 2 copies, so that we can run gcc using -Wall to check the compilation.     */
00566 /* The _optr gets an unused message all over the compiler otherwise.          */
00567 
00568 # ifdef _DEBUG
00569 # define MEM_REALLOC(PTR, TYPE, NEW_SIZE)                                      \
00570         {       void *_optr = PTR;                                             \
00571                 MALLOC_CHECK(0);                                               \
00572                 PTR = (TYPE *) realloc ((char *) PTR, (NEW_SIZE)*sizeof(TYPE));\
00573                 if (PTR == NULL) {                                             \
00574                    char _struct_name[20];                                      \
00575                    strncpy (_struct_name, #PTR, 20);                           \
00576                    PRINTMSG (stmt_start_line, 14, Limit, 0, _struct_name);     \
00577                 }                                                              \
00578                 MEM_TRACE (Mem_Realloc, PTR, _optr,                            \
00579                            ((NEW_SIZE)*(long)sizeof(TYPE)), NEW_SIZE);         \
00580         }
00581 # else
00582 # define MEM_REALLOC(PTR, TYPE, NEW_SIZE)                                      \
00583         {       MALLOC_CHECK(0);                                               \
00584                 PTR = (TYPE *) realloc ((char *) PTR, (NEW_SIZE)*sizeof(TYPE));\
00585                 if (PTR == NULL) {                                             \
00586                    char _struct_name[20];                                      \
00587                    strncpy (_struct_name, #PTR, 20);                           \
00588                    PRINTMSG (stmt_start_line, 14, Limit, 0, _struct_name);     \
00589                 }                                                              \
00590         }
00591 # endif
00592 
00593 
00594 # define CHECK_INITIAL_ALLOC(STRUCT, STRUCT_INIT_IDX)                          \
00595                 if (STRUCT##_size == 0) {       /* wasn't previously alloced */\
00596                    STRUCT##_size = STRUCT##_init_size;                         \
00597                    TBL_ALLOC (STRUCT);                                         \
00598                 }                                                              \
00599                 else if (STRUCT##_size > STRUCT##_init_size){ /* too large */  \
00600                    MEM_REPORT(STRUCT);                                         \
00601                    MEM_FREE(STRUCT);     /*Don't need TBL_FREE's checks.  */   \
00602                    STRUCT##_size = STRUCT##_init_size;                         \
00603                    TBL_ALLOC (STRUCT);                                         \
00604                 }                                                              \
00605                 SET_LARGEST_IDX(STRUCT, NULL_IDX, STRUCT_INIT_IDX);            \
00606                 STRUCT##_idx = STRUCT_INIT_IDX;
00607 
00608 
00609 /* Careful when calling this, because all the tables are zero based, so the   */
00610 /* size one wants, is one bigger than it seems.  WARNING: This macro does not */
00611 /* change STRUCT##_idx.                                                       */
00612 
00613 # define CHECK_TBL_ALLOC_SIZE(STRUCT, STRUCT_NEW_SIZE)                         \
00614                 SET_LARGEST_IDX(STRUCT, STRUCT_NEW_SIZE, STRUCT_NEW_SIZE);     \
00615                 if (STRUCT##_size == 0) {       /* wasn't previously alloced */\
00616                    STRUCT##_size = STRUCT_NEW_SIZE + 1;                        \
00617                    STRUCT##_init_size = STRUCT##_size;                         \
00618                    TBL_ALLOC (STRUCT);                                         \
00619                 }                                                              \
00620                 else if (STRUCT##_size <= STRUCT_NEW_SIZE){ /*not big enough */\
00621                    STRUCT##_size = STRUCT_NEW_SIZE + 1;                        \
00622                    if (STRUCT##_size > STRUCT##_limit) {                       \
00623                       char _struct_name[20];                                   \
00624                       strncpy (_struct_name, #STRUCT, 20);                     \
00625                       PRINTMSG(stmt_start_line, 237, Limit, 0, _struct_name);  \
00626                    }                                                           \
00627                    MEM_REALLOC (STRUCT, STRUCT##_type, STRUCT##_size);         \
00628                 }
00629 
00630 /* NOTE:  These macros normally belong in debug.m but because they are        */
00631 /*        referenced from within this file, they must be defined here         */
00632 
00633 # ifdef _DEBUG
00634 #    define MEM_TRACE(TRACE_TYPE, NPTR, OPTR, BYTE_SIZE, NUM_ENTRIES)          \
00635                 if (dump_flags.mtrace_info) {                                  \
00636                    char _struct_name[20];                                      \
00637                    strncpy (_struct_name, #NPTR, 20);                          \
00638                    dump_mem_trace_info (TRACE_TYPE, _struct_name, NPTR,        \
00639                                         OPTR, BYTE_SIZE, NUM_ENTRIES);         \
00640                 }
00641 # else
00642 #    define MEM_TRACE(ARG1, ARG2, ARG3, ARG4, ARG5)
00643 # endif
00644 
00645 # ifdef _DEBUG
00646 #    define MEM_REPORT(STRUCT)                                                 \
00647                 if (dump_flags.mem_report) {                                   \
00648                    char _struct_name[20];                                      \
00649                    strncpy (_struct_name, #STRUCT, 20);                        \
00650                    print_mem_usage_report(_struct_name,                        \
00651                                          STRUCT##_size,                        \
00652                                          STRUCT##_largest_idx);                \
00653                 }
00654 # else
00655 #    define MEM_REPORT(STRUCT)
00656 # endif
00657 
00658 # ifdef _DEBUG
00659 #    define SET_LARGEST_IDX(STRUCT, CHECK_IDX, NEW_IDX)                        \
00660                 if (STRUCT##_largest_idx < CHECK_IDX) {                        \
00661                    STRUCT##_largest_idx = NEW_IDX;                             \
00662                 }
00663 #    define CLEAR_LARGEST_IDX(STRUCT)                                          \
00664                 STRUCT##_largest_idx = NULL_IDX;
00665 # else
00666 #    define SET_LARGEST_IDX(STRUCT, CHECK_IDX, NEW_IDX)
00667 #    define CLEAR_LARGEST_IDX(STRUCT)
00668 # endif
00669 
00670 # if _DEBUG && ((defined _HOST_OS_UNICOS) || defined(_HOST_OS_MAX))
00671 #    define MALLOC_CHECK(NUM)                                                  \
00672                 if (malloc_check(NUM)) {                                       \
00673                    PRINTMSG (stmt_start_line, 514, Internal, 0);               \
00674                 }
00675 # else
00676 #    define MALLOC_CHECK(NUM)
00677 # endif
00678 
00679 #define NEXT_LA_CH                                                             \
00680                 (*get_char)()
00681 
00682 # define NEXT_LA_CH_LITERAL                                                    \
00683                 (*get_char_literal) ()
00684 
00685 /******************************************************************************\
00686 |* the TBL_ALLOC and TBL_REALLOC_CK macros assume the following declarations  *|
00687 |* associated with PTR:  typedef <type specifier> PTR_type;                   *|
00688 |*                       PTR_type      *PTR;                                  *|
00689 |*                       int            PTR_idx  = NULL_IDX;                  *|
00690 |*                       int            PTR_inc  = <init>;                    *|
00691 |*                       int            PTR_size = <init>;                    *|
00692 \******************************************************************************/
00693 # define TBL_ALLOC(PTR)                                                        \
00694                 MEM_ALLOC (PTR, PTR##_type, PTR##_size);
00695  
00696 # define TBL_REALLOC_CK(PTR, NUM_ENTRIES)                                      \
00697                 PTR##_idx += (NUM_ENTRIES);                                    \
00698                 SET_LARGEST_IDX(PTR, PTR##_idx, PTR##_idx);                    \
00699                 if (PTR##_idx >= PTR##_size) {                                 \
00700                    PTR##_size += (PTR##_inc > (NUM_ENTRIES)) ?                 \
00701                                                 PTR##_inc : (NUM_ENTRIES);     \
00702                    if (PTR##_size > PTR##_limit) {                             \
00703                       char _struct_name[20];                                   \
00704                       strncpy (_struct_name, #PTR, 20);                        \
00705                       PRINTMSG(stmt_start_line, 237, Limit, 0, _struct_name);  \
00706                    }                                                           \
00707                    MEM_REALLOC (PTR, PTR##_type, PTR##_size);                  \
00708                 }
00709 
00710 /* This macro searches the global line table to find the entry for the input  */
00711 /* line.  The global line index is returned in IDX.  The for loop vectorizes. */
00712 
00713 # define GLOBAL_LINE_TO_FILE_LINE(LINE, IDX, ACT_LINE)                         \
00714         for (IDX = 1; IDX <= global_line_tbl_idx; IDX++) {                     \
00715             if (GL_GLOBAL_LINE(IDX) > LINE) {                                  \
00716                break;                                                          \
00717             }                                                                  \
00718         }                                                                      \
00719         IDX--;                                                                 \
00720         ACT_LINE = LINE - GL_GLOBAL_LINE(IDX) + GL_FILE_LINE(IDX);
00721 
00722 # define COPY_OPND(OPND_T, OPND_S)                                             \
00723          OPND_T = OPND_S;
00724 
00725 # define SET_MESSAGE_TBL(TBL, MSG_NUM)                                         \
00726         {int    _shift, _idx;                                                  \
00727                 _idx   = MSG_NUM / HOST_BITS_PER_WORD;                         \
00728                 _shift = HOST_BITS_PER_WORD - ((MSG_NUM%HOST_BITS_PER_WORD)+1);\
00729                 TBL[_idx] |= 1 << _shift;                                      \
00730         }
00731 
00732 # define GET_MESSAGE_TBL(TBL, MSG_NUM)                                         \
00733              (TBL[MSG_NUM/HOST_BITS_PER_WORD] &                                \
00734                   1L << (HOST_BITS_PER_WORD-((MSG_NUM % HOST_BITS_PER_WORD)+1)))
00735 
00736 # if defined(_TARGET32) && !defined(_USE_FOLD_DOT_f)
00737 # define SHIFT_ARITH_ARG(VAR, TYPE)                                            \
00738         if (TYPE == Integer_1 ||                                               \
00739             TYPE == Integer_2 ||                                               \
00740             TYPE == Integer_4 ||                                               \
00741             TYPE == Typeless_1 ||                                              \
00742             TYPE == Typeless_2 ||                                              \
00743             TYPE == Typeless_4 ||                                              \
00744             TYPE == Short_Typeless_Const ||                                    \
00745             TYPE == Short_Char_Const ||                                        \
00746             TYPE == Logical_1 ||                                               \
00747             TYPE == Logical_2 ||                                               \
00748             TYPE == Logical_4 ||                                               \
00749             TYPE == Real_4) {                                                  \
00750            VAR[1] = VAR[0];                                                    \
00751            VAR[0] = 0;                                                         \
00752         }
00753 
00754 # define SHIFT_ARITH_RESULT(VAR, TYPE)                                         \
00755         if (TYPE == Integer_1 ||                                               \
00756             TYPE == Integer_2 ||                                               \
00757             TYPE == Integer_4 ||                                               \
00758             TYPE == Typeless_1 ||                                              \
00759             TYPE == Typeless_2 ||                                              \
00760             TYPE == Typeless_4 ||                                              \
00761             TYPE == Short_Typeless_Const ||                                    \
00762             TYPE == Short_Char_Const ||                                        \
00763             TYPE == Logical_1 ||                                               \
00764             TYPE == Logical_2 ||                                               \
00765             TYPE == Logical_4 ||                                               \
00766             TYPE == Real_4) {                                                  \
00767            VAR[0] = VAR[1];                                                    \
00768         }
00769 
00770 # elif defined(_TARGET_LITTLE_ENDIAN) && defined(_TARGET32)  && defined(_USE_FOLD_DOT_f) 
00771 # define SHIFT_ARITH_ARG(VAR,TYPE)                                             \
00772         if (TYPE == Integer_1 ||                                               \
00773             TYPE == Integer_2 ||                                               \
00774             TYPE == Integer_4 ||                                               \
00775             TYPE == Typeless_1 ||                                              \
00776             TYPE == Typeless_2 ||                                              \
00777             TYPE == Typeless_4 ||                                              \
00778             TYPE == Short_Typeless_Const ||                                    \
00779             TYPE == Short_Char_Const ||                                        \
00780             TYPE == Logical_1 ||                                               \
00781             TYPE == Logical_2 ||                                               \
00782             TYPE == Logical_4 ||                                               \
00783             TYPE == Real_4){                                                   \
00784            VAR[1] = 0;                                                         \
00785         }
00786 # define SHIFT_ARITH_RESULT(VAR, TYPE)
00787 # else
00788 
00789 /* these are blank since on _TARGET64, 32 bit things are not packed */
00790 /* when they are there will be problems in input, fold and output   */
00791 /* of constants. BHJ                                                */
00792 
00793 # define SHIFT_ARITH_ARG(VAR, TYPE)
00794 
00795 # define SHIFT_ARITH_RESULT(VAR, TYPE)
00796 # endif
00797 
00798 /********************************************************************\
00799 |* The following macro is used to make sure that compiler temps are *|
00800 |* the shared list if they are referenced inside a parallel region. *|
00801 \********************************************************************/
00802 
00803 # define ADD_TMP_TO_SHARED_LIST(ATTR_IDX)                                      \
00804    if (cdir_switches.parallel_region &&                                        \
00805        cdir_switches.shared_list_idx != NULL_IDX &&                            \
00806        comp_phase == Pass2_Semantics &&                                        \
00807        AT_OBJ_CLASS(ATTR_IDX) == Data_Obj &&                                   \
00808        ATD_CLASS(ATTR_IDX) == Compiler_Tmp &&                                  \
00809        ! ATD_TASK_PRIVATE(ATTR_IDX) &&                                         \
00810        ! ATD_TASK_SHARED(ATTR_IDX)) {                                          \
00811       int       _list_idx;                                                     \
00812       NTR_IR_LIST_TBL(_list_idx);                                              \
00813       IL_NEXT_LIST_IDX(_list_idx) = IL_IDX(cdir_switches.shared_list_idx);     \
00814       if (IL_IDX(cdir_switches.shared_list_idx) != NULL_IDX) {                 \
00815          IL_PREV_LIST_IDX(IL_IDX(cdir_switches.shared_list_idx)) = _list_idx;  \
00816       }                                                                        \
00817       IL_IDX(cdir_switches.shared_list_idx) = _list_idx;                       \
00818       IL_FLD(cdir_switches.shared_list_idx) = IL_Tbl_Idx;                      \
00819       IL_LIST_CNT(cdir_switches.shared_list_idx)++;                            \
00820       IL_FLD(_list_idx) = AT_Tbl_Idx;                                          \
00821       IL_IDX(_list_idx) = ATTR_IDX;                                            \
00822       ATD_TASK_SHARED(ATTR_IDX) = TRUE;                                        \
00823    }
00824 
00825 # define ADD_TMP_TO_PRIVATE_LIST(ATTR_IDX)                                     \
00826    if (cdir_switches.parallel_region &&                                        \
00827        cdir_switches.private_list_idx != NULL_IDX &&                           \
00828        comp_phase == Pass2_Semantics &&                                        \
00829        AT_OBJ_CLASS(ATTR_IDX) == Data_Obj &&                                   \
00830        ATD_CLASS(ATTR_IDX) == Compiler_Tmp &&                                  \
00831        ! ATD_TASK_PRIVATE(ATTR_IDX) &&                                         \
00832        ! ATD_TASK_SHARED(ATTR_IDX)) {                                          \
00833       int       _list_idx;                                                     \
00834       NTR_IR_LIST_TBL(_list_idx);                                              \
00835       IL_NEXT_LIST_IDX(_list_idx) = IL_IDX(cdir_switches.private_list_idx);    \
00836       if (IL_IDX(cdir_switches.private_list_idx) != NULL_IDX) {                \
00837          IL_PREV_LIST_IDX(IL_IDX(cdir_switches.private_list_idx)) = _list_idx; \
00838       }                                                                        \
00839       IL_IDX(cdir_switches.private_list_idx) = _list_idx;                      \
00840       IL_FLD(cdir_switches.private_list_idx) = IL_Tbl_Idx;                     \
00841       IL_LIST_CNT(cdir_switches.private_list_idx)++;                           \
00842       IL_FLD(_list_idx) = AT_Tbl_Idx;                                          \
00843       IL_IDX(_list_idx) = ATTR_IDX;                                            \
00844       ATD_TASK_PRIVATE(ATTR_IDX) = TRUE;                                       \
00845    }
00846 
00847 # define ADD_VAR_TO_SHARED_LIST(ATTR_IDX)                                      \
00848    if (cdir_switches.parallel_region &&                                        \
00849        comp_phase == Pass2_Semantics &&                                        \
00850        cdir_switches.shared_list_idx != NULL_IDX &&                            \
00851        AT_OBJ_CLASS(ATTR_IDX) == Data_Obj &&                                   \
00852        ! ATD_TASK_PRIVATE(ATTR_IDX) &&                                         \
00853        ! ATD_TASK_SHARED(ATTR_IDX)) {                                          \
00854       int       _list_idx;                                                     \
00855       NTR_IR_LIST_TBL(_list_idx);                                              \
00856       IL_NEXT_LIST_IDX(_list_idx) = IL_IDX(cdir_switches.shared_list_idx);     \
00857       if (IL_IDX(cdir_switches.shared_list_idx) != NULL_IDX) {                 \
00858          IL_PREV_LIST_IDX(IL_IDX(cdir_switches.shared_list_idx)) = _list_idx;  \
00859       }                                                                        \
00860       IL_IDX(cdir_switches.shared_list_idx) = _list_idx;                       \
00861       IL_FLD(cdir_switches.shared_list_idx) = IL_Tbl_Idx;                      \
00862       IL_LIST_CNT(cdir_switches.shared_list_idx)++;                            \
00863       IL_FLD(_list_idx) = AT_Tbl_Idx;                                          \
00864       IL_IDX(_list_idx) = ATTR_IDX;                                            \
00865       ATD_TASK_SHARED(ATTR_IDX) = TRUE;                                        \
00866       ATD_WAS_SCOPED(ATTR_IDX) = TRUE;                                         \
00867    }
00868 
00869 # define ADD_VAR_TO_PRIVATE_LIST(ATTR_IDX)                                     \
00870    if (cdir_switches.parallel_region &&                                        \
00871        cdir_switches.private_list_idx != NULL_IDX &&                           \
00872        comp_phase == Pass2_Semantics &&                                        \
00873        AT_OBJ_CLASS(ATTR_IDX) == Data_Obj &&                                   \
00874        ! ATD_TASK_PRIVATE(ATTR_IDX) &&                                         \
00875        ! ATD_TASK_SHARED(ATTR_IDX)) {                                          \
00876       int       _list_idx;                                                     \
00877       NTR_IR_LIST_TBL(_list_idx);                                              \
00878       IL_NEXT_LIST_IDX(_list_idx) = IL_IDX(cdir_switches.private_list_idx);    \
00879       if (IL_IDX(cdir_switches.private_list_idx) != NULL_IDX) {                \
00880          IL_PREV_LIST_IDX(IL_IDX(cdir_switches.private_list_idx)) = _list_idx; \
00881       }                                                                        \
00882       IL_IDX(cdir_switches.private_list_idx) = _list_idx;                      \
00883       IL_FLD(cdir_switches.private_list_idx) = IL_Tbl_Idx;                     \
00884       IL_LIST_CNT(cdir_switches.private_list_idx)++;                           \
00885       IL_FLD(_list_idx) = AT_Tbl_Idx;                                          \
00886       IL_IDX(_list_idx) = ATTR_IDX;                                            \
00887       ATD_TASK_PRIVATE(ATTR_IDX) = TRUE;                                       \
00888       ATD_WAS_SCOPED(ATTR_IDX) = TRUE;                                         \
00889    }
00890 
00891 # define GEN_MAX_ZERO_IR(MAX_IDX, THE_OPND, LINE, COL)                         \
00892         { int   _list_idx;                                                     \
00893          NTR_IR_TBL(MAX_IDX);                                                  \
00894          IR_OPR(MAX_IDX) = Max_Opr;                                            \
00895          IR_TYPE_IDX(MAX_IDX) = CG_INTEGER_DEFAULT_TYPE;                       \
00896          IR_LINE_NUM(MAX_IDX) = LINE;                                          \
00897          IR_COL_NUM(MAX_IDX)  = COL;                                           \
00898          NTR_IR_LIST_TBL(_list_idx);                                           \
00899          IR_FLD_L(MAX_IDX) = IL_Tbl_Idx;                                       \
00900          IR_LIST_CNT_L(MAX_IDX) = 2;                                           \
00901          IR_IDX_L(MAX_IDX) = _list_idx;                                        \
00902          IL_FLD(_list_idx) = CN_Tbl_Idx;                                       \
00903          IL_IDX(_list_idx) = CN_INTEGER_ZERO_IDX;                              \
00904          IL_LINE_NUM(_list_idx) = LINE;                                        \
00905          IL_COL_NUM(_list_idx)  = COL;                                         \
00906          NTR_IR_LIST_TBL(IL_NEXT_LIST_IDX(_list_idx));                         \
00907          IL_PREV_LIST_IDX(IL_NEXT_LIST_IDX(_list_idx)) = _list_idx;            \
00908          _list_idx = IL_NEXT_LIST_IDX(_list_idx);                              \
00909          COPY_OPND(IL_OPND(_list_idx), (THE_OPND));                            \
00910          IL_LINE_NUM(_list_idx) = LINE;                                        \
00911          IL_COL_NUM(_list_idx) = COL;                                          \
00912         }
00913 
00914 
00915 # define FUNCTION_MUST_BE_SUBROUTINE(ATTR_IDX)                                 \
00916    (TYP_TYPE(ATD_TYPE_IDX(ATTR_IDX)) == Character     ||                       \
00917     TYP_TYPE(ATD_TYPE_IDX(ATTR_IDX)) == Structure     ||                       \
00918     ATD_ARRAY_IDX(ATTR_IDX) != NULL_IDX ||                                     \
00919     ATD_IM_A_DOPE(ATTR_IDX))
00920 
00921 
00922 /***********************************************\
00923 |* Reference macros for the Stmt_Expansion_Opr *|
00924 \***********************************************/
00925 
00926 # define STMT_EXPAND_BEFORE_START_SH(IDX)                                      \
00927          IL_IDX(IR_IDX_R(IDX))
00928 
00929 # define STMT_EXPAND_BEFORE_END_SH(IDX)                                        \
00930          IL_IDX(IL_NEXT_LIST_IDX(IR_IDX_R(IDX)))
00931 
00932 # define STMT_EXPAND_AFTER_START_SH(IDX)                                       \
00933          IL_IDX(IL_NEXT_LIST_IDX(IL_NEXT_LIST_IDX(IR_IDX_R(IDX))))
00934 
00935 # define STMT_EXPAND_AFTER_END_SH(IDX)                                         \
00936   IL_IDX(IL_NEXT_LIST_IDX(IL_NEXT_LIST_IDX(IL_NEXT_LIST_IDX(IR_IDX_R(IDX)))))
00937 
00938 # define PUSH_CURR_STMT                                                        \
00939    { int _list_idx;                                                            \
00940       NTR_IR_LIST_TBL(_list_idx);                                              \
00941       IL_FLD(_list_idx) = SH_Tbl_Idx;                                          \
00942       IL_IDX(_list_idx) = curr_stmt_sh_idx;                                    \
00943       if (curr_stmt_stk_il_idx == NULL_IDX) {                                  \
00944          curr_stmt_stk_il_idx = _list_idx;                                     \
00945       } else {                                                                 \
00946          IL_NEXT_LIST_IDX(_list_idx) = curr_stmt_stk_il_idx;                   \
00947          curr_stmt_stk_il_idx = _list_idx;                                     \
00948       }                                                                        \
00949    }
00950 
00951 # define POP_CURR_STMT                                                         \
00952    if (curr_stmt_stk_il_idx) { int _save_list_idx;                             \
00953       curr_stmt_sh_idx = IL_IDX(curr_stmt_stk_il_idx);                         \
00954       _save_list_idx = curr_stmt_stk_il_idx;                                   \
00955       curr_stmt_stk_il_idx = IL_NEXT_LIST_IDX(curr_stmt_stk_il_idx);           \
00956       FREE_IR_LIST_NODE(_save_list_idx);                                       \
00957    }
00958 
00959 /***************************************************\
00960 |* Macro to increment the globals statement_number *|
00961 \***************************************************/
00962 
00963 # define INCREMENT_STATEMENT_NUMBER                                            \
00964         prev_statement_number++;                                               \
00965         statement_number = prev_statement_number;
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines