init nr field for debug dump output
[libfirm] / ir / tr / tpop_t.h
1 /*   (C) 2001 by Universitaet Karlsruhe  */
2
3 /* $Id$ */
4
5 # ifndef _TPOP_T_H_
6 # define _TPOP_T_H_
7
8 # include <stddef.h>
9 # include "tpop.h"
10 /**
11  * @file tpop_t.h
12  *
13  * This file contains the datatypes hidden in tpop.h.
14  *
15  * @autor Goetz Lindenmaier
16  * @see  tpop.h
17  */
18
19 /** The type opcode */
20 struct tp_op {
21   tp_opcode code;
22   ident *name;
23   size_t attr_size;
24 };
25
26 /**
27  *   Returns a new type opcode.
28  *
29  *   Allocates a new tp_op struct and initializes it's fields with
30  *   the passed values.  This function is only to be used during
31  *   initialization of the library.
32  *
33  *   @param code        the enum for this type opcode.
34  *   @param name        an ident for the name of the type opcode.
35  *   @param attr_size   the size of the attributes necessary for a type with
36  *                      this opcode
37  *   @return A new type opcode.
38  *
39  */
40 tp_op * new_tpop (tp_opcode code, ident *name, size_t attr_size);
41
42 /**
43  *   Initialize the tpop module.
44  *
45  *   Must be called during the initizlization of the library. Allocates
46  *   opcodes and sets the globals that are external visible as specified
47  *   in tpop.h.
48  *   Allocates opcodes for classes, struct, method, union, array,
49  *   enumeration, pointer and primitive and sets the according values.
50  */
51 void init_tpop (void);
52
53 /**
54  *   Returns the size of the attribute to this kind
55  *   of type.
56  *
57  *   Internal feature.
58  *
59  *   @param op  The type opcode to get the size for.
60  *   @return The size of the attribute of types with this opcode.
61  *
62  */
63 int get_tpop_attr_size (tp_op *op);
64
65 #endif /* _TPOP_T_H_ */