Some doxygen comments added
[libfirm] / ir / ir / irop_t.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ir/irop_t.h
4  * Purpose:     Representation of opcode of intermediate operation -- private header.
5  * Author:      Christian Schaefer
6  * Modified by: Goetz Lindenmaier
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 1998-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13
14 # ifndef _IROP_T_H_
15 # define _IROP_T_H_
16
17 # include "irop.h"
18
19 typedef enum {
20   oparity_invalid = 0,
21   oparity_unary,              /**< an unary operator -- considering 'numeric' arguments. */
22   oparity_binary,             /**< an binary operator  -- considering 'numeric' arguments.*/
23   oparity_trinary,            /**< an trinary operator  -- considering 'numeric' arguments.*/
24   oparity_zero,               /**< no operators, as e.g. Const. */
25   oparity_variable,           /**< arity not fixed by opcode, but statically
26                                  known.  E.g., number of arguments to call. */
27   oparity_dynamic,            /**< arity depends on state of firm representation.
28                                  Can change by optimizations...
29                                  We must allocate a dynamic in array for the node! */
30   oparity_any,                /**< other arity */
31 } op_arity;
32
33
34 /** the type of an ir_op */
35 struct ir_op {
36   opcode code;            /**< the unique opcode of the op */
37   ident *name;            /**< the name of the op */
38   size_t attr_size;       /**< Space needed in memory for private attributes */
39   int labeled;            /**< Output edge labels on in-edges in vcg graph */
40   op_pinned pinned;       /**< How to deal with the node in cse, pre. */
41   op_arity opar;          /**< arity of operator. */
42 };
43
44 /**
45  * Create a new ir operation.
46  *
47  * @param code     the opcode, one of type \c opcode
48  * @param name     the printable name of this opcode
49  * @param p        wheater operations of this opcode are pinned or floating
50  * @param labeled  if set, output edge labels on in-edges in vcg graph wil be generated
51  *
52  * @return The genenerated ir operation.
53  */
54 ir_op * new_ir_op (opcode code, const char *name, op_pinned p,
55                    int labeled, op_arity opar, size_t attr_size);
56
57 /** Initialize the irop module. */
58 void init_op (void);
59
60 /** Free memory used by irop module. */
61 void finish_op(void);
62
63 #endif /* _IROP_T_H_ */