5 * File name: ir/ana2/pto.c
9 * Created: Mon 18 Oct 2004
11 * Copyright: (c) 1999-2004 Universität Karlsruhe
12 * Licence: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
25 # include "irnode_t.h"
26 # include "irprog_t.h"
28 /* # include "eset.h" */
36 # include "irmemwalk.h"
41 # endif /* not defined TRUE */
45 static void pto_node_pre (ir_node *node, void *__unused)
47 fprintf (stdout, "PRE MEM Node (0x%08x) (%s)\n",
49 get_op_name (get_irn_op (node)));
53 static void pto_node_post (ir_node *node, void *__unused)
55 const opcode op = get_irn_opcode (node);
60 ir_graph *graph = NULL;
61 fprintf (stdout, "POST MEM Call Node (0x%08x)\n",
64 ir_node *ptr = get_Call_ptr (node);
66 if (iro_Sel == get_irn_opcode (ptr)) {
67 ent = get_Sel_entity (ptr);
68 } else if (iro_SymConst == get_irn_opcode (ptr)) {
69 if (get_SymConst_kind(ptr) == symconst_addr_ent) {
70 ent = get_SymConst_entity (ptr);
75 graph = get_entity_irg (ent);
77 if (! get_irg_is_mem_visited (graph)) {
79 fprintf (stdout, " -> visit graph (0x%08x) of \"%s.%s\"\n",
81 get_type_name (get_entity_owner (get_irg_entity (graph))),
82 get_entity_name (get_irg_entity (graph)));
84 /* irg_walk_mem (graph, pto_node_pre, pto_node_post, NULL); */
85 irg_walk_mem (graph, NULL, pto_node_post, NULL);
90 fprintf (stdout, "POST MEM Node (0x%08x) (%s)\n",
92 get_op_name (get_irn_op (node)));
106 fprintf (stdout, "START PTO TEST\n");
108 for (i = 0; i < get_irp_n_irgs(); i++) {
109 ir_graph *graph = get_irp_irg (i);
111 fprintf (stdout, "START GRAPH (0x%08x) of \"%s.%s\"\n",
113 get_type_name (get_entity_owner (get_irg_entity (graph))),
114 get_entity_name (get_irg_entity (graph)));
115 /* irg_walk_mem (graph, pto_node_pre, pto_node_post, NULL); */
116 irg_walk_mem (graph, NULL, pto_node_post, NULL);
117 fprintf (stdout, "END GRAPH (0x%08x)\n", (int) graph);
120 fprintf (stdout, "END PTO TEST\n");
126 * Revision 1.2 2004/10/21 11:09:37 liekweg
127 * Moved memwalk stuf into irmemwalk
128 * Moved lset stuff into lset
129 * Moved typalise stuff into typalise
131 * Revision 1.1 2004/10/20 14:59:42 liekweg
132 * Added ana2, added ecg and pto