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 //-*-c++-*- 00037 // ==================================================================== 00038 // ==================================================================== 00039 // 00040 // 00041 // Revision history: 00042 // 24-Jul-98 - Original Version 00043 // 00044 // Description: 00045 // 00046 // ==================================================================== 00047 // ==================================================================== 00048 00049 #ifndef profile_com_INCLUDED 00050 #define profile_com_INCLUDED 00051 00052 #include <string.h> 00053 00054 #include <vector> 00055 00056 using namespace std; 00057 00058 #include "defs.h" 00059 00060 #if defined(defs_INCLUDED) && ! defined(USE_STANDARD_TYPES) 00061 #undef short // get around bogus type defs. 00062 #undef int 00063 #undef long 00064 #endif // defined(defs_INCLUDED) && !defined(USE_STANDARD_TYPES) 00065 00066 #define ULONG mUINT32 00067 00068 // When to instrument? Correlates to Instrumentation_Phase_Num 00069 enum PROFILE_PHASE 00070 { 00071 PROFILE_PHASE_NONE = -1, 00072 PROFILE_PHASE_BEFORE_VHO = 0, 00073 PROFILE_PHASE_IPA_CUTOFF = 0, // phases less than or equal to 00074 // IPA_CUTOFF will not be 00075 // instrumented when the input file 00076 // is an ipa-generated file. 00077 PROFILE_PHASE_BEFORE_LNO = 1, 00078 PROFILE_PHASE_BEFORE_WOPT = 2, 00079 PROFILE_PHASE_BEFORE_CG = 3, 00080 PROFILE_PHASE_LAST = 4, 00081 PROFILE_PHASE_MAX = INT32_MAX // Fb_Hdr size must be 0 mod 64 00082 }; 00083 00084 00085 /* Feedback File Format */ 00086 00087 #define FB_NIDENT 16 00088 00089 #define INSTR_MAG "\177INS" 00090 00091 #define INSTR_CURRENT 1 00092 00093 struct Fb_Hdr { 00094 char fb_ident[FB_NIDENT]; /* ident bytes */ 00095 ULONG fb_version; /* file version */ 00096 ULONG fb_profile_offset; /* file offset for profile data */ 00097 ULONG fb_pu_hdr_offset; /* PU header file offset */ 00098 ULONG fb_pu_hdr_ent_size; /* PU header entry size */ 00099 ULONG fb_pu_hdr_num; /* Number of PU header entries */ 00100 ULONG fb_str_table_offset; 00101 ULONG fb_str_table_size; 00102 PROFILE_PHASE phase_num; 00103 00104 Fb_Hdr() {} 00105 Fb_Hdr(Fb_Hdr& x) 00106 { 00107 memcpy((void *)fb_ident,(void *)x.fb_ident, FB_NIDENT); 00108 fb_version = x.fb_version; 00109 fb_profile_offset = x.fb_profile_offset; 00110 fb_pu_hdr_offset = x.fb_pu_hdr_offset; 00111 fb_pu_hdr_ent_size = x.fb_pu_hdr_ent_size; 00112 fb_pu_hdr_num = x.fb_pu_hdr_num; 00113 fb_str_table_offset = x.fb_str_table_offset; 00114 fb_str_table_size = x.fb_str_table_size; 00115 phase_num = x.phase_num; 00116 } 00117 00118 }; 00119 00120 struct Pu_Hdr { 00121 INT32 pu_checksum; 00122 ULONG pu_name_index; 00123 ULONG pu_file_offset; 00124 ULONG pu_inv_offset; 00125 ULONG pu_num_inv_entries; 00126 ULONG pu_br_offset; 00127 ULONG pu_num_br_entries; 00128 ULONG pu_switch_offset; 00129 ULONG pu_switch_target_offset; // # of targets for each swtich stmt 00130 ULONG pu_num_switch_entries; 00131 ULONG pu_cgoto_offset; 00132 ULONG pu_cgoto_target_offset; // # of targets for each compgoto 00133 ULONG pu_num_cgoto_entries; 00134 ULONG pu_loop_offset; 00135 ULONG pu_num_loop_entries; 00136 ULONG pu_scircuit_offset; 00137 ULONG pu_num_scircuit_entries; 00138 ULONG pu_call_offset; 00139 ULONG pu_num_call_entries; 00140 00141 Pu_Hdr() {} 00142 00143 }; 00144 00145 #endif /* profile_com_INCLUDED */