Beispiel #1
0
/**
 * Free entity attributes.
 *
 * @param ent  the entity
 */
static void free_entity_attrs(ir_entity *ent)
{
	if (ent->overwrites != NULL) {
		DEL_ARR_F(ent->overwrites);
		ent->overwrites = NULL;
	}
	if (ent->overwrittenby != NULL) {
		DEL_ARR_F(ent->overwrittenby);
		ent->overwrittenby = NULL;
	}

	if (ent->initializer != NULL) {
		/* TODO: free initializers */
	}
	if (ent->entity_kind == IR_ENTITY_METHOD) {
		if (ent->attr.mtd_attr.param_access) {
			DEL_ARR_F(ent->attr.mtd_attr.param_access);
			ent->attr.mtd_attr.param_access = NULL;
		}
		if (ent->attr.mtd_attr.param_weight) {
			DEL_ARR_F(ent->attr.mtd_attr.param_weight);
			ent->attr.mtd_attr.param_weight = NULL;
		}
	}
}
Beispiel #2
0
void lower_CopyB(ir_graph *irg, unsigned max_small_sz, unsigned min_large_sz,
                 int allow_misaligns)
{
	const backend_params *bparams = be_get_backend_param();

	assert(max_small_sz < min_large_sz && "CopyB size ranges must not overlap");

	max_small_size      = max_small_sz;
	min_large_size      = min_large_sz;
	native_mode_bytes   = bparams->machine_size / 8;
	allow_misalignments = allow_misaligns;

	walk_env_t env = { .copybs = NEW_ARR_F(ir_node*, 0) };
	irg_walk_graph(irg, NULL, find_copyb_nodes, &env);

	bool changed = false;
	for (size_t i = 0, n = ARR_LEN(env.copybs); i != n; ++i) {
		lower_copyb_node(env.copybs[i]);
		changed = true;
	}
	confirm_irg_properties(irg, changed ? IR_GRAPH_PROPERTIES_CONTROL_FLOW
	                                    : IR_GRAPH_PROPERTIES_ALL);

	DEL_ARR_F(env.copybs);
}
Beispiel #3
0
/**
 * Free memory associated with a quadruplet.
 */
static void kill_entry(entry_t *entry)
{
	if (entry->q.calls) {
		DEL_ARR_F(entry->q.calls);
		entry->q.calls = NULL;
	}
}
Beispiel #4
0
void finish_mode(void)
{
    obstack_free(&modes, 0);
    DEL_ARR_F(mode_list);

    mode_T   = NULL;
    mode_X   = NULL;
    mode_M   = NULL;
    mode_BB  = NULL;
    mode_ANY = NULL;
    mode_BAD = NULL;

    mode_F   = NULL;
    mode_D   = NULL;

    mode_Bs  = NULL;
    mode_Bu  = NULL;
    mode_Hs  = NULL;
    mode_Hu  = NULL;
    mode_Is  = NULL;
    mode_Iu  = NULL;
    mode_Ls  = NULL;
    mode_Lu  = NULL;

    mode_b   = NULL;

    mode_P   = NULL;
}
Beispiel #5
0
/**
 * Frees an allocated IR graph
 */
static void free_graph(ir_graph *irg)
{
	for (ir_edge_kind_t i = EDGE_KIND_FIRST; i <= EDGE_KIND_LAST; ++i)
		edges_deactivate_kind(irg, i);
	DEL_ARR_F(irg->idx_irn_map);
	free(irg);
}
Beispiel #6
0
void exit_temp_files(void)
{
	if (temp_files == NULL)
		return;

	size_t n_temp_files = ARR_LEN(temp_files);
	size_t i;
	for (i = 0; i < n_temp_files; ++i) {
		char *file = temp_files[i];
		unlink(file);
	}
	DEL_ARR_F(temp_files);
	temp_files = NULL;

	if (tempsubdir != NULL) {
		remove(tempsubdir);
		tempsubdir = NULL;
	}

	obstack_free(&file_obst, NULL);
}
Beispiel #7
0
void edge_bucket_free(pbqp_edge_bucket_t *bucket)
{
	DEL_ARR_F(*bucket);
	*bucket = NULL;
}
Beispiel #8
0
void exit_type_module()
{
	DEL_ARR_F(typevar_binding_stack);
	obstack_free(type_obst, NULL);
}
Beispiel #9
0
void exit_tokens(void)
{
	DEL_ARR_F(token_symbols);
	token_symbols = NULL;
}