Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
module.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/module.m        5.5     09/21/99 15:54:23\n" */
00037 
00038 /* When we no longer support release 1.0 on any platform, we can throw out */
00039 /* version 1 and 2 stuff.  When we no longer support 2.0 on any platform   */
00040 /* we can throw out version 3 stuff.                                       */
00041 
00042 /* 3.0 is released at version 11 - Also 7.2 */
00043 /* 7.2+ is released at version 13 */
00044 /* 3.1 is released at version 14  */
00045 /* 3.2 is released at version 15 -  Also 7.3 */
00046 /* 3.3 is released at version 15 */
00047 
00048 /* 3.4 and 7.4 should be released at version 16 or later */
00049 
00050 # define MD_CURRENT_VERSION             16
00051 # define MD_LAST_1_0_VERSION            3
00052 # define MD_LAST_2_0_VERSION            7
00053 # define MD_LAST_3_0_VERSION            14  /* 3.0 starts at 11 */
00054 # define MD_LAST_4_0_VERSION            15  /* 4.0 starts at 15 */
00055 # define MD_LAST_5_0_VERSION            16  /* 5.0 starts at 16 */
00056 
00057 # define MD_PDT_HEADER_BYTE_SIZE        sizeof(pdt_tbl_hdr_type)
00058 # define MD_TBL_BYTE_SIZE               sizeof(mit_header_type)
00059 # define MD_TBL_SIZE                    MD_TBL_BYTE_SIZE/TARGET_BYTES_PER_WORD
00060 # define MD_DIRECTORY_BYTE_SIZE         sizeof(mit_descriptor_type)
00061 
00062 # if defined(_HOST32)
00063 #    define MD_AFTER_PDT                (&mit_header.wd[2])
00064 # else
00065 #    define MD_AFTER_PDT                (&mit_header.wd[1])
00066 # endif
00067 
00068 # define OLD_MD_ALTERNATE_ENTRY         mit_header.old_tbl.alternate_entry
00069 # define OLD_MD_NAME_LEN                mit_header.old_tbl.name_length
00070 
00071 # define MD_ALTERNATE_ENTRY             mit_header.tbl.alternate_entry
00072 # define MD_CF77TYPES                   mit_header.tbl.cf77types
00073 # define MD_DALIGN                      mit_header.tbl.dalign
00074 # define MD_DEFAULT_INTEGER_TYPE        mit_header.tbl.default_integer
00075 # define MD_DEFAULT32                   mit_header.tbl.default32
00076 # define MD_DEFAULT64                   mit_header.tbl.default64
00077 # define MD_ENABLE_DOUBLE_PRECISION     mit_header.tbl.dp_hit_me
00078 # define MD_FLOAT64                     mit_header.tbl.float64
00079 # define MD_HAS_ERRORS                  mit_header.tbl.mod_has_errors
00080 # define MD_MODULE                      mit_header.tbl.module
00081 # define MD_NAME_LEN                    mit_header.tbl.name_length
00082 # define MD_NEW_CONST_TBL               mit_header.tbl.new_cn_tbl
00083 # define MD_POINTER8                    mit_header.tbl.pointer8
00084 # define MD_TARGET                      mit_header.tbl.target
00085 # define MD_VERSION_NUM                 mit_header.tbl.version_num
00086 
00087 # define MD_PDT_HDR_TYPE                mit_header.tbl.hdr.hdr_type
00088 # define MD_PDT_HDR_LEN                 mit_header.tbl.hdr.hdr_len
00089 # define MD_NAME_PTR                    &mit_header.tbl.name_char[0]
00090 
00091 # if defined(_HOST32)
00092 #   define MD_NAME_LONG                 (&mit_header.wd[4])
00093 # else
00094 #   define MD_NAME_LONG                 (&mit_header.wd[2])
00095 # endif
00096 
00097 # define MD_TBL_TYPE(IDX)               mit_descriptor[IDX].fld.tbl_type
00098 # define MD_NUM_ENTRIES(IDX)            mit_descriptor[IDX].fld.num_entries
00099 
00100 
00101 # define OUTPUT_TBL_TO_MODULE(FILE, MOD_ATTR_IDX, TBL)                         \
00102          {int   _num_objs;                                                     \
00103           if (TBL##_idx > NULL_IDX) {                                          \
00104              _num_objs  = fwrite(&TBL[1],                                      \
00105                                  sizeof(TBL##_type),                           \
00106                                  TBL##_idx,                                    \
00107                                  FILE);                                        \
00108              if (_num_objs != TBL##_idx) {                                     \
00109                 PRINTMSG(AT_DEF_LINE(MOD_ATTR_IDX), 726, Error,                \
00110                          AT_DEF_COLUMN(MOD_ATTR_IDX),                          \
00111                          AT_OBJ_NAME_PTR(MOD_ATTR_IDX));                       \
00112              }                                                                 \
00113            }                                                                   \
00114          }
00115 
00116 # define FSEEK(FILE_PTR, OFFSET, ORIGIN)                                       \
00117         ((fseek(FILE_PTR, OFFSET, ORIGIN) == 0) &&                             \
00118          (ftell(FILE_PTR) <= mod_file_end_offset))
00119 
00120 # define KEEP_ATTR(AT_IDX)                                                     \
00121          if (!ML_AT_KEEP_ME(AT_IDX))    set_mod_link_tbl_for_attr(AT_IDX)
00122 
00123 # define KEEP_CN(CN_IDX)                                                       \
00124          if (!ML_CN_KEEP_ME(CN_IDX))    set_mod_link_tbl_for_cn(CN_IDX)
00125 
00126 # define KEEP_IR(IR_IDX)                                                       \
00127          if (!ML_IR_KEEP_ME(IR_IDX))    set_mod_link_tbl_for_ir(IR_IDX)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines