Commit aa388568 authored by Florian Liekweg's avatar Florian Liekweg
Browse files

pto_name.c

[r4659]
parent 5d4a38a9
......@@ -981,13 +981,9 @@ void ecg_report ()
FILE *dot = fopen ("calls.dot", "w");
fprintf (dot, "digraph \"calls\" {\n");
fprintf (dot, "\tgraph [rankdir=\"LR\", ordering=\"out\"];\n");
fprintf (dot, "\tnode [shape = \"record\", style = \"filled\"];\n");
fprintf (dot, "\tedge [color = \"black\"];\n");
fprintf (dot, "\n");
fprintf (dot, "\tsize = \"11, 7\";\n");
fprintf (dot, "\trotate = \"90\";\n");
fprintf (dot, "\tratio = \"fill\";\n");
fprintf (dot, "\tgraph [rankdir=\"LR\", ordering=\"out\", size=\"11, 7\", rotate=\"90\", ratio=\"fill\"];\n");
fprintf (dot, "\tnode [shape=\"record\", style=\"filled\"];\n");
fprintf (dot, "\tedge [color=\"black\"];\n");
fprintf (dot, "\n");
for (i = 0; i < get_irp_n_irgs (); i++) {
......@@ -1097,13 +1093,10 @@ void ecg_ecg ()
FILE *dot = fopen ("ecg.dot", "w");
fprintf (dot, "digraph \"ecg\" {\n");
fprintf (dot, "\tnode [shape = \"record\", style = \"filled\"];\n");
fprintf (dot, "\tedge [color = \"black\"];\n");
fprintf (dot, "\tgraph [rankdir=\"LR\", ordering=\"out\", size=\"11, 7\", rotate=\"90\", ratio=\"fill\"];\n");
fprintf (dot, "\tnode [shape=\"record\", style=\"filled\"];\n");
fprintf (dot, "\tedge [color=\"black\"];\n");
fprintf (dot, "\n");
fprintf (dot, "\tsize = \"11, 7\";\n");
fprintf (dot, "\trotate = \"90\";\n");
fprintf (dot, "\tratio = \"fill\";\n");
fprintf (dot, "\trankdir = \"LR\";\n");
fprintf (dot, "\n");
/* ir_graph *main_graph = get_irp_main_irg (); */
......@@ -1124,6 +1117,9 @@ void ecg_ecg ()
/*
$Log$
Revision 1.11 2004/12/15 09:18:18 liekweg
pto_name.c
Revision 1.10 2004/12/06 12:55:06 liekweg
actually iterate
......
......@@ -270,8 +270,12 @@ static pto_t *get_pto (ir_node *node, pto_env_t *env)
case (iro_Call): /* FALLTHROUGH */
case (iro_Load): /* FALLTHROUGH */
case (iro_Const): /* FALLTHROUGH */
case (iro_SymConst): return (get_node_pto (node));
case (iro_SymConst):{
pto_t *pto = get_node_pto (node);
assert (pto);
return (pto);
}
default:
/* stopgap measure */
fprintf (stderr, "%s: not handled: node[%li].op = %s\n",
......@@ -297,15 +301,23 @@ static void pto_load (ir_node *load, pto_env_t *pto_env)
return;
}
/* TODO: ONLY LOAD IFF LOAD.ENT.MODE == MODE_P */
entity *ent = get_ptr_ent (ptr);
pto_t *ptr_pto = get_pto (ptr, pto_env);
assert (ptr_pto);
if (mode_P == get_type_mode (get_entity_type (ent))) {
DBGPRINT (1, (stdout, "%s (%s[%li]): ptr = %p\n", __FUNCTION__,
OPNAME (ptr), OPNUM (ptr), (void*) ptr_pto));
pto_t *ptr_pto = get_pto (ptr, pto_env);
pto_env->change |= mod_load (load, ent, ptr_pto);
HERE ("ptr");
assert (ptr_pto);
DBGPRINT (1, (stdout, "%s (%s[%li]): ptr = %p\n", __FUNCTION__,
OPNAME (ptr), OPNUM (ptr), (void*) ptr_pto));
pto_env->change |= mod_load (load, ent, ptr_pto);
}
}
static void pto_store (ir_node *store, pto_env_t *pto_env)
......@@ -442,11 +454,11 @@ static void pto_graph_pass (ir_graph *graph, void *pto_env)
entity *ent = get_irg_entity (graph);
const char *ent_name = (char*) get_entity_name (ent);
const char *own_name = (char*) get_type_name (get_entity_owner (ent));
/* HERE3 ("start", own_name, ent_name); */
HERE3 ("start", own_name, ent_name);
irg_walk_mem (graph, pto_node_pre, pto_node_post, pto_env);
/* HERE3 ("end ", own_name, ent_name); */
HERE3 ("end ", own_name, ent_name);
}
/* Continue PTO for one of the graphs called at a Call */
......@@ -626,6 +638,9 @@ pto_t *get_alloc_pto (ir_node *alloc)
/*
$Log$
Revision 1.8 2004/12/15 09:18:18 liekweg
pto_name.c
Revision 1.7 2004/12/06 12:55:06 liekweg
actually iterate
......
......@@ -97,7 +97,12 @@ static pto_t* new_symconst_pto (ir_node *symconst)
entity *ent = get_SymConst_entity (symconst);
desc_t *desc = NULL;
/* ok, so if the symconst has a pointer-to-mumble, it's some address
/*
const char *ent_name = (char*) get_entity_name (ent);
const char *own_name = (char*) get_type_name (get_entity_owner (ent));
HERE3 ("start", own_name, ent_name);
*/
/* Ok, so if the symconst has a pointer-to-mumble, it's some address
calculation, but if it's the mumble itself, it's just the same,
except it's presumably a constant of mumble. In any case, we need to
branch on this. "How's that for object fucking oriented? --jwz" */
......@@ -116,6 +121,8 @@ static pto_t* new_symconst_pto (ir_node *symconst)
qset_insert (pto->values, desc);
/* HERE3 ("end", own_name, ent_name); */
return (pto);
}
......@@ -393,7 +400,7 @@ void pto_init_graph (ir_graph *graph)
const char *ent_name = (char*) get_entity_name (ent);
const char *own_name = (char*) get_type_name (get_entity_owner (ent));
DBGPRINT (1, (stdout, "%s: init \"%s.%s\" for %i ctxs\n", __FUNCTION__,
DBGPRINT (0, (stdout, "%s: init \"%s.%s\" for %i ctxs\n", __FUNCTION__,
own_name, ent_name, n_ctxs));
/* HERE ("start"); */
......@@ -422,6 +429,9 @@ void pto_reset_graph_pto (ir_graph *graph, int ctx_idx)
/*
$Log$
Revision 1.9 2004/12/15 09:18:18 liekweg
pto_name.c
Revision 1.8 2004/12/02 16:17:51 beck
fixed config.h include
......
......@@ -335,8 +335,6 @@ static void pto_name_dump_desc (desc_t *desc, FILE *stream)
}
}
} else if (array == desc->kind) {
arr_desc_t *arr_desc = (arr_desc_t*) desc;
fprintf (stream, "|<arr>[]");
} else {
assert (0 && "invalid descriptor");
......@@ -349,7 +347,7 @@ static void pto_name_dump_desc (desc_t *desc, FILE *stream)
int col_idx = desc->col_idx;
float hue = (float) col_idx / (float) last_col_idx;
float sat = 1.000; /* 0.300 .. 1.000 */
float val = 1.000; /* 0.300 .. 1.000 */
float val = 0.800; /* 0.300 .. 1.000 */
# define MAX_COLORS 12
if (last_col_idx > MAX_COLORS) {
......@@ -361,17 +359,17 @@ static void pto_name_dump_desc (desc_t *desc, FILE *stream)
col_idx = col_idx % MAX_COLORS;
hue = (float) col_idx / (float) MAX_COLORS;
}
# undef MAX_COLORS
// re-adjust sat and val
{
const float sat_min = 0.200; /* 0.200 .. 0.400 */
const float val_min = 0.300; /* 0.300 .. 0.400 */
// re-adjust sat and val
{
const float sat_min = 0.200; /* 0.200 .. 0.400 */
const float val_min = 0.300; /* 0.300 .. 0.400 */
sat = sat_min + ((1.0 - sat_min) * sat);
val = val_min + ((1.0 - val_min) * val);
sat = sat_min + ((1.0 - sat_min) * sat);
val = val_min + ((1.0 - val_min) * val);
}
}
# undef MAX_COLORS
fprintf (stream, ", color=\"%01.3f, %01.3f, %01.3f\"", hue, sat, val);
......@@ -386,6 +384,8 @@ static void pto_name_dump_desc (desc_t *desc, FILE *stream)
}
fprintf (stream, ", fontcolor=\"%s\"", fontcolor);
# else /* if defined PTO_COLOR */
fprintf (stream, ", color=\"lightgrey\"");
# endif /* defined PTO_COLOR */
/* end attributes */
......@@ -443,7 +443,7 @@ qset_t *get_entry (desc_t *desc, entity *ent)
}
assert (0 && "entry not found");
} else if (desc->kind = array) {
} else if (desc->kind == array) {
arr_desc_t *arr_desc = (arr_desc_t*) desc;
return (arr_desc->value);
......@@ -520,6 +520,10 @@ desc_t *new_ent_name (entity *ent)
tp = get_pointer_points_to_type (tp);
assert (is_class_type (tp));
DBGPRINT (2, (stdout, "%s: new name for entity \"%s\"\n", __FUNCTION__,
get_entity_name (ent)));
DBGEXE (fflush (stdout));
assert (((allocation_static == get_entity_allocation (ent)) ||
(allocation_automatic == get_entity_allocation (ent))) &&
"not a static/automatic field");
......@@ -631,6 +635,9 @@ void pto_name_cleanup ()
/*
$Log$
Revision 1.7 2004/12/15 09:18:18 liekweg
pto_name.c
Revision 1.6 2004/12/06 12:52:09 liekweg
colorize name dump
......
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