Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
glob.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 #ifndef glob_INCLUDED
00036 #define glob_INCLUDED
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 /* ====================================================================
00042  * ====================================================================
00043  *
00044  *
00045  * Revision history:
00046  *  15-Sep-89 - Original Version
00047  *  14-Mar-91 - Copied for TP/Muse
00048  *
00049  * Description:
00050  *
00051  * External interface to routines in the main Muse/TP compiler driver
00052  * module, basically very general purpose control and trace routines
00053  * which don't belong anywhere else.
00054  *
00055  * Also, external interface to global compiler data which doesn't
00056  * belong anywhere else.  See com/config.h for a general discussion
00057  * of where global configuration and option data declarations are
00058  * placed.
00059  *
00060  * All of this data is currently located in the process driver,
00061  * bedriver.c for the back end.
00062  *
00063  * NOTE:  This file is intended ultimately to be included in multiple
00064  * compiler processes.  We therefore attempt to distinguish between
00065  * items which are not process-specific and those which are, placing
00066  * the latter under the appropriate #ifdefs.
00067  *
00068  * ====================================================================
00069  * ====================================================================
00070  */
00071 
00072 /* Dummy struct definitions to keep prototypes happy: */
00073 struct bb;
00074 struct symtab;
00075 
00076 #ifdef __cplusplus
00077 struct ST;
00078 #else
00079 struct st;
00080 #endif
00081 
00082 /* ====================================================================
00083  *
00084  * Non-process-specific data (intended for both front ends and back
00085  * end).
00086  *
00087  * ====================================================================
00088  */
00089 
00090 extern char *Cur_PU_Name;       /* The current program unit name */
00091 extern char *Orig_PU_Name;      /* The original program unit name in source */
00092 
00093 /* Kind of the current program unit -- set similarly to Cur_PU_Name */
00094 typedef enum {
00095   PU_UNKNOWN,
00096   PU_FUNCTION,
00097   PU_SUBROUTINE,
00098   PU_PROGRAM,
00099   PU_BLOCKDATA,
00100   PU_MAX_KIND           /* used for bounds checking */
00101 } PU_KIND;
00102 extern PU_KIND Cur_PU_Kind;
00103 
00104 /* Current file names: */
00105 extern char *Src_File_Name;     /* Source file */
00106 extern char *Orig_Src_File_Name; /* Original source file passed to driver */
00107 extern char *Cpp_File_Name;     /* cpp-preprocessed file */
00108 extern char *Lst_File_Name;     /* Listing file */
00109 extern char *Err_File_Name;     /* Error file */
00110 extern char *Trc_File_Name;     /* Trace file */
00111 extern char *Tlog_File_Name;    /* Transformation log file */
00112 extern char *Irb_File_Name;     /* ACIR intermediate file */
00113 extern char *IR_File_Name;      /* SGIR intermediate file */
00114 extern char *Ipa_File_Name;     /* IPA file */
00115 extern char *Asm_File_Name;     /* Assembly file */
00116 extern char *Obj_File_Name;     /* Relocatable object file */
00117 extern char *Feedback_File_Name;/* feedback file produced from prof */
00118 #ifndef MONGOOSE_BE
00119 extern char *Lib_File_Name;     /* Program library file */
00120 #endif
00121 extern char *Lib_Lock_Name;     /* Program library lock file */
00122 extern char *DSTdump_File_Name; /* Dwarf intermediate (i.e. DST) dump file */
00123 extern char *Global_File_Name;  /* Global symbol table file */
00124 
00125 /* Current file handles if open, NULL otherwise: */
00126 extern FILE *Src_File;          /* Source file */
00127 extern FILE *Cpp_File;          /* cpp-preprocessed file */
00128 extern FILE *Lst_File;          /* Listing file */
00129 extern FILE *Err_File;          /* Error file */
00130 extern FILE *Trc_File;          /* Trace file */
00131 extern FILE *Tlog_File;         /* Transformation log file */
00132 extern FILE *Irb_File;          /* ACIR intermediate file */
00133 extern FILE *IR_File;           /* SGIR intermediate file */
00134 extern FILE *Ipa_File;          /* IPA file */
00135 extern FILE *Asm_File;          /* Assembly file */
00136 extern FILE *Obj_File;          /* Relocatable object file */
00137 extern FILE *Feedback_File;     /* feedback file produced from prof */
00138 extern FILE *Lib_File;          /* Program library file */
00139 extern FILE *Tim_File;          /* Timing info file (usually trace) */
00140 #ifdef MONGOOSE_BE
00141 #define MMAPPED_FILE (1)        /* some components use mmap instead of
00142                                    stream i/o, in those cases the *_File
00143                                    will be set to MMAPPED_FILE to show that
00144                                    the file is active  */
00145 #endif /* MONGOOSE_BE */
00146 
00147 extern INT32 Num_Source_Files;
00148 
00149 /* Output requested: */
00150 extern BOOL Assembly;           /* Assembly code */
00151 extern BOOL Object_Code;        /* Object code */
00152 extern BOOL Symbol_Table_Out;   /* Symbol table output (list or trace) */
00153 extern BOOL Show_Progress;      /* Report progress to stdout */
00154 
00155 #ifndef _NEW_SYMTAB
00156 /* Print symbol table for a program unit after a phase, if enabled: */
00157 extern void Trace_ST (
00158   INT phase,    /* Phase after which to print */
00159   char *pname,  /* Print name of phase */
00160   struct symtab *stab, /* Symtab to print */
00161   INT32 bb_id   /* basic block to print, or NULL */
00162 );
00163 #endif /* _NEW_SYMTAB */
00164 
00165 /* Print memory statistics, if enabled */
00166 extern void Trace_Memory_Allocation (
00167   INT phase,    /* Phase after which we're printing */
00168   const char *pname,    /* Print name for phase */
00169 #ifdef __cplusplus
00170   const ST *pu,
00171 #else
00172   const struct st *pu,  /* Program unit to print */
00173 #endif
00174   INT32 bb_id   /* basic block to limit traces to */
00175 );
00176 
00177 /* Clean up files after failure: */
00178 extern void Cleanup_Files (
00179   BOOL report   /* Report errors which occur during file cleanup? */
00180                 /* This should generally be FALSE for failures.   */
00181   ,BOOL delete_doto /*delete the .o if created */
00182 );
00183 
00184 /* Clean up and terminate program with given exit status: */
00185 extern void Terminate ( INT status );
00186 
00187 /* ====================================================================
00188  *
00189  * Back end process-specific data.
00190  *
00191  * ====================================================================
00192  */
00193 
00194 #ifdef BACK_END
00195 
00196 /* Front End process info: for consistency checking */
00197 /* 
00198  * The first two are set in the front end, and examined in the back end.
00199  * They are also put out to the ipa file.  The third is only used in the 
00200  * back end to store the Version number of the front end.  (In the front
00201  * end, this information is stored in "Version".  In the back end, 
00202  * "Version" contains the version number of the *back* end.  Those
00203  * variables are initialized in <machine>/<process>/version.c
00204  */
00205 extern INT32 Fe_Process_Id;
00206 extern INT32 Fe_Process_Time;
00207 extern char *Fe_Version;
00208 extern BOOL Fe_Josie;   /* Did .B come from a Josie front end? */
00209 
00210 /* Set FE process info -- defined in flags.c: */
00211 extern void Set_Fe_Info ( INT32 pid, INT32 ptime, char *fe_version );
00212 
00213 /* Set source file name: */
00214 extern void Set_File_Name ( char *name );
00215 
00216 /* Have the OP_REGCOPY operations been translated? */
00217 extern BOOL Regcopies_Translated;
00218 
00219 #else /* ! BACK_END */
00220 
00221 /* Our front ends are never Josie front ends: */
00222 # define Fe_Josie       FALSE
00223 
00224 #endif /* BACK_END */
00225 
00226 #ifdef __cplusplus
00227 }
00228 #endif
00229 #endif /* glob_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines