Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
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 /* USMID: "\n@(#)3.0_pl/headers/mif_cif.h 3.2 12/20/96 16:58:53\n" */ 00038 00039 00040 # include <stdio.h> 00041 00042 00043 # define EOI '\036' /* End_Of_Item (^) */ 00044 # define EOR '\n' /* End_Of_Record */ 00045 00046 00047 /* CIF record [2]. */ 00048 00049 extern void Cif_Cifhdr_Rec(FILE *, /* Compiler Information File. */ 00050 int, /* Language code. */ 00051 char *, /* Compiler version. */ 00052 char *, /* Date of CIF creation in */ 00053 /* mm/dd/yy form. */ 00054 char *, /* Time of CIF creation in */ 00055 /* hh:mm:ss form. */ 00056 char *, /* Group id. */ 00057 int, /* Message catalog file id. */ 00058 char *, /* Host CPU name; for */ 00059 /* example, "hot". */ 00060 char *); /* Host CPU type; for */ 00061 /* example, "CRAY-C90". */ 00062 00063 00064 /* CDIR$ record [5]. */ 00065 00066 extern void Cif_Cdir_Rec(FILE *, /* Compiler Information File. */ 00067 int, /* Directive type. */ 00068 int, /* File id. */ 00069 int, /* File line number. */ 00070 int, /* Column number. */ 00071 int, /* Number of COPY variables. */ 00072 /* (for END MASTER only) */ 00073 long *); /* An array of COPY variable */ 00074 /* symbol ids. */ 00075 00076 00077 /* File Name record [7]. */ 00078 00079 extern void Cif_File_Rec(FILE *, /* Compiler Information File. */ 00080 char *, /* Fully expanded file name. */ 00081 int, /* File id. */ 00082 char *); /* User-specified file name. */ 00083 00084 00085 /* INCLUDE record [9]. */ 00086 00087 extern void Cif_Include_Rec(FILE *, /* Compiler Information File. */ 00088 int, /* Parent file id. */ 00089 int, /* Current file line number. */ 00090 int, /* Column number. */ 00091 int); /* INCLUDE file id. */ 00092 00093 00094 /* Message record [11]. */ 00095 00096 extern void Cif_Message_Rec(FILE *, /* Compiler Information File. */ 00097 int, /* Message severity. */ 00098 int, /* Message number. */ 00099 int, /* File id. */ 00100 int, /* Global line number. */ 00101 int, /* Column number. */ 00102 int, /* File line number. */ 00103 int, /* Number of message inserts. */ 00104 char **, /* An array of message */ 00105 /* inserts (strings). */ 00106 char *, /* Procedure name. */ 00107 int, /* Relative message order. */ 00108 int, /* Flags. */ 00109 int); /* Physical file id. */ 00110 00111 00112 /* Source File record [14]. */ 00113 00114 extern void Cif_Srcfile_Rec(FILE *, /* Compiler Information File. */ 00115 int, /* File id. */ 00116 int); /* Source form. */ 00117 /* (0 = fixed; 1 = free) */ 00118 00119 00120 /* Summary record [15]. */ 00121 00122 extern void Cif_Summary_Rec(FILE *, /* Compiler Information File. */ 00123 char *, /* Compiler release level. */ 00124 char *, /* Compiler generation date. */ 00125 char *, /* Compiler generation time. */ 00126 char *, /* Compilation time in the */ 00127 /* form hh:mm:ss.zzz */ 00128 long, /* Max field length. */ 00129 int, /* Total number of source */ 00130 /* lines compiled. */ 00131 int, /* Code size. */ 00132 int); /* Data size. */ 00133 00134 /* QUESTION: Does Max field length need to be a long? Should code size */ 00135 /* and data sizes also be longs? */ 00136 00137 00138 /* DOSHARED CDIR$ record [16]. */ 00139 00140 extern void Cif_Doshared_Cdir_Rec(FILE *, /* Compiler Information File. */ 00141 int, /* Doshared type. */ 00142 int, /* Random. */ 00143 int, /* File id. */ 00144 int, /* File line number. */ 00145 int, /* Column number. */ 00146 char *, /* M value. */ 00147 int, /* M file id. */ 00148 int, /* M file line number. */ 00149 int, /* M column number. */ 00150 int, /* Number of control vars. */ 00151 long *); /* An array of control */ 00152 /* variable symbol ids. */ 00153 00154 /* Note: This record is not yet output by CF90 and may have a different */ 00155 /* form depending on what happens to CRAFT. */ 00156 00157 00158 /* Unit record [17]. */ 00159 00160 extern void Cif_Unit_Rec(FILE *, /* Compiler Information File. */ 00161 char *, /* Compilation unit name. */ 00162 int, /* File id. */ 00163 int, /* File line number. */ 00164 int); /* Column number. */ 00165 00166 00167 /* End Unit record [18]. */ 00168 00169 extern void Cif_Endunit_Rec(FILE *, /* Compiler Information File. */ 00170 char *, /* Compilation unit name. */ 00171 int, /* File id. */ 00172 int, /* File line number. */ 00173 int); /* Column number. */ 00174 00175 00176 /* Usage record [19]. */ 00177 00178 extern void Cif_Usage_Rec(FILE *, /* Compiler Information File. */ 00179 int, /* Symbol id. */ 00180 int, /* File id. */ 00181 int, /* File line number. */ 00182 int, /* Column number. */ 00183 int, /* Usage code. */ 00184 int, /* Number of other symbol ids.*/ 00185 long *); /* An array of component */ 00186 /* symbol ids. */ 00187 00188 00189 /* Enable/Disable Options record [21]. */ 00190 00191 extern void Cif_EDopts_Rec(FILE *, /* Compiler Information File. */ 00192 int); /* Word with bit flags set. */ 00193 00194 00195 /* Machine Characteristics record [22]. */ 00196 00197 extern void Cif_Mach_Char_Rec(FILE *, /* Compiler Information File. */ 00198 char *, /* CPU type. */ 00199 long, /* Memory speed. */ 00200 long, /* Memory size. */ 00201 int, /* Characteristics (bit flags)*/ 00202 long, /* Number of memory banks. */ 00203 long, /* Number of CPUs. */ 00204 long, /* Instruction buffer size. */ 00205 long, /* Clock period. */ 00206 long, /* Num cluster reg sets. */ 00207 long, /* Bank busy time. */ 00208 int); /* Word bit length. */ 00209 00210 /* Note: Most of these fields are meaningful only for PVP machines. */ 00211 /* See the libcif or Fortran CIF documentation for the fields that */ 00212 /* are expected to contain values for other machines such as MPPs */ 00213 /* and SPARCs. */ 00214 00215 00216 /* Statement Type record [25]. */ 00217 00218 extern void Cif_Stmt_Type_Rec(FILE *, /* Compiler Information File. */ 00219 int, /* Statement type. */ 00220 int, /* File id. */ 00221 int, /* File line number. */ 00222 int, /* Column number. */ 00223 int); /* Statement number. */ 00224 00225 00226 /* MPP Geometry record [26]. */ 00227 00228 /* Note: This record is not yet output by CF90 and may have a different */ 00229 /* form depending on what happens to CRAFT. */ 00230 /* */ 00231 /* It will also need a declaration of the following type because a */ 00232 /* number of these can be passed: */ 00233 00234 struct Cif_geometry_dim_entry 00235 { 00236 int distribution; /* Dimension distribution. */ 00237 char *weight; /* Weight. */ 00238 int weight_file_id; /* Weight file id. */ 00239 int weight_line_number; 00240 /* Weight file line number. */ 00241 int weight_column_number; 00242 /* Weight column number. */ 00243 char *block_size; /* Block size. */ 00244 int block_size_file_id; 00245 /* Block size file id. */ 00246 int block_size_line_number; 00247 /* Block size file line num. */ 00248 int block_size_column_number; 00249 /* Block size column number. */ 00250 }; 00251 00252 typedef struct Cif_geometry_dim_entry Cif_geometry_dim; 00253 00254 00255 extern void Cif_Mpp_Geometry_Rec(FILE *, /* Compiler Information File. */ 00256 char *, /* Geometry name. */ 00257 int, /* Geometry symbol id. */ 00258 int, /* Number of dimensions. */ 00259 Cif_geometry_dim *); 00260 /* An array of geometry */ 00261 /* dimension structures. */ 00262 00263 00264 00265 /* Continuation Line record [27]. */ 00266 00267 extern void Cif_Continuation_Rec(FILE *, /* Compiler Information File. */ 00268 int, /* Continuation type. */ 00269 int, /* File id. */ 00270 int, /* File line number. */ 00271 int); /* Column number. */ 00272 00273 /* Note: The front-end does not seem to be producing these yet. */ 00274 00275 00276 /* Call Site record [28]. */ 00277 00278 extern void Cif_F90_Callsite_Rec(FILE *, /* Compiler Information File. */ 00279 int, /* Symbol id. */ 00280 int, /* Scope id. */ 00281 int, /* File id. */ 00282 int, /* File line number. */ 00283 int, /* Column number. */ 00284 int, /* Specific proc symbol id. */ 00285 int, /* Max number of actual args. */ 00286 char **, /* An array of actual arg */ 00287 /* symbol ids. */ 00288 int *); /* An array of actual arg */ 00289 /* ranks. */ 00290 00291 00292 /* See the Fortran CIF documentation for why the symbol id in this */ 00293 /* case must be a character string (see "arg symbol id" description). */ 00294 00295 00296 /* Common Block record [29]. */ 00297 00298 extern void Cif_F90_Comblk_Rec(FILE *, /* Compiler Information File. */ 00299 char *, /* Common block name. */ 00300 int, /* Symbol id. */ 00301 int, /* Scope id. */ 00302 int, /* Storage class. */ 00303 int, /* Module symbol id. */ 00304 int, /* Byte length of common blk. */ 00305 int); /* Distribution. */ 00306 00307 00308 /* Named Constant record [30]. */ 00309 00310 extern void Cif_F90_Const_Rec(FILE *, /* Compiler Information File. */ 00311 int, /* Symbol id. */ 00312 int, /* Scope id. */ 00313 int, /* Scalar/Aggregate. */ 00314 char *, /* Value. */ 00315 int, /* File id. */ 00316 int, /* File line number (start). */ 00317 int, /* Column number (start). */ 00318 int, /* File line number (end). */ 00319 int); /* Column number (end). */ 00320 00321 00322 /* Entry Point record [31]. */ 00323 00324 extern void Cif_F90_Entry_Rec(FILE *, /* Compiler Information File. */ 00325 char *, /* Entry point name. */ 00326 int, /* Entry point symbol id. */ 00327 int, /* Scope id. */ 00328 int, /* Program unit type. */ 00329 int, /* Procedure type. */ 00330 int, /* A word containing bit */ 00331 /* flags (attributes). */ 00332 int, /* Result symbol id (if */ 00333 /* function). */ 00334 int, /* Module symbol id (if entry */ 00335 /* point is a module proc). */ 00336 int, /* Number of dummy arguments. */ 00337 /* (only in definition form */ 00338 /* of this record). */ 00339 long *); /* Array of dummy argument */ 00340 /* symbol ids. */ 00341 00342 00343 /* Loop Definition record [32]. */ 00344 00345 extern void Cif_F90_Loop_Rec(FILE *, /* Compiler Information File. */ 00346 int, /* Scope id. */ 00347 int, /* Loop type. */ 00348 int, /* Start file id. */ 00349 int, /* Start line number. */ 00350 int, /* Start column number. */ 00351 int, /* End file id. */ 00352 int, /* End line number. */ 00353 int, /* End column number. */ 00354 int, /* DO-variable symbol id. */ 00355 int, /* Loop term. label symbol id.*/ 00356 int, /* Construct name symbol id. */ 00357 int); /* Loop end stmt number. */ 00358 00359 00360 /* Derived Type record [33]. */ 00361 00362 extern void Cif_F90_Derived_Type_Rec(FILE *, /* Compiler Information File. */ 00363 char *, /* Derived type name. */ 00364 int, /* Symbol id. */ 00365 int, /* Scope id. */ 00366 int, /* Derived type id. */ 00367 int, /* Attribute flags. */ 00368 int, /* Number of components. */ 00369 long *, /* Array of component symbol */ 00370 /* ids. */ 00371 int); /* Symbol id of the module in */ 00372 /* which the derived type is */ 00373 /* defined; 0 otherwise. */ 00374 00375 00376 /* Label record [34]. */ 00377 00378 extern void Cif_F90_Label_Rec(FILE *, /* Compiler Information File. */ 00379 char *, /* Statement label or */ 00380 /* construct name. */ 00381 int, /* Symbol id. */ 00382 int, /* Scope id. */ 00383 int); /* Label type. */ 00384 00385 00386 /* Namelist record [35]. */ 00387 00388 extern void Cif_F90_Namelist_Rec(FILE *, /* Compiler Information File. */ 00389 char *, /* Namelist group name. */ 00390 int, /* Symbol id. */ 00391 int, /* Scope id. */ 00392 int, /* Module symbol id (if the */ 00393 /* namelist group is defined */ 00394 /* in a module). */ 00395 int, /* Number of group members. */ 00396 long *); /* An array of member symbol */ 00397 /* ids. */ 00398 00399 00400 /* Object record [36]. */ 00401 00402 /* Note: The Distribution and Geometry Id fields are not currently being */ 00403 /* output by the front-end. These fields may change depending on */ 00404 /* the final CRAFT design. */ 00405 00406 /* The bound information must be in character form because a bound can be an */ 00407 /* expression which is represented by the character "E". */ 00408 00409 struct Cif_f90_dim_entry { char *lower_bound; 00410 char *upper_bound; 00411 }; 00412 00413 typedef struct Cif_f90_dim_entry Cif_f90_dim; 00414 00415 00416 extern void Cif_F90_Object_Rec 00417 (FILE *, /* Compiler Information File. */ 00418 char *, /* Object name. */ 00419 int, /* Symbol id. */ 00420 int, /* Scope id. */ 00421 int, /* Data type. */ 00422 int, /* Symbol class. */ 00423 int, /* Storage class. */ 00424 int, /* Storage symbol id. */ 00425 int, /* Offset. */ 00426 int, /* Attribute flags. */ 00427 int, /* Derived type id (if object */ 00428 /* is a component). */ 00429 char *, /* Character length (if object */ 00430 /* is of type char). */ 00431 int, /* Number of dimensions (0 if */ 00432 /* object is scalar). */ 00433 int, /* Array type (only if object */ 00434 /* is an array). */ 00435 Cif_f90_dim *, /* An array of bound info */ 00436 /* structures. */ 00437 int, /* Distribution (only if object */ 00438 /* is an array). */ 00439 int, /* Geometry id (only if object */ 00440 /* is an array). */ 00441 int); /* Pointer symbol id (only if */ 00442 /* object is a CRI pointee). */ 00443 00444 00445 /* Miscellaneous Compiler Options record [37]. */ 00446 00447 extern void Cif_F90_Misc_Opts_Rec 00448 (FILE *, /* Compiler Information File. */ 00449 int, /* -i option (integer length) */ 00450 /* representation. */ 00451 int, /* -m option (message level). */ 00452 int, /* -V option (compilation */ 00453 /* info) enabled/disabled. */ 00454 int, /* -t option (truncation) */ 00455 /* enabled/disabled. */ 00456 int, /* -t option (truncation) */ 00457 /* value. */ 00458 int, /* Number of message numbers */ 00459 /* that are disabled. */ 00460 long *, /* An array of disabled */ 00461 /* message numbers. */ 00462 int, /* Number of CDIR$s/CMIC$s */ 00463 /* that are disabled. */ 00464 char **, /* An array of CDIR$/CMIC$ */ 00465 /* names that are disabled. */ 00466 char *, /* File name of the .o being */ 00467 /* produced. */ 00468 char *, /* -S option: (CAL) file name.*/ 00469 char *, /* Inline file name. */ 00470 char *, /* Compiler Information File */ 00471 /* name. */ 00472 int, /* -C option mask (bit flags).*/ 00473 int, /* -N option value. */ 00474 int, /* Number of -I options. */ 00475 char **, /* Array of -I path names. */ 00476 int, /* Number of -p options. */ 00477 char **, /* Array of -p path names. */ 00478 int, /* Source form flag. */ 00479 int); /* Run-time option mask (bit */ 00480 /* flags). */ 00481 00482 /* Note: Since we've added many new options, surely this record */ 00483 /* will need to be expanded. */ 00484 00485 00486 /* Optimization Options record [38]. */ 00487 00488 00489 struct Cif_f90_level_opt_entry { 00490 int option; /* Option flag. */ 00491 int level; /* The optimization level. */ 00492 }; 00493 00494 typedef struct Cif_f90_level_opt_entry Cif_f90_level_opt; 00495 00496 00497 extern void Cif_F90_Opt_Opts_Rec 00498 (FILE *, /* Compiler Information File. */ 00499 int, /* Optimization options mask */ 00500 /* (bit flags). */ 00501 int, /* Number of level fields. */ 00502 Cif_f90_level_opt *); /* An array of optimization */ 00503 /* level structures. */ 00504 00505 00506 /* Begin Scope record [39]. */ 00507 00508 extern void Cif_F90_Begin_Scope_Rec(FILE *, /* Compiler Information File. */ 00509 int, /* Scope id. */ 00510 int, /* Symbol id. */ 00511 int, /* File id. */ 00512 int, /* File line number. */ 00513 int, /* Column number. */ 00514 int, /* Scope type. */ 00515 int, /* Nesting level. */ 00516 int); /* Parent scope id. */ 00517 00518 00519 /* End Scope record [40]. */ 00520 00521 extern void Cif_F90_End_Scope_Rec(FILE *, /* Compiler Information File. */ 00522 int, /* Scope id. */ 00523 int, /* File id. */ 00524 int, /* File line number. */ 00525 int, /* Column number. */ 00526 int); /* Scope in error flag. */ 00527 00528 00529 /* Scope Information record [41]. */ 00530 00531 extern void Cif_F90_Scope_Info_Rec(FILE *, /* Compiler Information File. */ 00532 int, /* Scope id. */ 00533 int, /* Miscellaneous attributes. */ 00534 int, /* Number of alternate */ 00535 /* entry points. */ 00536 long *); /* An array of alternate */ 00537 /* entry point symbol ids. */ 00538 00539 /* Use Module record [42]. */ 00540 00541 extern void Cif_F90_Use_Module_Rec(FILE *, /* Compiler Information File. */ 00542 int, /* Module symbol id. */ 00543 int, /* Module file id. */ 00544 int); /* Module reference flag. */ 00545 00546 00547 /* Rename record [43]. */ 00548 00549 extern void Cif_F90_Rename_Rec(FILE *, /* Compiler Information File. */ 00550 int, /* Scope id. */ 00551 char *, /* Name in module. */ 00552 int, /* Name-in-module symbol id. */ 00553 int, /* Module symbol id. */ 00554 char *, /* Original name. */ 00555 int, /* Original module symbol id. */ 00556 long); /* Local name symbol id. */ 00557 00558 00559 /* Interface Block record [44]. */ 00560 00561 extern void Cif_F90_Int_Block_Rec(FILE *, /* Compiler Information File. */ 00562 char *, /* Interface block "name". */ 00563 int, /* Symbol id. */ 00564 int, /* Scope id. */ 00565 int, /* Interface block type. */ 00566 int, /* Attribute mask. */ 00567 int, /* Number of interfaces. */ 00568 long *, /* An array of specific proc */ 00569 /* symbol ids. */ 00570 int); /* Symbol id of the module in */ 00571 /* which the interface block */ 00572 /* defined; 0 otherwise. */ 00573 00574 00575 /* Command Line Options record [70]. */ 00576 00577 extern void Cif_Orig_Cmd(FILE *, /* Compiler Information File. */ 00578 char *); /* Options. */ 00579 00580 00581 /* Source Position record [86]. */ 00582 00583 extern void Cif_Src_Pos_Rec(FILE *, /* Compiler Information File. */ 00584 int, /* What the record is */ 00585 /* representing. */ 00586 int, /* Source position id. */ 00587 int, /* Parent source position id. */ 00588 int, /* Start line number. */ 00589 int, /* Start column number. */ 00590 int, /* File id. */ 00591 int, /* End line number. */ 00592 int, /* End column number. */ 00593 int); /* Macro symbol id. */ 00594 00595 00596 00597 /* Error recovery procedure. Must be provided by the caller of these CIF */ 00598 /* output routines. */ 00599 00600 extern void Cif_Error (void); 00601 00602 00603 00604 /* ************************************************************************** */ 00605 /* */ 00606 /* *** TEMPORARY DEFINITION UNTIL INTEGRATION INTO LIBCIF *** */ 00607 /* */ 00608 /* ************************************************************************** */ 00609 00610 #define CIF_SOURCE_POSITION 86 00611