/* res */
data->res = NEW_ARR_F(ir_node *, n_res);
for (j = n_res - 1; j >= 0; --j) {
+ ir_mode *mode = NULL;
+ /* In[0] could be a Bad node with wrong mode. */
for (i = n_ret - 1; i >= 0; --i) {
in[i] = get_Return_res(ret_arr[i], j);
+ if (!mode && get_irn_mode(in[i]) != mode_T)
+ mode = get_irn_mode(in[i]);
}
- /* Has in[0] always the valid mode? */
- data->res[j] = new_Phi(n_ret, in, get_irn_mode(in[0]));
+ assert(mode); /* @@@ else we must create a Bad node */
+ data->res[j] = new_Phi(n_ret, in, mode);
}
DEL_ARR_F(in);
}
/* Abhängigkeiten vom Start-Block und den Filter-Operationen im
* Start-Block auf den Aufrufer hinzufügen. */
-static void construct_start(entity * caller, entity * callee, ir_node * call, ir_node * exec) {
+static void construct_start(entity * caller, entity * callee,
+ ir_node * call, ir_node * exec) {
irg_data_t * data = get_entity_link(callee);
ir_graph * irg = get_entity_irg(callee);
ir_node * start = get_irg_start(irg), * filter;
+
+ assert(irg);
+ assert(get_entity_peculiarity(callee) == existent); /* Else data is not initalized. */
+ assert((0 <= data->count) &&
+ (data->count < get_Block_cg_n_cfgpreds(get_nodes_Block(start))));
set_Block_cg_cfgpred(get_nodes_Block(start), data->count, exec);
for (filter = get_irn_link(start); filter; filter = get_irn_link(filter)) {
if (get_irn_op(filter) != op_Filter) continue;
/* post_block kann bereits interprozedurale Steuerflussvorgänger
* besitzen. Diese müssen dann auch noch für den pre_block gesetzt werden. */
if (get_Block_cg_cfgpred_arr(post_block)) {
- set_Block_cg_cfgpred_arr(pre_block, get_Block_cg_n_cfgpreds(post_block), get_Block_cg_cfgpred_arr(post_block));
+ set_Block_cg_cfgpred_arr(pre_block, get_Block_cg_n_cfgpreds(post_block),
+ get_Block_cg_cfgpred_arr(post_block));
remove_Block_cg_cfgpred_arr(post_block);
}
xfprintf (F, DEFAULT_TYPE_ATTRIBUTE);
xfprintf (F, "label: ");
xfprintf (F, "\"ent %I\" " ENTITY_NODE_ATTR , get_entity_ident(ent));
- if(dynamic_allocated == get_entity_allocation(ent))
- xfprintf (F, " info1:\"dynamic allocated\n");
- else
- xfprintf (F, " info1:\"static allocated\n");
+ switch (get_entity_allocation(ent)) {
+ case dynamic_allocated: fprintf (F, " info1:\"dynamic allocated\n"); break;
+ case automatic_allocated: fprintf (F, " info1:\"automatic allocated\n"); break;
+ case static_allocated: fprintf (F, " info1:\"static allocated\n"); break;
+ }
switch (get_entity_visibility(ent)) {
case local: fprintf (F, "local\n"); break;
case external_visible: fprintf (F, "external_visible\n"); break;
- case external_allocated: fprintf (F, "external_allocate\n");break;
+ case external_allocated: fprintf (F, "external_allocate\n"); break;
}
switch (get_entity_variability(ent)) {
- case uninitialized: fprintf (F, "uninitialized");break;
- case initialized: fprintf (F, "initialized"); break;
- case part_constant: fprintf (F, "part_constant");break;
- case constant: fprintf (F, "constant"); break;
+ case uninitialized: fprintf (F, "uninitialized\n");break;
+ case initialized: fprintf (F, "initialized\n"); break;
+ case part_constant: fprintf (F, "part_constant\n");break;
+ case constant: fprintf (F, "constant\n"); break;
+ }
+ switch (get_entity_volatility(ent)) {
+ case non_volatile: fprintf (F, "non_volatile\n"); break;
+ case is_volatile: fprintf (F, "is_volatile\n"); break;
+ }
+ switch (get_entity_peculiarity(ent)) {
+ case description: fprintf (F, "description\n"); break;
+ case inherited: fprintf (F, "inherited\n"); break;
+ case existent: fprintf (F, "existent\n"); break;
}
if (is_method_type(get_entity_type(ent)))
xfprintf (F, "\n irg = %p ", get_entity_irg(ent));
}
void set_Block_cg_cfgpred(ir_node * node, int pos, ir_node * pred) {
- assert(node->op == op_Block && node->attr.block.in_cg && 0 <= pos && pos < ARR_LEN(node->attr.block.in_cg) - 1);
+ assert(node->op == op_Block &&
+ node->attr.block.in_cg &&
+ 0 <= pos && pos < ARR_LEN(node->attr.block.in_cg) - 1);
node->attr.block.in_cg[pos + 1] = pred;
}
res->types = NEW_ARR_F (type *, 1);
res->glob_type = new_type_class(id_from_str (GLOBAL_TYPE_NAME,
strlen(GLOBAL_TYPE_NAME)));
+ // @@@ Das ist hier das 2. mal!!
add_irp_type(res->glob_type);
res->const_code_irg = new_const_code_irg();
/* Adds irg to the list of ir graphs in irp. */
void add_irp_irg(ir_graph *irg);
-/* Removes irg from the list or irgs, shrinks the list by one.
- @@@ does not work properly. */
+/* Removes irg from the list of irgs, deallocates it and
+ shrinks the list by one. */
void remove_irp_irg(ir_graph *irg);
int get_irp_n_irgs();
ir_graph *get_irp_irg(int pos);
);
break;
case iro_Phi:
- /* Phi: BB x dataM^n --> dataM */
+ /* Phi: BB x dataM^n --> dataM */
/* for some reason "<=" aborts. Is there a problem with get_store? */
for (i=1; i < get_irn_arity(n); i++) {
if (!is_Bad(in[i]))