Commit e293c971 authored by Matthias Braun's avatar Matthias Braun
Browse files

Rename get_type_{size|alignment}_bytes() to get_type{size|alignment}()

parent 002cc34b
......@@ -953,20 +953,20 @@ FIRM_API void set_type_state(ir_type *tp, ir_type_state state);
FIRM_API ir_mode *get_type_mode(const ir_type *tp);
/** Returns the size of a type in bytes. */
FIRM_API unsigned get_type_size_bytes(const ir_type *tp);
FIRM_API unsigned get_type_size(const ir_type *tp);
/** Sets the size of a type in bytes.
*
* For primitive, pointer and method types the size is always fixed.
* This call is legal but has no effect.
*/
FIRM_API void set_type_size_bytes(ir_type *tp, unsigned size);
FIRM_API void set_type_size(ir_type *tp, unsigned size);
/** Returns the alignment of a type in bytes. */
FIRM_API unsigned get_type_alignment_bytes(const ir_type *tp);
FIRM_API unsigned get_type_alignment(const ir_type *tp);
/** Sets the alignment of a type in bytes. */
FIRM_API void set_type_alignment_bytes(ir_type *tp, unsigned align);
FIRM_API void set_type_alignment(ir_type *tp, unsigned align);
/** Returns the visited counter of a type.
* @see @ref visited_counters */
......@@ -1394,7 +1394,7 @@ FIRM_API ir_type *get_array_element_type(const ir_type *array);
/**
* Sets the array variable size flag.
* If this flag is set then no upper/lower bounds need to be set and
* get_type_size_bytes() returns -1
* get_type_size() returns -1
*/
FIRM_API void set_array_variable_size(ir_type *array, int variable_size_flag);
......@@ -1541,9 +1541,9 @@ FIRM_API void remove_compound_member(ir_type *compound, ir_entity *entity);
/**
* Sets the variable size flag of a compound type.
* The last member of a variable size compound type may be an array type
* without explicit size. So the get_type_size_bytes() of a variable size
* compound type only returns a minimum size for the type (the size if the
* last members size is 0)
* without explicit size. So the get_type_size() of a variable size compound
* type only returns a minimum size for the type (the size if the last members
* size is 0)
*/
FIRM_API void set_compound_variable_size(ir_type *compound, int variable_size);
......
......@@ -438,7 +438,7 @@ pointer:
ir_alias_relation rel;
if (options & aa_opt_byte_type_may_alias) {
if (get_type_size_bytes(objt1) == 1 || get_type_size_bytes(objt2) == 1) {
if (get_type_size(objt1) == 1 || get_type_size(objt2) == 1) {
/* One of the types address a byte. Assume a ir_may_alias and leave
the type based check. */
goto leave_type_based_alias;
......@@ -447,7 +447,7 @@ pointer:
/* cheap check: If the type sizes did not match, the types MUST be different */
/* No, one might be part of the other. */
/* if (get_type_size_bytes(objt1) != get_type_size_bytes(objt2)) */
/* if (get_type_size(objt1) != get_type_size(objt2)) */
/* return ir_no_alias; */
/* cheap test: if only one is a reference type, no alias */
......
......@@ -173,7 +173,7 @@ static void emit_Return(const ir_node *node)
{
ir_graph *irg = get_irn_irg(node);
ir_type *frame_type = get_irg_frame_type(irg);
unsigned size = get_type_size_bytes(frame_type);
unsigned size = get_type_size(frame_type);
/* emit function epilog here */
......
......@@ -67,7 +67,7 @@ static void introduce_prologue(ir_graph *const irg)
ir_node *const block = get_nodes_block(start);
ir_node *const initial_sp = be_get_Start_proj(irg, sp);
ir_type *const frame_type = get_irg_frame_type(irg);
unsigned const frame_size = get_type_size_bytes(frame_type);
unsigned const frame_size = get_type_size(frame_type);
ir_node *const incsp = be_new_IncSP(sp, block, initial_sp, frame_size, 0);
edges_reroute_except(initial_sp, incsp, incsp);
sched_add_after(start, incsp);
......
......@@ -3264,12 +3264,12 @@ static ir_type *amd64_get_between_type(bool omit_fp)
if (between_type == NULL) {
between_type = new_type_class(new_id_from_str("amd64_between_type"));
/* between type contains return address + saved base pointer */
set_type_size_bytes(between_type, 2*get_mode_size_bytes(mode_gp));
set_type_size(between_type, 2*get_mode_size_bytes(mode_gp));
omit_fp_between_type
= new_type_class(new_id_from_str("amd64_between_type"));
/* between type contains return address */
set_type_size_bytes(omit_fp_between_type, get_mode_size_bytes(mode_gp));
set_type_size(omit_fp_between_type, get_mode_size_bytes(mode_gp));
}
return omit_fp ? omit_fp_between_type : between_type;
......
......@@ -178,8 +178,8 @@ static void transform_MemPerm(ir_node *node)
ir_entity *inent = be_get_MemPerm_in_entity(node, i);
ir_entity *outent = be_get_MemPerm_out_entity(node, i);
ir_type *enttype = get_entity_type(inent);
unsigned entsize = get_type_size_bytes(enttype);
unsigned entsize2 = get_type_size_bytes(get_entity_type(outent));
unsigned entsize = get_type_size(enttype);
unsigned entsize2 = get_type_size(get_entity_type(outent));
ir_node *mem = get_irn_n(node, i);
/* work around cases where entities have different sizes */
......@@ -216,8 +216,8 @@ static void transform_MemPerm(ir_node *node)
ir_entity *inent = be_get_MemPerm_in_entity(node, i);
ir_entity *outent = be_get_MemPerm_out_entity(node, i);
ir_type *enttype = get_entity_type(outent);
unsigned entsize = get_type_size_bytes(enttype);
unsigned entsize2 = get_type_size_bytes(get_entity_type(inent));
unsigned entsize = get_type_size(enttype);
unsigned entsize2 = get_type_size(get_entity_type(inent));
/* work around cases where entities have different sizes */
if (entsize2 < entsize)
......@@ -524,7 +524,7 @@ static void introduce_epilogue(ir_node *ret)
ir_graph *irg = get_irn_irg(ret);
ir_node *block = get_nodes_block(ret);
ir_type *frame_type = get_irg_frame_type(irg);
unsigned frame_size = get_type_size_bytes(frame_type);
unsigned frame_size = get_type_size(frame_type);
be_stack_layout_t *layout = be_get_irg_stack_layout(irg);
ir_node *first_sp = get_irn_n(ret, n_amd64_ret_stack);
ir_node *curr_sp = first_sp;
......@@ -564,7 +564,7 @@ static void introduce_prologue(ir_graph *const irg)
ir_node *start = get_irg_start(irg);
ir_node *block = get_nodes_block(start);
ir_type *frame_type = get_irg_frame_type(irg);
unsigned frame_size = get_type_size_bytes(frame_type);
unsigned frame_size = get_type_size(frame_type);
be_stack_layout_t *layout = be_get_irg_stack_layout(irg);
ir_node *initial_sp = be_get_Start_proj(irg, sp);
......
......@@ -64,7 +64,7 @@ static void introduce_epilog(ir_node *ret)
ir_node *const block = get_nodes_block(ret);
ir_graph *const irg = get_irn_irg(ret);
ir_type *const frame_type = get_irg_frame_type(irg);
unsigned const frame_size = get_type_size_bytes(frame_type);
unsigned const frame_size = get_type_size(frame_type);
ir_node *const incsp = be_new_IncSP(sp_reg, block, sp, -frame_size, 0);
set_irn_n(ret, n_arm_Return_sp, incsp);
sched_add_before(ret, incsp);
......@@ -83,7 +83,7 @@ static void introduce_prolog_epilog(ir_graph *irg)
ir_node *block = get_nodes_block(start);
ir_node *initial_sp = be_get_Start_proj(irg, sp_reg);
ir_type *frame_type = get_irg_frame_type(irg);
unsigned frame_size = get_type_size_bytes(frame_type);
unsigned frame_size = get_type_size(frame_type);
ir_node *const incsp = be_new_IncSP(sp_reg, block, initial_sp, frame_size, 0);
edges_reroute_except(initial_sp, incsp, incsp);
......
......@@ -1656,7 +1656,7 @@ static ir_type *arm_get_between_type(void)
static ir_type *between_type = NULL;
if (between_type == NULL) {
between_type = new_type_class(new_id_from_str("arm_between_type"));
set_type_size_bytes(between_type, 0);
set_type_size(between_type, 0);
}
return between_type;
......
......@@ -577,7 +577,7 @@ static void emit_pointer_type_abbrev(void)
static void emit_pointer_type(const ir_type *type)
{
ir_type *points_to = get_pointer_points_to_type(type);
unsigned size = get_type_size_bytes(type);
unsigned size = get_type_size(type);
assert(size < 256);
if (!is_Primitive_type(points_to) || get_type_mode(points_to) != mode_ANY) {
......@@ -681,7 +681,7 @@ static void emit_compound_type(const ir_type *type)
assert(is_Class_type(type));
emit_uleb128(abbrev_class_type);
}
emit_uleb128(get_type_size_bytes(type));
emit_uleb128(get_type_size(type));
for (size_t i = 0; i < n_members; ++i) {
ir_entity *member = get_compound_member(type, i);
ir_type *member_type = get_entity_type(member);
......@@ -690,7 +690,7 @@ static void emit_compound_type(const ir_type *type)
if (get_entity_bitfield_size(member) > 0) {
unsigned bit_offset = get_entity_bitfield_offset(member);
unsigned bit_size = get_entity_bitfield_size(member);
unsigned base_size = get_type_size_bytes(member_type);
unsigned base_size = get_type_size(member_type);
bit_offset = base_size*8 - bit_offset - bit_size;
......
......@@ -754,11 +754,11 @@ static void emit_init_expression(ir_node *const init)
return;
case iro_Align:
be_emit_irprintf("%u", get_type_alignment_bytes(get_Align_type(init)));
be_emit_irprintf("%u", get_type_alignment(get_Align_type(init)));
return;
case iro_Size:
be_emit_irprintf("%u", get_type_size_bytes(get_Size_type(init)));
be_emit_irprintf("%u", get_type_size(get_Size_type(init)));
return;
case iro_Add:
......@@ -894,28 +894,27 @@ static size_t get_initializer_size(const ir_initializer_t *initializer,
switch (get_initializer_kind(initializer)) {
case IR_INITIALIZER_TARVAL:
assert(get_tarval_mode(get_initializer_tarval_value(initializer)) == get_type_mode(type));
return get_type_size_bytes(type);
return get_type_size(type);
case IR_INITIALIZER_CONST:
case IR_INITIALIZER_NULL:
return get_type_size_bytes(type);
return get_type_size(type);
case IR_INITIALIZER_COMPOUND:
if (is_Array_type(type)) {
if (is_array_variable_size(type)) {
ir_type *element_type = get_array_element_type(type);
unsigned element_size = get_type_size_bytes(element_type);
unsigned element_align
= get_type_alignment_bytes(element_type);
unsigned element_size = get_type_size(element_type);
unsigned element_align = get_type_alignment(element_type);
unsigned misalign = element_size % element_align;
size_t n_inits
= get_initializer_compound_n_entries(initializer);
element_size += element_align - misalign;
return n_inits * element_size;
} else {
return get_type_size_bytes(type);
return get_type_size(type);
}
} else {
assert(is_compound_type(type));
size_t size = get_type_size_bytes(type);
size_t size = get_type_size(type);
if (is_compound_variable_size(type)) {
/* last initializer has to be an array of variable size */
size_t l = get_initializer_compound_n_entries(initializer)-1;
......@@ -936,7 +935,7 @@ static size_t get_initializer_size(const ir_initializer_t *initializer,
static unsigned long compute_entity_size(ir_entity const *const entity)
{
ir_type *const type = get_entity_type(entity);
unsigned long size = get_type_size_bytes(type);
unsigned long size = get_type_size(type);
if (is_alias_entity(entity))
return size;
......@@ -981,7 +980,7 @@ static void emit_bitfield(normal_or_bitfield *vals, unsigned offset_bits,
panic("couldn't get numeric value for bitfield initializer");
}
int value_len = get_type_size_bytes(type);
int value_len = get_type_size(type);
size_t bit_offset = 0;
size_t end = bitfield_size;
bool big_endian = be_get_backend_param()->byte_order_big_endian;
......@@ -1041,7 +1040,7 @@ static void emit_ir_initializer(normal_or_bitfield *vals,
vals->type = type;
vals->v.tarval = get_initializer_tarval_value(initializer);
assert(get_type_mode(type) == get_tarval_mode(vals->v.tarval));
for (size_t i = 1; i < get_type_size_bytes(type); ++i) {
for (size_t i = 1; i < get_type_size(type); ++i) {
vals[i].kind = NORMAL;
vals[i].type = NULL;
vals[i].v.value = NULL;
......@@ -1053,7 +1052,7 @@ static void emit_ir_initializer(normal_or_bitfield *vals,
vals->kind = NORMAL;
vals->type = type;
vals->v.value = get_initializer_const_value(initializer);
for (size_t i = 1; i < get_type_size_bytes(type); ++i) {
for (size_t i = 1; i < get_type_size(type); ++i) {
vals[i].kind = NORMAL;
vals[i].type = NULL;
vals[i].v.value = NULL;
......@@ -1063,8 +1062,8 @@ static void emit_ir_initializer(normal_or_bitfield *vals,
case IR_INITIALIZER_COMPOUND:
if (is_Array_type(type)) {
ir_type *element_type = get_array_element_type(type);
size_t skip = get_type_size_bytes(element_type);
size_t alignment = get_type_alignment_bytes(element_type);
size_t skip = get_type_size(element_type);
size_t alignment = get_type_alignment(element_type);
size_t misalign = skip % alignment;
if (misalign != 0) {
skip += alignment - misalign;
......@@ -1111,7 +1110,7 @@ static void emit_ir_initializer(normal_or_bitfield *vals,
static void emit_tarval_data(ir_type *type, ir_tarval *tv)
{
size_t size = get_type_size_bytes(type);
size_t size = get_type_size(type);
if (size > 8) {
assert(size % 4 == 0);
if (be_get_backend_param()->byte_order_big_endian) {
......@@ -1145,7 +1144,7 @@ static void emit_tarval_data(ir_type *type, ir_tarval *tv)
*/
static void emit_node_data(ir_node *const init, ir_type *const type)
{
size_t size = get_type_size_bytes(type);
size_t size = get_type_size(type);
if (size == 12 || size == 16) {
if (!is_Const(init)) {
panic("12/16byte initializers only support Const nodes yet");
......@@ -1195,14 +1194,14 @@ static void emit_initializer(ir_entity const *const entity,
case NORMAL:
if (vals[k].v.value != NULL) {
emit_node_data(vals[k].v.value, vals[k].type);
elem_size = get_type_size_bytes(vals[k].type);
elem_size = get_type_size(vals[k].type);
} else {
elem_size = 0;
}
break;
case TARVAL:
emit_tarval_data(vals[k].type, vals[k].v.tarval);
elem_size = get_type_size_bytes(vals[k].type);
elem_size = get_type_size(vals[k].type);
break;
case STRING:
elem_size = emit_string_initializer(vals[k].v.string);
......@@ -1242,7 +1241,7 @@ static unsigned get_effective_entity_alignment(const ir_entity *entity)
unsigned alignment = get_entity_alignment(entity);
if (alignment == 0) {
ir_type *type = get_entity_type(entity);
alignment = get_type_alignment_bytes(type);
alignment = get_type_alignment(type);
}
return alignment;
}
......@@ -1514,7 +1513,7 @@ static void emit_global(be_main_env_t const *const main_env,
be_emit_cstring("object\n\t.size\t");
be_gas_emit_entity(entity);
ir_type *const type = get_entity_type(entity);
be_emit_irprintf(", %u\n", get_type_size_bytes(type));
be_emit_irprintf(", %u\n", get_type_size(type));
}
ident *ld_ident = get_entity_ld_ident(entity);
......
......@@ -137,8 +137,7 @@ static void merge_spilltypes(spillweb_t *web, const ir_type *type1)
return;
}
assert(modes_compatible(get_type_mode(type0), get_type_mode(type1)));
web->type = get_type_size_bytes(type1) > get_type_size_bytes(type0)
? type1 : type0;
web->type = get_type_size(type1) > get_type_size(type0) ? type1 : type0;
}
static spillweb_t *get_spill_web(spillweb_t *begin)
......@@ -482,8 +481,8 @@ static void assign_spillslots(be_fec_env_t *env)
int slotid = spill->spillslot;
const spillweb_t *web = get_spill_web(spill->web);
const ir_type *type = web->type;
int size = get_type_size_bytes(type);
int align = get_type_alignment_bytes(type);
int size = get_type_size(type);
int align = get_type_alignment(type);
spill_slot_t *slot = &spillslots[slotid];
if (slot->align == 0 && slot->size == 0) {
......
......@@ -37,7 +37,7 @@ int be_get_stack_entity_offset(be_stack_layout_t *frame, ir_entity *ent,
if (frame->order[index] == t)
break;
/* Add the size of all the types below the one of the entity to the entity's offset */
ofs += get_type_size_bytes(frame->order[index]);
ofs += get_type_size(frame->order[index]);
}
/* correct the offset by the initial position of the frame pointer */
ofs -= frame->initial_offset;
......@@ -64,7 +64,7 @@ static void stack_frame_compute_initial_offset(be_stack_layout_t *frame)
ir_type *base = frame->between_type;
ir_entity *ent = search_ent_with_offset(base, 0);
if (ent == NULL) {
frame->initial_offset = get_type_size_bytes(frame->frame_type);
frame->initial_offset = get_type_size(frame->frame_type);
} else {
frame->initial_offset = be_get_stack_entity_offset(frame, ent, 0);
}
......@@ -116,7 +116,7 @@ static void process_stack_bias(bias_walk *bw, ir_node *bl, int real_bias, int wa
/* fill in real stack frame size */
if (align > 0) {
/* patch IncSP to produce an aligned stack pointer */
int const between_size = get_type_size_bytes(layout->between_type);
int const between_size = get_type_size(layout->between_type);
int const alignment = 1 << align;
int const delta = (real_bias + ofs + between_size) & (alignment - 1);
assert(ofs >= 0);
......
......@@ -42,7 +42,8 @@ void be_default_lower_va_arg(ir_node *node)
}
backend_params const *const be_params = be_get_backend_param();
unsigned round_up = round_up2(get_type_size_bytes(aptype), be_params->stack_param_align);
unsigned const round_up = round_up2(get_type_size(aptype),
be_params->stack_param_align);
ir_mode *const offset_mode = get_reference_offset_mode(mode_P);
ir_node *const offset = new_r_Const_long(irg, offset_mode, round_up);
ir_node *const new_ap = new_rd_Add(dbgi, block, ap, offset, mode_P);
......
......@@ -229,15 +229,15 @@ static void ia32_build_between_type(void)
ret_addr_ent = new_entity(between_type, NEW_IDENT("ret_addr"), ret_addr_type);
set_entity_offset(old_bp_ent, 0);
set_entity_offset(ret_addr_ent, get_type_size_bytes(old_bp_type));
set_type_size_bytes(between_type, get_type_size_bytes(old_bp_type) + get_type_size_bytes(ret_addr_type));
set_entity_offset(ret_addr_ent, get_type_size(old_bp_type));
set_type_size(between_type, get_type_size(old_bp_type) + get_type_size(ret_addr_type));
set_type_state(between_type, layout_fixed);
omit_fp_between_type = new_type_struct(NEW_IDENT("ia32_between_type_omit_fp"));
omit_fp_ret_addr_ent = new_entity(omit_fp_between_type, NEW_IDENT("ret_addr"), ret_addr_type);
set_entity_offset(omit_fp_ret_addr_ent, 0);
set_type_size_bytes(omit_fp_between_type, get_type_size_bytes(ret_addr_type));
set_type_size(omit_fp_between_type, get_type_size(ret_addr_type));
set_type_state(omit_fp_between_type, layout_fixed);
}
}
......@@ -811,8 +811,8 @@ static void transform_MemPerm(ir_node *node)
ir_entity *inent = be_get_MemPerm_in_entity(node, i);
ir_entity *outent = be_get_MemPerm_out_entity(node, i);
ir_type *enttype = get_entity_type(inent);
unsigned entsize = get_type_size_bytes(enttype);
unsigned entsize2 = get_type_size_bytes(get_entity_type(outent));
unsigned entsize = get_type_size(enttype);
unsigned entsize2 = get_type_size(get_entity_type(outent));
ir_node *mem = get_irn_n(node, i);
/* work around cases where entities have different sizes */
......@@ -847,8 +847,8 @@ static void transform_MemPerm(ir_node *node)
ir_entity *inent = be_get_MemPerm_in_entity(node, i);
ir_entity *outent = be_get_MemPerm_out_entity(node, i);
ir_type *enttype = get_entity_type(outent);
unsigned entsize = get_type_size_bytes(enttype);
unsigned entsize2 = get_type_size_bytes(get_entity_type(inent));
unsigned entsize = get_type_size(enttype);
unsigned entsize2 = get_type_size(get_entity_type(inent));
/* work around cases where entities have different sizes */
if (entsize2 < entsize)
......@@ -1018,7 +1018,7 @@ static void introduce_epilogue(ir_node *const ret)
set_irn_n(ret, n_ebp, curr_bp);
} else {
ir_type *const frame_type = get_irg_frame_type(irg);
unsigned const frame_size = get_type_size_bytes(frame_type);
unsigned const frame_size = get_type_size(frame_type);
curr_sp = ia32_new_IncSP(block, first_sp, -(int)frame_size, 0);
sched_add_before(ret, curr_sp);
}
......@@ -1036,7 +1036,7 @@ static void introduce_prologue(ir_graph *const irg)
ir_node *start = get_irg_start(irg);
ir_node *block = get_nodes_block(start);
ir_type *frame_type = get_irg_frame_type(irg);
unsigned frame_size = get_type_size_bytes(frame_type);
unsigned frame_size = get_type_size(frame_type);
be_stack_layout_t *layout = be_get_irg_stack_layout(irg);
ir_node *initial_sp = be_get_Start_proj(irg, sp);
......@@ -1590,7 +1590,7 @@ static void init_aggregate_specs(void)
static aggregate_spec_t const *decide_compound_ret(ir_type const *type)
{
unsigned size = get_type_size_bytes(type);
unsigned size = get_type_size(type);
if (is_Array_type(type)) {
/* This is used for returning complex float numbers */
if (size == 8 && has_array_size(type) && get_array_size_int(type) == 2
......@@ -1608,7 +1608,7 @@ static aggregate_spec_t const *decide_compound_ret(ir_type const *type)
ir_entity *const member = get_compound_member(type, 0);
ir_type *const member_type = get_entity_type(member);
if (is_float(member_type)) {
unsigned member_size = get_type_size_bytes(member_type);
unsigned member_size = get_type_size(member_type);
if (member_size == 4)
return &float_spec;
if (member_size == 8)
......
......@@ -153,7 +153,7 @@ x86_cconv_t *ia32_decide_calling_convention(ir_type *function_type,
if (is_aggregate_type(param_type)) {
param->type = param_type;
param->offset = stack_offset;
stack_offset += get_type_size_bytes(param_type);
stack_offset += get_type_size(param_type);
goto align_stack;
}
......@@ -165,7 +165,7 @@ x86_cconv_t *ia32_decide_calling_convention(ir_type *function_type,
} else {
param->type = param_type;
param->offset = stack_offset;
stack_offset += get_type_size_bytes(param_type);
stack_offset += get_type_size(param_type);
align_stack:;
/* increase offset by at least IA32_REGISTER_SIZE bytes so
* everything is aligned */
......
......@@ -1688,7 +1688,7 @@ void ia32_emit_function(ir_graph *const irg)
sp_relative = layout->sp_relative;
if (layout->sp_relative) {
ir_type *frame_type = get_irg_frame_type(irg);
frame_type_size = get_type_size_bytes(frame_type);
frame_type_size = get_type_size(frame_type);
be_dwarf_callframe_register(&ia32_registers[REG_ESP]);
} else {
/* well not entirely correct here, we should emit this after the
......
......@@ -39,7 +39,7 @@ static ir_entity *create_ent(ir_entity **const dst, int value, const char *name)
if (!*dst) {
ir_mode *const mode = mode_Hu;
ir_type *const type = new_type_primitive(mode);
set_type_alignment_bytes(type, 4);
set_type_alignment(type, 4);
ir_type *const glob = get_glob_type();
ident *const id = new_id_from_str(name);
ir_entity *const ent
......
......@@ -502,14 +502,14 @@ static ir_node *gen_be_Relocation(ir_node *node)
static ir_type *make_array_type(ir_type *tp)
{
unsigned alignment = get_type_alignment_bytes(tp);
unsigned size = get_type_size_bytes(tp);
unsigned alignment = get_type_alignment(tp);
unsigned size = get_type_size(tp);
ir_type *res = new_type_array(tp);
set_type_alignment_bytes(res, alignment);
set_type_alignment(res, alignment);
set_array_size_int(res, 2);
if (alignment > size)
size = alignment;
set_type_size_bytes(res, 2 * size);
set_type_size(res, 2 * size);
set_type_state(res, layout_fixed);
return res;
}
......@@ -4902,7 +4902,7 @@ static ir_node *gen_CopyB(ir_node *node)
ir_node *mem = get_CopyB_mem(node);
ir_node *new_mem = be_transform_node(mem);
dbg_info *dbgi = get_irn_dbg_info(node);
int size = get_type_size_bytes(get_CopyB_type(node));
int size = get_type_size(get_CopyB_type(node));
int rem;
/* If we have to copy more than 32 bytes, we use REP MOVSx and */
......@@ -5004,7 +5004,7 @@ static ir_node *gen_Call(ir_node *node)
set_ia32_ls_mode(lea, ia32_mode_gp);
ir_node *const new_value = be_transform_node(value);
unsigned const size = get_type_size_bytes(param_type);
unsigned const size = get_type_size(param_type);
ir_node *const copyb = new_bd_ia32_CopyB_i(dbgi, block, lea, new_value, nomem, size);
sync_ins[sync_arity++] = be_new_Proj(copyb, pn_ia32_CopyB_i_M);
} else if (param->reg) {
......@@ -5806,11 +5806,11 @@ static ir_type *ia32_get_between_type(bool omit_fp)
between_type = new_type_class(new_id_from_str("ia32_between_type"));
/* between type contains return address + saved base pointer */
unsigned gp_size = get_mode_size_bytes(ia32_mode_gp);
set_type_size_bytes(between_type, 2*gp_size);
set_type_size(between_type, 2*gp_size);
omit_fp_between_type = new_type_class(new_id_from_str("ia32_between_type"));
/* between type contains return address */
set_type_size_bytes(omit_fp_between_type, gp_size);
set_type_size(omit_fp_between_type, gp_size);
}
return omit_fp ? omit_fp_between_type : between_type;
......@@ -5861,7 +5861,7 @@ static void ia32_create_stacklayout(ir_graph *irg, const x86_cconv_t *cconv)
set_entity_offset(va_start_entity, cconv->callframe_size);
}
set_type_size_bytes(arg_type, cconv->callframe_size);
set_type_size(arg_type, cconv->callframe_size);
be_stack_layout_t *const layout = be_get_irg_stack_layout(irg);
memset(layout, 0, sizeof(*layout));
......
......@@ -1657,6 +1657,6 @@ void x86_init_x87_type(void)
x86_mode_E = new_float_mode("E", irma_x86_extended_float, 15, 64,
ir_overflow_indefinite);
x86_type_E = new_type_primitive(x86_mode_E);
set_type_size_bytes(x86_type_E, 12);
set_type_alignment_bytes(x86_type_E, 4);
set_type_size(x86_type_E, 12);
set_type_alignment(x86_type_E, 4);
}
......@@ -561,8 +561,8 @@ static const backend_params *sparc_get_backend_params(void)
sparc_mode_Q
= new_float_mode("Q", irma_ieee754, 15, 112, ir_overflow_min_max);
ir_type *type_long_double = new_type_primitive(sparc_mode_Q);
set_type_alignment_bytes(type_long_double, 8);
set_type_size_bytes(type_long_double, 16);
set_type_alignment(type_long_double, 8);
set_type_size(type_long_double, 16);
p.type_long_double = type_long_double;
return &p;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment