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