From 81f84c5f43e852fd1cdc9aa05a8022bb661966e4 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 9 Dec 2004 10:41:07 +0000 Subject: [PATCH] changed the hook function [r4611] --- ir/ir/irdump.c | 14 +++++++++----- ir/ir/irdump.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ir/ir/irdump.c b/ir/ir/irdump.c index 2805c00d6..724bb0a0e 100644 --- a/ir/ir/irdump.c +++ b/ir/ir/irdump.c @@ -668,17 +668,21 @@ dump_node_nodeattr(FILE *F, ir_node *n) * dumps the attributes of a node n into the file F. * Currently this is only the color of a node. */ -static void dump_node_vcgattr(FILE *F, ir_node *n, int bad) +static void dump_node_vcgattr(FILE *F, ir_node *node, ir_node *local, int bad) { + ir_node *n; + if (bad) { fprintf(F, "color: red"); return; } if (dump_node_vcgattr_hook) - if (dump_node_vcgattr_hook(F, n)) + if (dump_node_vcgattr_hook(F, node, local)) return; + n = local ? local : node; + switch (get_irn_opcode(n)) { case iro_Start: case iro_EndReg: @@ -765,7 +769,7 @@ static void dump_const_node_local(FILE *F, ir_node *n) { fprintf(F, " %ld", get_irn_node_nr(con)); fprintf(F, "\" "); bad |= dump_node_info(F, con); - dump_node_vcgattr(F, con, bad); + dump_node_vcgattr(F, n, con, bad); fprintf(F, "}\n"); } } @@ -791,7 +795,7 @@ static void dump_const_block_local(FILE *F, ir_node *n) { fprintf(F, " %ld", get_irn_node_nr(blk)); fprintf(F, "\" "); bad |= dump_node_info(F, blk); - dump_node_vcgattr(F, blk, bad); + dump_node_vcgattr(F, n, blk, bad); fprintf(F, "}\n"); fprintf (F, "edge: { sourcename: \""); @@ -836,7 +840,7 @@ static void dump_node(FILE *F, ir_node *n) fprintf(F, "\" "); bad |= dump_node_info(F, n); print_node_error(F, p); - dump_node_vcgattr(F, n, bad); + dump_node_vcgattr(F, n, NULL, bad); fprintf(F, "}\n"); dump_const_node_local(F, n); #if DO_HEAPANALYSIS diff --git a/ir/ir/irdump.h b/ir/ir/irdump.h index 5c04e9726..6db941cf0 100644 --- a/ir/ir/irdump.h +++ b/ir/ir/irdump.h @@ -47,7 +47,7 @@ * If this function returns zero, the default attributes are added, else * removed. */ -typedef int (*DUMP_NODE_VCGATTR_FUNC)(FILE *F, ir_node *n); +typedef int (*DUMP_NODE_VCGATTR_FUNC)(FILE *F, ir_node *node, ir_node *local); /** Set the node_vcgattr hook. */ void set_dump_node_vcgattr_hook(DUMP_NODE_VCGATTR_FUNC hook); -- 2.20.1