Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include <unistd.h>
#include <sys/mman.h>
#include <string.h>
#include <errno.h>
#include <elf.h>
#include <sys/elf_whirl.h>
#include "defs.h"
#include "alignof.h"
#include "erglob.h"
#include "errors.h"
#include "opcode.h"
#include "mempool.h"
#include "wn.h"
#include "wn_map.h"
#include "strtab.h"
#include "symtab.h"
#include "irbdata.h"
#include "dwarf_DST_mem.h"
#include "pu_info.h"
#include "ir_bwrite.h"
#include "ir_bcom.h"
#include <vector>
Go to the source code of this file.
#define DEFAULT_NUM_AC_INTERNALS 128 |
Definition at line 86 of file ir_bcom.cxx.
Referenced by ir_b_write_tree().
#define DEFAULT_NUM_ALIAS_CLASSES 128 |
Definition at line 81 of file ir_bcom.cxx.
Referenced by ir_b_write_tree().
#define DEFAULT_NUM_OF_PREFETCHES 64 |
Definition at line 76 of file ir_bcom.cxx.
Referenced by ir_b_write_tree().
#define INIT_TMP_MAPPED_SIZE MAPPED_SIZE |
Definition at line 73 of file ir_bcom.cxx.
Referenced by ir_b_create_map().
#define MAPPED_SIZE 0x400000 |
Definition at line 72 of file ir_bcom.cxx.
Referenced by ir_b_grow_map().
#define USE_DST_INTERNALS |
Definition at line 64 of file ir_bcom.cxx.
#define USE_STANDARD_TYPES /* override unwanted defines in "defs.h" */ |
Definition at line 50 of file ir_bcom.cxx.
Referenced by ir_b_write_tree().
Elf64_Word ir_b_copy_file | ( | const void * | buf, |
Elf64_Word | size, | ||
void * | tmpfl | ||
) |
Definition at line 131 of file ir_bcom.cxx.
References Current_Output, Doing_mmapped_io, FALSE, output_file::file_size, ir_b_grow_map(), output_file::map_addr, output_file::mapped_size, size, and TRUE.
char* ir_b_create_map | ( | Output_File * | fl | ) |
Definition at line 216 of file ir_bcom.cxx.
References fd, INIT_TMP_MAPPED_SIZE, output_file::map_addr, output_file::mapped_size, and output_file::output_fd.
Referenced by WN_open_output().
char* ir_b_grow_map | ( | Elf64_Word | min_size, |
Output_File * | fl | ||
) |
Definition at line 180 of file ir_bcom.cxx.
References EC_IR_Write, ErrMsg(), errno, output_file::file_name, output_file::file_size, Is_True, output_file::map_addr, MAPPED_SIZE, output_file::mapped_size, and output_file::output_fd.
Referenced by ir_b_copy_file(), ir_b_reserve_space(), ir_b_save_buf(), layout_sections(), WN_write_flags(), and WN_write_PU_Infos().
static Elf64_Word ir_b_reserve_space | ( | Elf64_Word | size, |
unsigned int | align, | ||
Output_File * | fl | ||
) | [static] |
Definition at line 162 of file ir_bcom.cxx.
References output_file::file_size, ir_b_align(), ir_b_grow_map(), output_file::mapped_size, and size.
Referenced by ir_b_write_global_symtab(), and ir_b_write_local_symtab().
Elf64_Word ir_b_save_buf | ( | const void * | buf, |
Elf64_Word | size, | ||
unsigned int | align, | ||
unsigned int | padding, | ||
Output_File * | fl | ||
) |
Definition at line 110 of file ir_bcom.cxx.
References Current_Output, Doing_mmapped_io, FALSE, output_file::file_size, ir_b_align(), ir_b_grow_map(), output_file::map_addr, output_file::mapped_size, size, and TRUE.
Referenced by IPA_copy_PU(), ir_b_write_dst(), ir_b_write_global_symtab(), ir_b_write_tree(), WRITE_TABLE_OP< T >::operator()(), WN_write_flags(), WN_write_generic_map(), WN_write_prefetch(), WN_write_revision(), WN_write_strtab(), and write_file_info().
Elf64_Word ir_b_write_dst | ( | DST_TYPE | dst, |
off_t | base_offset, | ||
Output_File * | fl | ||
) |
Definition at line 562 of file ir_bcom.cxx.
References ALIGNOF, Current_DST, ir_b_save_buf(), and size.
Referenced by WN_write_dst().
Elf64_Word ir_b_write_global_symtab | ( | off_t | base_offset, |
Output_File * | fl | ||
) |
Definition at line 444 of file ir_bcom.cxx.
References ALIGNOF, Arb_Table, Blk_Table, Fld_Table, GLOBAL_SYMTAB, SYMTAB_HEADER_TABLE< table_size >::header, idx, SYMTAB_HEADER::Init(), Initv_Table, ir_b_reserve_space(), ir_b_save_buf(), Pu_Table, save_buf_at_offset(), Scope_tab, SHDR_ARB, SHDR_BLK, SHDR_FILE, SHDR_FLD, SHDR_INITO, SHDR_INITV, SHDR_PU, SHDR_ST, SHDR_ST_ATTR, SHDR_STR, SHDR_TCON, SHDR_TY, SHDR_TYLIST, SEGMENTED_ARRAY< T, block_size >::Size(), TCON_strtab_buffer(), TCON_strtab_size(), Tcon_Table, Ty_tab, Tylist_Table, write_file_info(), and write_table().
Referenced by WN_write_globals().
Elf64_Word ir_b_write_local_symtab | ( | const SCOPE & | pu, |
off_t | base_offset, | ||
Output_File * | fl | ||
) |
Definition at line 523 of file ir_bcom.cxx.
References ALIGNOF, SYMTAB_HEADER_TABLE< table_size >::header, SYMTAB_HEADER::Init(), SCOPE::inito_tab, ir_b_reserve_space(), SCOPE::label_tab, SCOPE::preg_tab, save_buf_at_offset(), SHDR_INITO, SHDR_LABEL, SHDR_PREG, SHDR_ST, SHDR_ST_ATTR, SEGMENTED_ARRAY< T, block_size >::Size(), RELATED_SEGMENTED_ARRAY< T, block_size >::Size(), SCOPE::st_attr_tab, SCOPE::st_tab, and write_table().
Referenced by WN_write_symtab().
Elf64_Word ir_b_write_tree | ( | WN * | node, |
off_t | base_offset, | ||
Output_File * | fl, | ||
WN_MAP | off_map | ||
) |
Definition at line 238 of file ir_bcom.cxx.
References ALIGNOF, DEFAULT_NUM_AC_INTERNALS, DEFAULT_NUM_ALIAS_CLASSES, DEFAULT_NUM_OF_PREFETCHES, FALSE, FmtAssert, ir_b_save_buf(), ir_b_write_tree(), max_ac_internal_nodes, max_alias_class_nodes, max_num_prefetch_ldsts, NULL, num_ac_internal_nodes, num_alias_class_nodes, num_prefetch_ldsts, OPC_BLOCK, OPCODE_has_next_prev(), OPCODE_is_leaf(), OPCODE_is_load(), OPCODE_is_store(), OPCODE_operator(), OPR_ILOAD, OPR_ISTORE, OPR_LDA, OPR_MLOAD, OPR_MSTORE, OPR_PARM, OPR_PREFETCH, OPR_PREFETCHX, OPR_PSTORE, size, TRUE, wn, WN_ADDR, WN_first(), WN_kid(), WN_kid_count(), WN_last(), WN_MAP32_Get, WN_MAP32_Set, WN_MAP_AC_INTERNAL, WN_MAP_ALIAS_CLASS, WN_MAP_Get, WN_MAP_PREFETCH, WN_MAP_UNDEFINED, WN_next(), WN_opcode(), WN_prev(), WN_Size_and_StartAddress(), Write_AC_INTERNAL_Map, Write_ALIAS_CLASS_Map, and Write_BE_Maps.
Referenced by ir_b_write_tree(), and WN_write_tree().
static void save_buf_at_offset | ( | const void * | buf, |
Elf64_Word | size, | ||
off_t | offset, | ||
Output_File * | fl | ||
) | [static] |
Definition at line 149 of file ir_bcom.cxx.
References Doing_mmapped_io, FALSE, Is_True, output_file::map_addr, and TRUE.
Referenced by ir_b_write_global_symtab(), and ir_b_write_local_symtab().
static Elf64_Word write_file_info | ( | off_t | base_offset, |
Output_File * | fl | ||
) | [static] |
Definition at line 432 of file ir_bcom.cxx.
References ALIGNOF, File_info, output_file::file_size, ir_b_align(), and ir_b_save_buf().
Referenced by ir_b_write_global_symtab().
Elf64_Word write_table | ( | TABLE & | fld, |
off_t | base_offset, | ||
Output_File * | fl | ||
) |
Definition at line 416 of file ir_bcom.cxx.
References ALIGNOF, output_file::file_size, For_all_blocks(), and ir_b_align().
Referenced by ir_b_write_global_symtab(), and ir_b_write_local_symtab().
Definition at line 87 of file ir_bcom.cxx.
Definition at line 82 of file ir_bcom.cxx.
Definition at line 100 of file ir_bcom.cxx.
Referenced by ir_b_copy_file(), ir_b_save_buf(), ir_bwrite_signal_handler(), and save_buf_at_offset().
void* IPAA_Local_Map = NULL |
Definition at line 98 of file ir_bcom.cxx.
Definition at line 89 of file ir_bcom.cxx.
Referenced by ir_b_write_tree(), and WN_write_tree().
Definition at line 84 of file ir_bcom.cxx.
Referenced by ir_b_write_tree(), and WN_write_tree().
Definition at line 79 of file ir_bcom.cxx.
Referenced by ir_b_write_tree(), and WN_write_tree().
Definition at line 88 of file ir_bcom.cxx.
Referenced by ir_b_write_tree(), and WN_write_tree().
Definition at line 83 of file ir_bcom.cxx.
Referenced by ir_b_write_tree(), and WN_write_tree().
Definition at line 78 of file ir_bcom.cxx.
Referenced by ir_b_write_tree(), and WN_write_tree().
Definition at line 77 of file ir_bcom.cxx.
Definition at line 234 of file ir_bcom.cxx.
char* Whirl_Revision = WHIRL_REVISION |
Definition at line 93 of file ir_bcom.cxx.
Referenced by WN_write_revision().