struct lto_input_block * lto_create_simple_input_block (struct lto_file_decl_data *file_data, enum lto_section_type section_type, const char **datar, size_t *len) { const char *data = lto_get_section_data (file_data, section_type, NULL, len); const struct lto_simple_header * header = (const struct lto_simple_header *) data; int main_offset = sizeof (struct lto_simple_header); if (!data) return NULL; *datar = data; return new lto_input_block (data + main_offset, header->main_size); }
struct lto_input_block * lto_create_simple_input_block (struct lto_file_decl_data *file_data, enum lto_section_type section_type, const char **datar, size_t *len) { const char *data = lto_get_section_data (file_data, section_type, NULL, len); const struct lto_simple_header * header = (const struct lto_simple_header *) data; struct lto_input_block* ib_main; int main_offset = sizeof (struct lto_simple_header); if (!data) return NULL; ib_main = XNEW (struct lto_input_block); *datar = data; LTO_INIT_INPUT_BLOCK_PTR (ib_main, data + main_offset, 0, header->main_size); return ib_main; }