- some more const's
[r18602]
obstack_free(&asm_obst, NULL);
}
obstack_free(&asm_obst, NULL);
}
+static dbg_info *get_dbg_info(const source_position_t *pos)
+{
+ return (dbg_info*) pos;
+}
+
static unsigned unique_id = 0;
static ident *unique_ident(const char *tag)
static unsigned unique_id = 0;
static ident *unique_ident(const char *tag)
if (misalign != 0)
offset += entry_alignment - misalign;
if (misalign != 0)
offset += entry_alignment - misalign;
- ir_entity *entity = new_entity(ir_type, ident, entry_ir_type);
+ dbg_info *const dbgi = get_dbg_info(&entry->source_position);
+ ir_entity *const entity = new_d_entity(ir_type, ident, entry_ir_type, dbgi);
set_entity_offset(entity, offset);
add_struct_member(ir_type, entity);
entry->declaration_type = DECLARATION_TYPE_COMPOUND_MEMBER;
set_entity_offset(entity, offset);
add_struct_member(ir_type, entity);
entry->declaration_type = DECLARATION_TYPE_COMPOUND_MEMBER;
int entry_size = get_type_size_bytes(entry_ir_type);
int entry_alignment = get_type_alignment_bytes(entry_ir_type);
int entry_size = get_type_size_bytes(entry_ir_type);
int entry_alignment = get_type_alignment_bytes(entry_ir_type);
- ir_entity *entity = new_entity(ir_type, ident, entry_ir_type);
+ dbg_info *const dbgi = get_dbg_info(&entry->source_position);
+ ir_entity *const entity = new_d_entity(ir_type, ident, entry_ir_type, dbgi);
add_union_member(ir_type, entity);
set_entity_offset(entity, 0);
entry->declaration_type = DECLARATION_TYPE_COMPOUND_MEMBER;
add_union_member(ir_type, entity);
set_entity_offset(entity, 0);
entry->declaration_type = DECLARATION_TYPE_COMPOUND_MEMBER;
ir_type *ir_type_method = get_ir_type(declaration->type);
assert(is_Method_type(ir_type_method));
ir_type *ir_type_method = get_ir_type(declaration->type);
assert(is_Method_type(ir_type_method));
- ir_entity *entity = new_entity(global_type, id, ir_type_method);
+ dbg_info *const dbgi = get_dbg_info(&declaration->source_position);
+ ir_entity *const entity = new_d_entity(global_type, id, ir_type_method, dbgi);
set_entity_ld_ident(entity, id);
if(declaration->storage_class == STORAGE_CLASS_STATIC
|| declaration->is_inline) {
set_entity_ld_ident(entity, id);
if(declaration->storage_class == STORAGE_CLASS_STATIC
|| declaration->is_inline) {
-static dbg_info *get_dbg_info(const source_position_t *pos)
-{
- return (dbg_info*) pos;
-}
-
static ir_node *const_to_firm(const const_expression_t *cnst)
{
dbg_info *dbgi = get_dbg_info(&cnst->expression.source_position);
static ir_node *const_to_firm(const const_expression_t *cnst)
{
dbg_info *dbgi = get_dbg_info(&cnst->expression.source_position);
ir_type_const_char);
ident *const id = unique_ident(id_prefix);
ir_type_const_char);
ident *const id = unique_ident(id_prefix);
- ir_entity *const entity = new_entity(global_type, id, type);
+ dbg_info *const dbgi = get_dbg_info(src_pos);
+ ir_entity *const entity = new_d_entity(global_type, id, type, dbgi);
set_entity_ld_ident(entity, id);
set_entity_variability(entity, variability_constant);
set_entity_allocation(entity, allocation_static);
set_entity_ld_ident(entity, id);
set_entity_variability(entity, variability_constant);
set_entity_allocation(entity, allocation_static);
set_array_entity_values(entity, tvs, slen);
free(tvs);
set_array_entity_values(entity, tvs, slen);
free(tvs);
- dbg_info *const dbgi = get_dbg_info(src_pos);
-
return create_symconst(dbgi, entity);
}
return create_symconst(dbgi, entity);
}
elem_type);
ident *const id = unique_ident("Lstr");
elem_type);
ident *const id = unique_ident("Lstr");
- ir_entity *const entity = new_entity(global_type, id, type);
+ dbg_info *const dbgi = get_dbg_info(&literal->expression.source_position);
+ ir_entity *const entity = new_d_entity(global_type, id, type, dbgi);
set_entity_ld_ident(entity, id);
set_entity_variability(entity, variability_constant);
set_entity_allocation(entity, allocation_static);
set_entity_ld_ident(entity, id);
set_entity_variability(entity, variability_constant);
set_entity_allocation(entity, allocation_static);
set_array_entity_values(entity, tvs, slen);
free(tvs);
set_array_entity_values(entity, tvs, slen);
free(tvs);
- dbg_info *const dbgi = get_dbg_info(&literal->expression.source_position);
-
return create_symconst(dbgi, entity);
}
return create_symconst(dbgi, entity);
}
declaration_type_t declaration_type,
ir_type *parent_type)
{
declaration_type_t declaration_type,
ir_type *parent_type)
{
- ident *id = new_id_from_str(declaration->symbol->string);
- ir_type *irtype = get_ir_type(declaration->type);
- ir_entity *entity = new_entity(parent_type, id, irtype);
+ ident *const id = new_id_from_str(declaration->symbol->string);
+ ir_type *const irtype = get_ir_type(declaration->type);
+ dbg_info *const dbgi = get_dbg_info(&declaration->source_position);
+ ir_entity *const entity = new_d_entity(parent_type, id, irtype, dbgi);
set_entity_ld_ident(entity, id);
declaration->declaration_type = (unsigned char) declaration_type;
set_entity_ld_ident(entity, id);
declaration->declaration_type = (unsigned char) declaration_type;
}
/* create a "template" entity which is copied to the entity on the stack */
}
/* create a "template" entity which is copied to the entity on the stack */
- ident *id = unique_ident("initializer");
- ir_type *irtype = get_ir_type(declaration->type);
- ir_type *global_type = get_glob_type();
- ir_entity *init_entity = new_entity(global_type, id, irtype);
+ ident *const id = unique_ident("initializer");
+ ir_type *const irtype = get_ir_type(declaration->type);
+ ir_type *const global_type = get_glob_type();
+ ir_entity *const init_entity = new_d_entity(global_type, id, irtype, dbgi);
set_entity_ld_ident(init_entity, id);
set_entity_variability(init_entity, variability_initialized);
set_entity_visibility(init_entity, visibility_local);
set_entity_allocation(init_entity, allocation_static);
set_entity_ld_ident(init_entity, id);
set_entity_variability(init_entity, variability_initialized);
set_entity_visibility(init_entity, visibility_local);
set_entity_allocation(init_entity, allocation_static);
- ir_graph *old_current_ir_graph = current_ir_graph;
+ ir_graph *const old_current_ir_graph = current_ir_graph;
current_ir_graph = get_const_code_irg();
current_ir_graph = get_const_code_irg();
- type_t *type = skip_typeref(declaration->type);
+ type_t *const type = skip_typeref(declaration->type);
create_initializer_object(initializer, type, init_entity, NULL, 0);
assert(current_ir_graph == get_const_code_irg());
current_ir_graph = old_current_ir_graph;
create_initializer_object(initializer, type, init_entity, NULL, 0);
assert(current_ir_graph == get_const_code_irg());
current_ir_graph = old_current_ir_graph;
- ir_node *src_addr = create_symconst(dbgi, init_entity);
- ir_node *copyb = new_d_CopyB(dbgi, memory, addr, src_addr, irtype);
+ ir_node *const src_addr = create_symconst(dbgi, init_entity);
+ ir_node *const copyb = new_d_CopyB(dbgi, memory, addr, src_addr, irtype);
- ir_node *copyb_mem = new_Proj(copyb, mode_M, pn_CopyB_M_regular);
+ ir_node *const copyb_mem = new_Proj(copyb, mode_M, pn_CopyB_M_regular);
{
assert(declaration->declaration_type == DECLARATION_TYPE_UNKNOWN);
{
assert(declaration->declaration_type == DECLARATION_TYPE_UNKNOWN);
- type_t *type = skip_typeref(declaration->type);
- ir_type *global_type = get_glob_type();
- ident *id = unique_ident(declaration->symbol->string);
- ir_type *irtype = get_ir_type(type);
- ir_entity *entity = new_entity(global_type, id, irtype);
+ type_t *const type = skip_typeref(declaration->type);
+ ir_type *const global_type = get_glob_type();
+ ident *const id = unique_ident(declaration->symbol->string);
+ ir_type *const irtype = get_ir_type(type);
+ dbg_info *const dbgi = get_dbg_info(&declaration->source_position);
+ ir_entity *const entity = new_d_entity(global_type, id, irtype, dbgi);
set_entity_ld_ident(entity, id);
declaration->declaration_type = DECLARATION_TYPE_GLOBAL_VARIABLE;
set_entity_ld_ident(entity, id);
declaration->declaration_type = DECLARATION_TYPE_GLOBAL_VARIABLE;
set_entity_visibility(entity, visibility_local);
set_entity_allocation(entity, allocation_static);
set_entity_visibility(entity, visibility_local);
set_entity_allocation(entity, allocation_static);
- ir_graph *old_current_ir_graph = current_ir_graph;
+ ir_graph *const old_current_ir_graph = current_ir_graph;
current_ir_graph = get_const_code_irg();
create_initializer(declaration);
current_ir_graph = get_const_code_irg();
create_initializer(declaration);