1 /* Copyright (C) 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Goetz Lindenmaier
6 ** irprog.h: ir representation of a program
8 ** This file defines a construct that keeps all information about a
10 ** - A list of all procedures.
11 ** - A list of all types.
12 ** - A global type that can be thought of as a god-class containing all
13 ** global variables and procedures. This is not the base class of
14 ** all classes in a class hierarchy (as, e.g., "object" in java).
15 ** - An obstack containing global things, e.g., the above mentioned lists.
23 /*# include "obst.h"*/
25 typedef struct ir_prog {
27 ir_graph **graphs; /* all graphs in the ir */
28 type **types; /* all types in the ir */
29 type_class *glob_type; /* global type. Class as it can have
30 fields and procedures. Does this work?
32 /*struct obstack *obst; * @@@ Should we place all types and entities themselves
33 on an obstack, too? */
36 /* A variable from where everything in the ir can be accessed. */
39 /* initializes ir_prog. Calles the constructor for an ir_prog. */
40 void init_irprog(void);
42 /* Creates a new ir_prog, returns it and sets irp with it.
43 Automatically called by init_firm through init_prog. */
44 ir_prog *new_ir_prog (void);
47 /** Functions to access the fields of ir_prog **/
48 type_class *get_glob_type(void);
50 /* Adds irg to the list of ir graphs in irp. */
51 void add_irp_irg(ir_graph *irg);
52 /* Adds type to the list of types in irp. */
53 void add_irp_type(type *typ);
55 #endif /* ifndef _IRPROG_H_ */