00001 /* 00002 * Copyright 2003, 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* 00006 00007 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00008 00009 This program is free software; you can redistribute it and/or modify it 00010 under the terms of version 2 of the GNU General Public License as 00011 published by the Free Software Foundation. 00012 00013 This program is distributed in the hope that it would be useful, but 00014 WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 00017 Further, this software is distributed without any warranty that it is 00018 free of the rightful claim of any third person regarding infringement 00019 or the like. Any license provided herein, whether implied or 00020 otherwise, applies only to this software file. Patent licenses, if 00021 any, provided herein do not apply to combinations of this program with 00022 other software, or any other product whatsoever. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with this program; if not, write the Free Software Foundation, Inc., 59 00026 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00027 00028 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00029 Mountain View, CA 94043, or: 00030 00031 http://www.sgi.com 00032 00033 For further information regarding this notice, see: 00034 00035 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00036 00037 */ 00038 00039 00040 /* ==================================================================== 00041 * ==================================================================== 00042 * 00043 * Module: glob.c 00044 * 00045 * Revision history: 00046 * 15-Sep-93 - Original Version 00047 * 00048 * Description: 00049 * 00050 * This file contains miscellaneous global data and utility functions 00051 * for the compiler which used to be part of each pass driver. 00052 * 00053 * ==================================================================== 00054 * ==================================================================== 00055 */ 00056 00057 #ifdef USE_PCH 00058 #include "common_com_pch.h" 00059 #endif /* USE_PCH */ 00060 #pragma hdrstop 00061 #include "defs.h" 00062 #include "errors.h" 00063 #include "glob.h" 00064 #include "tracing.h" 00065 00066 #include "mempool.h" 00067 #if !(defined(SGI_FRONT_END_CPP) && !defined(FFE)) 00068 #include "wn.h" 00069 #endif /* if !(defined(SGI_FRONT_END_CPP) && !defined(FFE)) */ 00070 #include "stab.h" 00071 #include "const.h" 00072 #include "irbdata.h" 00073 00074 /* The current program unit name -- */ 00075 char *Cur_PU_Name = NULL; 00076 char *Orig_PU_Name = NULL; 00077 00078 /* Type of the current program unit -- set similarly to Cur_PU_Name */ 00079 PU_KIND Cur_PU_Kind = PU_UNKNOWN; 00080 00081 BOOL Symbol_Table_Out = FALSE; /* Symbol table output (list or trace) */ 00082 BOOL Show_Progress = FALSE; /* Report progress to stdout */ 00083 BOOL Create_Cycle_Output = FALSE; 00084 BOOL OpenMP_Profiling = FALSE; 00085 00086 /* ==================================================================== 00087 * 00088 * Front End process info: for consistency checking 00089 * 00090 * The first two are set in the front end, and examined in the back end. 00091 * They are also put out to the ipa file. The third is only used in the 00092 * back end to store the Version number of the front end. (In the front 00093 * end, this information is stored in "Version". In the back end, 00094 * "Version" contains the version number of the *back* end. Those 00095 * variables are initialized in <machine>/<process>/version.c 00096 * 00097 * ==================================================================== 00098 */ 00099 00100 INT32 Fe_Process_Id = -1; 00101 INT32 Fe_Process_Time = -1; 00102 char *Fe_Version = NULL; 00103 00104 /* ==================================================================== 00105 * 00106 * File names and handles. 00107 * 00108 * ==================================================================== 00109 */ 00110 /*add by cbq */ 00111 int pu_number = 0; 00112 int bb_number = 0; 00113 const char *Output_h_File_Name = "cycle_output.h"; /* Cycle_Counting Output.h file */ 00114 FILE *Output_h_File = NULL; /* Cycle counting output.h file */ 00115 FILE *Call_graph_file = NULL; /* Call graph file */ 00116 char * pu_string[1000]; 00117 char * bb_string[1000]; 00118 00119 /* Current file names: */ 00120 char *Src_File_Name = NULL; /* Source file */ 00121 char *Orig_Src_File_Name = NULL; /* Original source file */ 00122 char *Cpp_File_Name = NULL; /* cpp-preprocessed file */ 00123 char *Err_File_Name = NULL; /* Error file */ 00124 char *Lst_File_Name = NULL; /* Listing file */ 00125 char *Trc_File_Name = NULL; /* Trace file */ 00126 char *Tlog_File_Name = NULL; /* Transformation log file */ 00127 char *IR_File_Name = NULL; /* SGIR file */ 00128 char *Irb_File_Name = NULL; /* ACIR intermediate file */ 00129 char *Asm_File_Name = NULL; /* Assembly file */ 00130 char *Obj_File_Name = NULL; /* Relocatable object file */ 00131 char *Instrumentation_File_Name = NULL; /* instrumentation file */ 00132 char *Feedback_File_Name = NULL; /* Feedback file */ 00133 char *call_graph_file_name = NULL; /* Function call graph file */ 00134 char *cord_output_file_name = NULL; /* Output file name after function layout */ 00135 char *cord_obj_file_name = NULL; /* Object file name which will be reorder function layout */ 00136 #ifndef MONGOOSE_BE 00137 char *Lib_File_Name = NULL; /* Program library file */ 00138 #endif 00139 char *Lib_Lock_Name = NULL; /* Program library lock file */ 00140 char *DSTdump_File_Name = NULL; /* Dwarf (i.e. DST) dump file */ 00141 char *Global_File_Name = NULL; /* Global symbol table file */ 00142 00143 char *License_File_Name = NULL ; /* license file */ 00144 char *Whirl2C_File_Name = NULL ; /* whirl2c output file */ 00145 00146 /* Current file handles if open, NULL otherwise: */ 00147 FILE *Src_File = NULL; /* Source file */ 00148 FILE *Cpp_File = NULL; /* cpp-preprocessed file */ 00149 FILE *Err_File = NULL; /* Error file */ 00150 FILE *Lst_File = NULL; /* Listing file */ 00151 FILE *Trc_File = NULL; /* Trace file */ 00152 FILE *Tlog_File = NULL; /* Transformation log file */ 00153 FILE *IR_File = NULL; /* SGIR file */ 00154 FILE *Irb_File = NULL; /* ACIR intermediate file */ 00155 FILE *Asm_File = NULL; /* Assembly file */ 00156 FILE *Obj_File = NULL; /* Relocatable object file */ 00157 FILE *Lib_File = NULL; /* Program library file */ 00158 FILE *Tim_File = NULL; /* Timer report file, usually TFile */ 00159 00160 #ifdef SPECMT_LT 00161 FILE *ExchangeFile = NULL; /* exchange file for pseudo-specmt partition */ 00162 FILE *LoopMappingFile = NULL; /* loop mapping file for two pass compilation */ 00163 #endif 00164
1.5.6