00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef __IR_BWRITE_H__
00037 #define __IR_BWRITE_H__
00038
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042
00043 #ifdef __MINGW32__
00044 #include<WINDOWS.H>
00045
00046
00047
00048
00049 #endif
00050
00051
00052
00053
00054
00055 #ifdef BACK_END
00056 extern BOOL Write_BE_Maps;
00057 extern BOOL Write_AC_INTERNAL_Map;
00058 extern BOOL Write_ALIAS_CLASS_Map;
00059 #endif
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 typedef struct section {
00072 const char *name;
00073 Elf64_Shdr shdr;
00074 } Section;
00075
00076
00077 typedef struct output_file {
00078 char *file_name;
00079 #ifdef __MINGW32__
00080 int output_fd;
00081 HANDLE mapHd;
00082 #else
00083 INT output_fd;
00084 #endif
00085 char *map_addr;
00086 off_t mapped_size;
00087 off_t file_size;
00088 Section *section_list;
00089 INT max_num_of_section;
00090 INT num_of_section;
00091 Section *cur_section;
00092 } Output_File;
00093
00094
00095 extern Output_File *Current_Output;
00096
00097
00098 extern Output_File *WN_open_output (char *file_name);
00099 extern void WN_close_output (Output_File *fl);
00100 extern void WN_close_file (void *fl);
00101
00102
00103
00104
00105
00106
00107
00108 extern void WN_write_globals (Output_File *fl);
00109 extern void WN_write_dst (void *dst, Output_File *fl);
00110 extern void WN_write_strtab (const void *strtab, UINT64 size, Output_File *fl);
00111 extern void WN_write_localmap (void *localmap, Output_File *fl);
00112 extern void IPA_write_summary (void (*IPA_irb_write_summary) (Output_File*),
00113 Output_File *fl);
00114 extern void IPA_copy_PU(PU_Info *pu, char *section_base, Output_File *outfile);
00115
00116 extern void WN_write_flags (INT argc, char **argv, Output_File *fl);
00117 extern void WN_write_revision (Output_File *fl);
00118 extern void WN_close_file (void *this_fl);
00119 #if defined(TARG_SL)
00120 extern void WN_write_isr_cg (vector<mINT32>& cg, Output_File *fl);
00121 #endif
00122
00123
00124
00125
00126
00127
00128 extern void WN_write_PU_Infos (PU_Info *pu_list, Output_File *fl);
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 extern void WN_write_tree (PU_Info *pu, WN_MAP off_map, Output_File *fl);
00139 extern void WN_write_symtab (PU_Info *pu, Output_File *fl);
00140 extern void WN_write_depgraph (PU_Info *pu, WN_MAP off_map, Output_File *fl);
00141 extern void WN_write_prefetch (PU_Info *pu, WN_MAP off_map, Output_File *fl);
00142 extern void WN_write_feedback (PU_Info *pu, Output_File *fl);
00143 extern void WN_write_INT32_map(PU_Info *pu,
00144 WN_MAP off_map,
00145 Output_File *fl,
00146 INT32 subsection_type,
00147 WN_MAP value_map,
00148 const char *subsection_name);
00149 extern void WN_write_voidptr_map(PU_Info *pu,
00150 WN_MAP off_map,
00151 Output_File *fl,
00152 INT32 subsection_type,
00153 WN_MAP value_map,
00154 const char *subsection_name);
00155 #ifndef OWN_ERROR_PACKAGE
00156
00157
00158
00159
00160
00161
00162 extern Output_File *Open_Output_Info (char *output_file);
00163 extern void Write_PU_Info (PU_Info *pu);
00164 extern void Write_Global_Info (PU_Info *pu_tree);
00165 extern void Close_Output_Info (void);
00166 extern void WN_write_elf_symtab (const void* symtab, UINT64 size,
00167 UINT64 entsize, UINT align, Output_File* fl);
00168
00169 #endif
00170
00171 #ifdef __cplusplus
00172 }
00173 #endif
00174
00175 #endif