tpop_t.h 1.79 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
/*
 * Project:     libFIRM
 * File name:   ir/tr/tpop_t.h
 * Purpose:     Opcode of types -- private header.
 * Author:      Goetz Lindenmaier
 * Modified by:
 * Created:
 * CVS-ID:      $Id$
 * Copyright:   (c) 2001-2003 Universität Karlsruhe
 * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
 */
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
12

Boris Boesler's avatar
Boris Boesler committed
13

Götz Lindenmaier's avatar
Götz Lindenmaier committed
14
15
# ifndef _TPOP_T_H_
# define _TPOP_T_H_
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
16
17
18

# include <stddef.h>
# include "tpop.h"
Sebastian Felis's avatar
Sebastian Felis committed
19
/**
Michael Beck's avatar
Michael Beck committed
20
 * @file tpop_t.h
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
21
 *
Michael Beck's avatar
Michael Beck committed
22
23
24
 * This file contains the datatypes hidden in tpop.h.
 *
 * @autor Goetz Lindenmaier
Sebastian Felis's avatar
Sebastian Felis committed
25
 * @see  tpop.h
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
26
27
 */

Michael Beck's avatar
Michael Beck committed
28
/** The type opcode */
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
29
30
31
32
33
34
struct tp_op {
  tp_opcode code;
  ident *name;
  size_t attr_size;
};

Sebastian Felis's avatar
Sebastian Felis committed
35
36
/**
 *   Returns a new type opcode.
Michael Beck's avatar
Michael Beck committed
37
 *
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
38
39
40
 *   Allocates a new tp_op struct and initializes it's fields with
 *   the passed values.  This function is only to be used during
 *   initialization of the library.
Michael Beck's avatar
Michael Beck committed
41
42
43
44
45
 *
 *   @param code        the enum for this type opcode.
 *   @param name        an ident for the name of the type opcode.
 *   @param attr_size   the size of the attributes necessary for a type with
 *                      this opcode
Sebastian Felis's avatar
Sebastian Felis committed
46
47
 *   @return A new type opcode.
 *
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
48
 */
49
tp_op *new_tpop (tp_opcode code, ident *name, size_t attr_size);
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
50

Sebastian Felis's avatar
Sebastian Felis committed
51
52
/**
 *   Initialize the tpop module.
Michael Beck's avatar
Michael Beck committed
53
 *
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
54
55
56
57
58
59
60
61
 *   Must be called during the initizlization of the library. Allocates
 *   opcodes and sets the globals that are external visible as specified
 *   in tpop.h.
 *   Allocates opcodes for classes, struct, method, union, array,
 *   enumeration, pointer and primitive and sets the according values.
 */
void init_tpop (void);

Sebastian Felis's avatar
Sebastian Felis committed
62
63
/**
 *   Returns the size of the attribute to this kind
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
64
 *   of type.
Michael Beck's avatar
Michael Beck committed
65
 *
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
66
 *   Internal feature.
Michael Beck's avatar
Michael Beck committed
67
68
 *
 *   @param op  The type opcode to get the size for.
Sebastian Felis's avatar
Sebastian Felis committed
69
70
 *   @return The size of the attribute of types with this opcode.
 *
Götz Lindenmaier's avatar
new.  
Götz Lindenmaier committed
71
72
73
 */
int get_tpop_attr_size (tp_op *op);

Götz Lindenmaier's avatar
Götz Lindenmaier committed
74
#endif /* _TPOP_T_H_ */