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

backend_marked was a buggy/wrong concept, removed it

[r27032]
parent c27a52c7
......@@ -366,12 +366,6 @@ int is_entity_compiler_generated(const ir_entity *ent);
/** Sets/resets the compiler generated flag. */
void set_entity_compiler_generated(ir_entity *ent, int flag);
/** Checks if an entity is marked by the backend. */
int is_entity_backend_marked(const ir_entity *ent);
/** Sets/resets the backend marker flag. */
void set_entity_backend_marked(ir_entity *ent, int flag);
/**
* Bitfield type indicating the way an entity is used.
*/
......
......@@ -242,7 +242,7 @@ static void TEMPLATE_done(void *self)
TEMPLATE_isa_t *isa = self;
/* emit now all global declarations */
be_gas_emit_decls(isa->arch_env.main_env, 0);
be_gas_emit_decls(isa->arch_env.main_env);
be_emit_exit();
free(self);
......
......@@ -336,8 +336,6 @@ static void emit_arm_SymConst(const ir_node *irn)
sym_or_tv_t key, *entry;
unsigned label;
set_entity_backend_marked(attr->entity, 1);
key.u.id = get_entity_ld_ident(attr->entity);
key.is_ident = 1;
key.label = 0;
......@@ -746,7 +744,6 @@ static void emit_arm_SwitchJmp(const ir_node *irn) {
static void arm_emit_entity(ir_entity *entity)
{
set_entity_backend_marked(entity, 1);
be_emit_ident(get_entity_ld_ident(entity));
}
......
......@@ -729,7 +729,7 @@ static arch_env_t *arm_init(FILE *file_handle) {
static void arm_done(void *self) {
arm_isa_t *isa = self;
be_gas_emit_decls(isa->arch_env.main_env, 1);
be_gas_emit_decls(isa->arch_env.main_env);
be_emit_exit();
free(self);
......
......@@ -37,7 +37,6 @@
#include "tv.h"
#include "irnode.h"
#include "irprog.h"
#include "pdeq.h"
#include "entity_t.h"
#include "error.h"
......@@ -48,7 +47,7 @@
/** by default, we generate assembler code for the Linux gas */
object_file_format_t be_gas_object_file_format = OBJECT_FILE_FORMAT_ELF;
bool be_gas_emit_types = true;
char be_gas_elf_type_char = '@';
char be_gas_elf_type_char = '@';
static be_gas_section_t current_section = (be_gas_section_t) -1;
......@@ -223,8 +222,7 @@ void be_gas_emit_function_epilog(ir_entity *entity)
*/
typedef struct _be_gas_decl_env {
be_gas_section_t section;
waitq *worklist; /**< A worklist we use to place not yet handled entities on. */
const be_main_env_t *main_env;
const be_main_env_t *main_env;
} be_gas_decl_env_t;
/************************************************************************/
......@@ -406,10 +404,6 @@ static void do_dump_atomic_init(be_gas_decl_env_t *env, ir_node *init)
case symconst_addr_ent:
ent = get_SymConst_entity(init);
if (!is_entity_backend_marked(ent)) {
waitq_put(env->worklist, ent);
set_entity_backend_marked(ent, 1);
}
be_gas_emit_entity(ent);
break;
......@@ -1266,48 +1260,21 @@ static void dump_global(be_gas_decl_env_t *env, const ir_entity *ent)
*
* @param gt a global like type, either the global or the TLS one
* @param env an environment
* @param only_emit_marked if non-zero, external allocated entities that do not have
* its visited flag set are ignored
*/
static void be_gas_dump_globals(ir_type *gt, be_gas_decl_env_t *env,
int only_emit_marked)
static void be_gas_dump_globals(ir_type *gt, be_gas_decl_env_t *env)
{
int i, n = get_compound_n_members(gt);
waitq *worklist = new_waitq();
if (only_emit_marked) {
for (i = 0; i < n; i++) {
ir_entity *ent = get_compound_member(gt, i);
if (is_entity_backend_marked(ent) || entity_has_definition(ent)) {
waitq_put(worklist, ent);
set_entity_backend_marked(ent, 1);
}
}
} else {
for (i = 0; i < n; i++) {
ir_entity *ent = get_compound_member(gt, i);
set_entity_backend_marked(ent, 1);
waitq_put(worklist, ent);
}
}
env->worklist = worklist;
while (!waitq_empty(worklist)) {
ir_entity *ent = waitq_get(worklist);
for (i = 0; i < n; i++) {
ir_entity *ent = get_compound_member(gt, i);
dump_global(env, ent);
}
del_waitq(worklist);
env->worklist = NULL;
}
/************************************************************************/
/* Generate all entities. */
void be_gas_emit_decls(const be_main_env_t *main_env,
int only_emit_marked_entities)
void be_gas_emit_decls(const be_main_env_t *main_env)
{
be_gas_decl_env_t env;
memset(&env, 0, sizeof(env));
......@@ -1316,16 +1283,12 @@ void be_gas_emit_decls(const be_main_env_t *main_env,
env.main_env = main_env;
env.section = (be_gas_section_t) -1;
be_gas_dump_globals(get_glob_type(), &env, only_emit_marked_entities);
be_gas_dump_globals(get_tls_type(), &env, only_emit_marked_entities);
be_gas_dump_globals(get_segment_type(IR_SEGMENT_CONSTRUCTORS), &env,
only_emit_marked_entities);
be_gas_dump_globals(get_segment_type(IR_SEGMENT_DESTRUCTORS), &env,
only_emit_marked_entities);
be_gas_dump_globals(main_env->pic_symbols_type, &env,
only_emit_marked_entities);
be_gas_dump_globals(main_env->pic_trampolines_type, &env,
only_emit_marked_entities);
be_gas_dump_globals(get_glob_type(), &env);
be_gas_dump_globals(get_tls_type(), &env);
be_gas_dump_globals(get_segment_type(IR_SEGMENT_CONSTRUCTORS), &env);
be_gas_dump_globals(get_segment_type(IR_SEGMENT_DESTRUCTORS), &env);
be_gas_dump_globals(main_env->pic_symbols_type, &env);
be_gas_dump_globals(main_env->pic_trampolines_type, &env);
/**
* ".subsections_via_symbols marks object files which are OK to divide
......
......@@ -65,11 +65,8 @@ extern char be_gas_elf_type_char;
* Generate all entities.
* @param main_env the main backend environment
* @param emit_commons if non-zero, emit commons (non-local uninitialized entities)
* @param only_emit_marked if non-zero, external allocated entities that do not have
* its visited flag set are ignored
*/
void be_gas_emit_decls(const be_main_env_t *main_env,
int only_emit_marked_entities);
void be_gas_emit_decls(const be_main_env_t *main_env);
/**
* Emit an entity (the entities name or a block label)
......
......@@ -1732,7 +1732,7 @@ static void ia32_done(void *self)
ia32_isa_t *isa = self;
/* emit now all global declarations */
be_gas_emit_decls(isa->arch_env.main_env, 1);
be_gas_emit_decls(isa->arch_env.main_env);
pmap_destroy(isa->regs_16bit);
pmap_destroy(isa->regs_8bit);
......
......@@ -282,7 +282,6 @@ void ia32_emit_source_register(const ir_node *node, int pos)
static void ia32_emit_entity(ir_entity *entity, int no_pic_adjust)
{
set_entity_backend_marked(entity, 1);
be_gas_emit_entity(entity);
if (get_entity_owner(entity) == get_tls_type()) {
......@@ -2415,7 +2414,6 @@ static void bemit_entity(ir_entity *entity, bool entity_sign, int offset,
be_emit_cstring("\t.long ");
if (entity_sign)
be_emit_char('-');
set_entity_backend_marked(entity, 1);
be_gas_emit_entity(entity);
if (get_entity_owner(entity) == get_tls_type()) {
......
......@@ -357,7 +357,7 @@ static void mips_done(void *self)
{
mips_isa_t *isa = self;
be_gas_emit_decls(isa->arch_env.main_env, 1);
be_gas_emit_decls(isa->arch_env.main_env);
be_emit_exit();
free(isa);
......
......@@ -504,7 +504,6 @@ static void ppc32_collect_symconsts_walk(ir_node *node, void *env) {
if (is_SymConst(node)) {
ir_entity *ent = get_SymConst_entity(node);
set_entity_backend_marked(ent, 1);
pset_insert_ptr(symbol_set, ent);
}
}
......@@ -561,7 +560,7 @@ static void ppc32_dump_indirect_symbols(ppc32_isa_t *isa) {
static void ppc32_done(void *self) {
ppc32_isa_t *isa = self;
be_gas_emit_decls(isa->arch_env.main_env, 1);
be_gas_emit_decls(isa->arch_env.main_env);
be_gas_emit_switch_section(GAS_SECTION_DATA);
ppc32_dump_indirect_symbols(isa);
......
......@@ -257,7 +257,6 @@ static void emit_be_Call(const ir_node *irn) {
ir_entity *call_ent = be_Call_get_entity(irn);
if (call_ent) {
set_entity_backend_marked(call_ent, 1);
be_emit_irprintf("\tbl %s", get_entity_ld_name(call_ent));
} else {
be_emit_cstring("\tmtlr ");
......
......@@ -389,7 +389,7 @@ static void sparc_done(void *self)
sparc_isa_t *isa = self;
/* emit now all global declarations */
be_gas_emit_decls(isa->arch_env.main_env, 0);
be_gas_emit_decls(isa->arch_env.main_env);
be_emit_exit();
free(self);
......
......@@ -223,7 +223,6 @@ static void sparc_emit_cfop_target(const ir_node *node)
*/
static void sparc_emit_entity(ir_entity *entity)
{
set_entity_backend_marked(entity, 1);
be_emit_ident(get_entity_ld_ident(entity));
}
......
......@@ -113,7 +113,6 @@ new_rd_entity(dbg_info *db, ir_type *owner, ident *name, ir_type *type)
res->aligned = align_is_aligned;
res->usage = ir_usage_unknown;
res->compiler_gen = 0;
res->backend_marked = 0;
res->offset = -1;
res->offset_bit_remainder = 0;
res->alignment = 0;
......@@ -479,16 +478,6 @@ void (set_entity_compiler_generated)(ir_entity *ent, int flag) {
_set_entity_compiler_generated(ent, flag);
} /* set_entity_compiler_generated */
/* Checks if an entity is marked by the backend */
int (is_entity_backend_marked)(const ir_entity *ent) {
return _is_entity_backend_marked(ent);
} /* is_entity_backend_marked */
/* Sets/resets the compiler generated flag */
void (set_entity_backend_marked)(ir_entity *ent, int flag) {
_set_entity_backend_marked(ent, flag);
} /* set_entity_backend_marked */
ir_entity_usage (get_entity_usage)(const ir_entity *ent) {
return _get_entity_usage(ent);
}
......
......@@ -126,8 +126,6 @@ struct ir_entity {
see ir_entity_usage. */
unsigned compiler_gen:1; /**< If set, this entity was compiler generated.
*/
unsigned backend_marked:1; /**< If set, this entity was marked by the
backend for emission. */
unsigned visibility:3; /**< @deprecated */
unsigned allocation:3; /**< @deprecated */
unsigned peculiarity:3; /**< @deprecated */
......@@ -293,18 +291,6 @@ _set_entity_compiler_generated(ir_entity *ent, int flag) {
ent->compiler_gen = flag ? 1 : 0;
}
static inline int
_is_entity_backend_marked(const ir_entity *ent) {
assert(ent && ent->kind == k_entity);
return ent->backend_marked;
}
static inline void
_set_entity_backend_marked(ir_entity *ent, int flag) {
assert(ent && ent->kind == k_entity);
ent->backend_marked = flag ? 1 : 0;
}
static inline ir_entity_usage
_get_entity_usage(const ir_entity *ent) {
assert(ent && ent->kind == k_entity);
......@@ -432,8 +418,6 @@ int is_entity_final(const ir_entity *entity);
#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 is_entity_backend_marked(ent) _is_entity_backend_marked(ent)
#define set_entity_backend_marked(ent, flag) _set_entity_backend_marked(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_offset(ent) _get_entity_offset(ent)
......
Supports Markdown
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