5 File name: ir/ana/pto.c
9 Created: Tue Nov 23 18:37:09 CET 2004
11 Copyright: (c) 1999-2004 Universität Karlsruhe
12 Licence: This file is protected by the GPL - GNU GENERAL PUBLIC LICENSE.
29 # include "irnode_t.h"
33 # include "pto_debug.h"
34 # include "pto_init.h"
35 # include "pto_name.h"
41 /* Local Data Types: */
43 /* Local Variables: */
46 /* Local Prototypes: */
48 /* ===================================================
50 =================================================== */
52 /* Helper to pto_init */
53 static void pto_init_graph_wrapper (graph_info_t *ginfo, void *_unused)
55 ir_graph *graph = ginfo->graph;
57 pto_init_graph (graph);
60 /* ===================================================
61 Exported Implementation:
62 =================================================== */
63 /* Initialise the module (not in pto_init.c because it's the entry to pto) */
64 void pto_init (int lvl)
70 /* Initialise the name module */
73 /* Initialise the init module */
76 /* allocate ctx-sens names for allocs and set ... etc etc */
77 pto_init_type_names ();
79 /* initialise all graphs with the static names */
80 ecg_iterate_graphs (pto_init_graph_wrapper, NULL);
83 spaces = (char*) xmalloc (512 * sizeof (char));
84 memset (spaces, ' ', 512);
88 /* initialise for the CTX-sensitive ecg-traversal */
89 set_curr_ctx (get_main_ctx ());
94 ir_graph *graph = get_irp_main_irg ();
96 pto_reset_graph_pto (graph, 0);
97 fake_main_args (graph);
99 DBGPRINT (1, (stdout, "START PTO\n"));
100 DBGPRINT (1, (stdout, "START GRAPH (0x%08x) of \"%s.%s\"\n",
102 get_type_name (get_entity_owner (get_irg_entity (graph))),
103 get_entity_name (get_irg_entity (graph))));
105 /* we need some kind of environment here: NULL */
106 ir_graph *save = get_current_ir_graph ();
107 pto_graph (graph, 0, NULL);
108 set_current_ir_graph (save);
110 DBGPRINT (1, (stdout, "END PTO\n"));
113 /* Dump all interesting stuff to a bunch of files */
116 pto_dump_names ("names.dot");
121 /* todo: clean up our own mess */
122 spaces -= 511; /* hope that all changes to spaces are
124 memset (spaces, 0x00, 512);
127 /* Cleanup the name module */
129 /* Cleanup the Init module */
132 /* clean up ecg infos */
139 Revision 1.14 2004/12/20 17:41:14 liekweg
142 Revision 1.13 2004/12/20 17:34:34 liekweg
143 fix recursion handling
145 Revision 1.12 2004/12/02 16:17:51 beck
146 fixed config.h include
148 Revision 1.11 2004/11/30 15:49:27 liekweg
151 Revision 1.10 2004/11/30 14:46:41 liekweg
152 Correctly reset main graph; remove dbugging stuff
154 Revision 1.9 2004/11/26 16:01:56 liekweg
155 debugging annotations
157 Revision 1.8 2004/11/24 14:54:21 liekweg
158 Added pto.c as main entry point