Commit 3aabd80e authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ir: Remove {is,set}_entity_compiler_generated().

For stabs debug info it was used to suppress debug info, so set ir_visibility_private instead.
parent 3212165f
......@@ -411,12 +411,6 @@ FIRM_API void set_entity_label(ir_entity *ent, ir_label_t label);
/** Returns label number of an entity with code type */
FIRM_API ir_label_t get_entity_label(const ir_entity *ent);
/** Checks if an entity is compiler generated. */
FIRM_API int is_entity_compiler_generated(const ir_entity *ent);
/** Sets/resets the compiler generated flag. */
FIRM_API void set_entity_compiler_generated(ir_entity *ent, int flag);
/**
* Bitfield type indicating the way an entity is used.
*/
......
......@@ -743,7 +743,6 @@ static void write_entity(write_env_t *env, ir_entity *ent)
write_type_ref(env, type);
if (ent->entity_kind != IR_ENTITY_LABEL)
write_type_ref(env, owner);
write_long(env, is_entity_compiler_generated(ent));
write_volatility(env, get_entity_volatility(ent));
switch ((ir_entity_kind)ent->entity_kind) {
......@@ -1784,8 +1783,7 @@ static void read_entity(read_env_t *env, ir_entity_kind kind)
if (kind != IR_ENTITY_LABEL)
owner = read_type_ref(env);
bool compiler_generated = read_long(env) != 0;
ir_volatility volatility = read_volatility(env);
ir_volatility volatility = read_volatility(env);
switch (kind) {
case IR_ENTITY_ALIAS: {
......@@ -1847,7 +1845,6 @@ static void read_entity(read_env_t *env, ir_entity_kind kind)
panic("read_entity with IR_ENTITY_UNKNOWN");
}
set_entity_compiler_generated(entity, compiler_generated);
set_entity_volatility(entity, volatility);
set_entity_visibility(entity, visibility);
set_entity_linkage(entity, linkage);
......
......@@ -406,9 +406,8 @@ ir_entity *create_Block_entity(ir_node *block)
if (entity == NULL) {
ir_label_t nr = get_irp_next_label_nr();
entity = new_label_entity(nr);
set_entity_visibility(entity, ir_visibility_local);
set_entity_visibility(entity, ir_visibility_private);
set_entity_linkage(entity, IR_LINKAGE_CONSTANT);
set_entity_compiler_generated(entity, 1);
block->attr.block.entity = entity;
}
......
......@@ -140,7 +140,6 @@ static void add_constructor(ir_entity *method)
ir_node *const val = new_r_Address(irg, method);
set_entity_ld_ident(ptr, NEW_IDENT(""));
set_entity_compiler_generated(ptr, 1);
set_entity_linkage(ptr, IR_LINKAGE_CONSTANT | IR_LINKAGE_HIDDEN_USER);
set_entity_visibility(ptr, ir_visibility_private);
set_atomic_ent_value(ptr, val);
......@@ -368,8 +367,7 @@ static ir_entity *new_array_entity(ident *name, int size)
set_type_state(array_type, layout_fixed);
ir_entity *const result = new_entity(get_glob_type(), name, array_type);
set_entity_visibility(result, ir_visibility_local);
set_entity_compiler_generated(result, 1);
set_entity_visibility(result, ir_visibility_private);
return result;
}
......@@ -391,9 +389,8 @@ static ir_entity *new_static_string_entity(ident *name, const char *string)
set_type_state(string_type, layout_fixed);
ir_entity *const result = new_entity(get_glob_type(), name, string_type);
set_entity_visibility(result, ir_visibility_local);
set_entity_visibility(result, ir_visibility_private);
set_entity_linkage(result, IR_LINKAGE_CONSTANT);
set_entity_compiler_generated(result, 1);
/* There seems to be no simpler way to do this. Or at least, cparser
* does exactly the same thing... */
......
......@@ -395,16 +395,6 @@ void remove_entity_linkage(ir_entity *entity, ir_linkage linkage)
entity->linkage &= ~linkage;
}
int (is_entity_compiler_generated)(const ir_entity *ent)
{
return _is_entity_compiler_generated(ent);
}
void (set_entity_compiler_generated)(ir_entity *ent, int flag)
{
_set_entity_compiler_generated(ent, flag);
}
ir_entity_usage (get_entity_usage)(const ir_entity *ent)
{
return _get_entity_usage(ent);
......
......@@ -20,45 +20,43 @@
#include "type_t.h"
#include "ident.h"
#define get_entity_name(ent) _get_entity_name(ent)
#define get_entity_ident(ent) _get_entity_ident(ent)
#define set_entity_ident(ent, id) _set_entity_ident(ent, id)
#define get_entity_owner(ent) _get_entity_owner(ent)
#define get_entity_ld_ident(ent) _get_entity_ld_ident(ent)
#define set_entity_ld_ident(ent, ld_ident) _set_entity_ld_ident(ent, ld_ident)
#define get_entity_ld_name(ent) _get_entity_ld_name(ent)
#define get_entity_type(ent) _get_entity_type(ent)
#define get_entity_linkage(ent) _get_entity_linkage(ent)
#define get_entity_volatility(ent) _get_entity_volatility(ent)
#define set_entity_volatility(ent, vol) _set_entity_volatility(ent, vol)
#define set_entity_alignment(ent, alignment) _set_entity_alignment(ent, alignment)
#define get_entity_alignment(ent) _get_entity_alignment(ent)
#define get_entity_align(ent) _get_entity_align(ent)
#define set_entity_align(ent, a) _set_entity_align(ent, a)
#define is_entity_compiler_generated(ent) _is_entity_compiler_generated(ent)
#define set_entity_compiler_generated(ent, flag) _set_entity_compiler_generated(ent, flag)
#define get_entity_usage(ent) _get_entity_usage(ent)
#define set_entity_usage(ent, flags) _set_entity_usage(ent, flags)
#define get_entity_initializer(ent) _get_entity_initializer(ent)
#define get_entity_offset(ent) _get_entity_offset(ent)
#define set_entity_offset(ent, offset) _set_entity_offset(ent, offset)
#define get_entity_bitfield_offset(ent) _get_entity_bitfield_offset(ent)
#define set_entity_bitfield_offset(ent, o) _set_entity_bitfield_offset(ent, o)
#define get_entity_bitfield_size(ent) _get_entity_bitfield_size(ent)
#define set_entity_bitfield_size(ent, s) _set_entity_bitfield_size(ent, s)
#define get_entity_link(ent) _get_entity_link(ent)
#define set_entity_link(ent, l) _set_entity_link(ent, l)
#define get_entity_irg(ent) _get_entity_irg(ent)
#define get_entity_linktime_irg(ent) _get_entity_linktime_irg(ent)
#define is_parameter_entity(ent) _is_parameter_entity(ent)
#define get_entity_parameter_number(ent) _get_entity_parameter_number(ent)
#define get_entity_visited(ent) _get_entity_visited(ent)
#define set_entity_visited(ent, num) _set_entity_visited(ent, num)
#define mark_entity_visited(ent) _mark_entity_visited(ent)
#define entity_visited(ent) _entity_visited(ent)
#define entity_not_visited(ent) _entity_not_visited(ent)
#define get_entity_dbg_info(ent) _get_entity_dbg_info(ent)
#define set_entity_dbg_info(ent, db) _set_entity_dbg_info(ent, db)
#define get_entity_name(ent) _get_entity_name(ent)
#define get_entity_ident(ent) _get_entity_ident(ent)
#define set_entity_ident(ent, id) _set_entity_ident(ent, id)
#define get_entity_owner(ent) _get_entity_owner(ent)
#define get_entity_ld_ident(ent) _get_entity_ld_ident(ent)
#define set_entity_ld_ident(ent, ld_ident) _set_entity_ld_ident(ent, ld_ident)
#define get_entity_ld_name(ent) _get_entity_ld_name(ent)
#define get_entity_type(ent) _get_entity_type(ent)
#define get_entity_linkage(ent) _get_entity_linkage(ent)
#define get_entity_volatility(ent) _get_entity_volatility(ent)
#define set_entity_volatility(ent, vol) _set_entity_volatility(ent, vol)
#define set_entity_alignment(ent, alignment) _set_entity_alignment(ent, alignment)
#define get_entity_alignment(ent) _get_entity_alignment(ent)
#define get_entity_align(ent) _get_entity_align(ent)
#define set_entity_align(ent, a) _set_entity_align(ent, a)
#define get_entity_usage(ent) _get_entity_usage(ent)
#define set_entity_usage(ent, flags) _set_entity_usage(ent, flags)
#define get_entity_initializer(ent) _get_entity_initializer(ent)
#define get_entity_offset(ent) _get_entity_offset(ent)
#define set_entity_offset(ent, offset) _set_entity_offset(ent, offset)
#define get_entity_bitfield_offset(ent) _get_entity_bitfield_offset(ent)
#define set_entity_bitfield_offset(ent, o) _set_entity_bitfield_offset(ent, o)
#define get_entity_bitfield_size(ent) _get_entity_bitfield_size(ent)
#define set_entity_bitfield_size(ent, s) _set_entity_bitfield_size(ent, s)
#define get_entity_link(ent) _get_entity_link(ent)
#define set_entity_link(ent, l) _set_entity_link(ent, l)
#define get_entity_irg(ent) _get_entity_irg(ent)
#define get_entity_linktime_irg(ent) _get_entity_linktime_irg(ent)
#define is_parameter_entity(ent) _is_parameter_entity(ent)
#define get_entity_parameter_number(ent) _get_entity_parameter_number(ent)
#define get_entity_visited(ent) _get_entity_visited(ent)
#define set_entity_visited(ent, num) _set_entity_visited(ent, num)
#define mark_entity_visited(ent) _mark_entity_visited(ent)
#define entity_visited(ent) _entity_visited(ent)
#define entity_not_visited(ent) _entity_not_visited(ent)
#define get_entity_dbg_info(ent) _get_entity_dbg_info(ent)
#define set_entity_dbg_info(ent, db) _set_entity_dbg_info(ent, db)
typedef struct ir_initializer_base_t {
ir_initializer_kind_t kind;
......@@ -178,7 +176,6 @@ struct ir_entity {
ENUMBF(ir_align) aligned:1; /**< Alignment of entity content. */
ENUMBF(ir_entity_usage) usage:4; /**< Usage type of entity */
ENUMBF(ir_visibility) visibility:2; /**< Visibility of entity. */
bool compiler_gen:1; /**< If set, this entity was compiler generated. */
uint16_t alignment; /**< entity alignment in bytes */
ir_visited_t visit; /**< visited counter for walks of the type
information. */
......@@ -326,18 +323,6 @@ static inline void _set_entity_aligned(ir_entity *ent, ir_align a)
ent->aligned = a;
}
static inline int _is_entity_compiler_generated(const ir_entity *ent)
{
assert(ent->kind == k_entity);
return ent->compiler_gen;
}
static inline void _set_entity_compiler_generated(ir_entity *ent, int flag)
{
assert(ent->kind == k_entity);
ent->compiler_gen = flag ? 1 : 0;
}
static inline ir_entity_usage _get_entity_usage(const ir_entity *ent)
{
assert(ent->kind == k_entity);
......
......@@ -1268,15 +1268,13 @@ ir_entity *frame_alloc_area(ir_type *frame_type, int size, unsigned alignment,
}
ir_entity *area = new_entity(frame_type, name, tp);
set_entity_visibility(area, ir_visibility_private);
set_entity_offset(area, offset);
set_type_size_bytes(frame_type, frame_size);
if (alignment > frame_align) {
set_type_alignment_bytes(frame_type, alignment);
}
/* mark this entity as compiler generated */
set_entity_compiler_generated(area, 1);
set_type_state(frame_type, layout_fixed);
return area;
}
......
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