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