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.
31 # include "pto_debug.h"
32 # include "pto_init.h"
33 # include "pto_name.h"
39 /* Local Data Types: */
41 /* Local Variables: */
44 /* Local Prototypes: */
46 /* ===================================================
48 =================================================== */
50 /* Helper to pto_init */
51 static void pto_init_graph_wrapper (graph_info_t *ginfo, void *__unused)
53 ir_graph *graph = ginfo->graph;
55 pto_init_graph (graph);
58 /* ===================================================
59 Exported Implementation:
60 =================================================== */
61 /* Initialise the module (not in pto_init.c because it's the entry to pto) */
62 void pto_init (int lvl)
69 /* Initialise the name module */
71 /* Initialise the init module */
74 /* allocate ctx-sens names for allocs and set ... etc etc */
75 pto_init_type_names ();
77 /* initialise all graphs with the static names */
78 ecg_iterate_graphs (pto_init_graph_wrapper, NULL);
81 spaces = (char*) xmalloc (512 * sizeof (char));
82 memset (spaces, ' ', 512);
86 /* initialise for the CTX-sensitive ecg-traversal */
87 set_curr_ctx (get_main_ctx ());
95 ir_graph *graph = get_irp_main_irg ();
96 fake_main_args (graph);
98 DBGPRINT (0, (stdout, "START PTO\n"));
99 DBGPRINT (0, (stdout, "START GRAPH (0x%08x) of \"%s.%s\"\n",
101 get_type_name (get_entity_owner (get_irg_entity (graph))),
102 get_entity_name (get_irg_entity (graph))));
104 /* do we need some kind of environment here? */
105 pto_graph (graph, 0);
107 DBGPRINT (0, (stdout, "END PTO\n"));
114 /* todo: clean up our own mess */
115 spaces -= 511; /* hope that all changes to spaces are
117 memset (spaces, 0x00, 512);
120 /* Cleanup the name module */
122 /* Cleanup the Init module */
125 /* clean up ecg infos */
133 Revision 1.8 2004/11/24 14:54:21 liekweg
134 Added pto.c as main entry point