libFirm
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
irop.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
3
*
4
* This file is part of libFirm.
5
*
6
* This file may be distributed and/or modified under the terms of the
7
* GNU General Public License version 2 as published by the Free Software
8
* Foundation and appearing in the file LICENSE.GPL included in the
9
* packaging of this file.
10
*
11
* Licensees holding valid libFirm Professional Edition licenses may use
12
* this file in accordance with the libFirm Commercial License.
13
* Agreement provided with the Software.
14
*
15
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
* PURPOSE.
18
*/
19
26
#ifndef FIRM_IR_IROP_H
27
#define FIRM_IR_IROP_H
28
29
#include <stdio.h>
30
#include "
firm_types.h
"
31
#include "
ident.h
"
32
#include "
begin.h
"
33
#include "opcodes.h"
34
47
typedef
enum
{
48
oparity_invalid = 0,
49
oparity_unary
,
50
oparity_binary
,
51
oparity_trinary
,
52
oparity_zero
,
53
oparity_variable
,
55
oparity_dynamic
,
58
oparity_any
59
}
op_arity
;
60
61
63
typedef
enum
{
64
irop_flag_none
= 0,
65
irop_flag_commutative
= 1U << 0,
66
irop_flag_cfopcode
= 1U << 1,
67
irop_flag_fragile
= 1U << 2,
70
irop_flag_forking
= 1U << 3,
71
irop_flag_highlevel
= 1U << 4,
73
irop_flag_constlike
= 1U << 5,
75
irop_flag_keep
= 1U << 6,
76
irop_flag_start_block
= 1U << 7,
77
irop_flag_uses_memory
= 1U << 8,
78
irop_flag_dump_noblock
= 1U << 9,
79
irop_flag_cse_neutral
= 1U << 10,
83
irop_flag_unknown_jump
= 1U << 11,
84
}
irop_flags
;
85
ENUM_BITSET
(
irop_flags
)
86
87
88
FIRM_API
ident
*
get_op_ident
(const
ir_op
*op);
89
91
FIRM_API
const
char
*
get_op_name
(const
ir_op
*op);
92
94
FIRM_API
unsigned
get_op_code
(const
ir_op
*op);
95
97
FIRM_API
const
char
*
get_op_pin_state_name
(
op_pin_state
s);
98
100
FIRM_API
op_pin_state
get_op_pinned
(const
ir_op
*op);
101
104
FIRM_API
void
set_op_pinned
(
ir_op
*op,
op_pin_state
pinned);
105
107
FIRM_API
unsigned
get_next_ir_opcode
(
void
);
108
110
FIRM_API
unsigned
get_next_ir_opcodes
(
unsigned
num);
111
115
typedef
void
(*
op_func
)(
void
);
116
118
#define NULL_FUNC ((generic_func)(NULL))
119
123
FIRM_API
op_func
get_generic_function_ptr
(
const
ir_op
*op);
124
128
FIRM_API
void
set_generic_function_ptr
(
ir_op
*op,
op_func
func);
129
133
FIRM_API
irop_flags
get_op_flags
(
const
ir_op
*op);
134
139
typedef
unsigned (*
hash_func
)(
const
ir_node
*
self
);
140
146
typedef
ir_tarval
*(*computed_value_func)(
const
ir_node
*
self
);
147
156
typedef
ir_node
*(*equivalent_node_func)(
ir_node
*
self
);
157
166
typedef
ir_node
*(*transform_node_func)(
ir_node
*
self
);
167
173
typedef
int (*
node_cmp_attr_func
)(
const
ir_node
*a,
const
ir_node
*b);
174
182
typedef
int (*
reassociate_func
)(
ir_node
**n);
183
188
typedef
void (*
copy_attr_func
)(
ir_graph
*irg,
const
ir_node
*old_node,
ir_node
*new_node);
189
195
typedef
ir_type
*(*get_type_attr_func)(
const
ir_node
*
self
);
196
202
typedef
ir_entity
*(*get_entity_attr_func)(
const
ir_node
*
self
);
203
211
typedef
int (*
verify_node_func
)(
const
ir_node
*node);
212
220
typedef
int (*
verify_proj_node_func
)(
const
ir_node
*proj);
221
225
typedef
enum
{
226
dump_node_opcode_txt
,
227
dump_node_mode_txt
,
228
dump_node_nodeattr_txt
,
229
dump_node_info_txt
230
}
dump_reason_t
;
231
237
typedef
void (*
dump_node_func
)(FILE *out,
const
ir_node
*
self
,
dump_reason_t
reason);
238
242
typedef
struct
{
243
hash_func
hash
;
244
computed_value_func
computed_value
;
245
computed_value_func
computed_value_Proj
;
246
equivalent_node_func
equivalent_node
;
247
equivalent_node_func
equivalent_node_Proj
;
248
transform_node_func
transform_node
;
249
transform_node_func
transform_node_Proj
;
250
node_cmp_attr_func
node_cmp_attr
;
251
reassociate_func
reassociate
;
252
copy_attr_func
copy_attr
;
253
get_type_attr_func
get_type_attr
;
254
get_entity_attr_func
get_entity_attr
;
255
verify_node_func
verify_node
;
256
verify_proj_node_func
verify_proj_node
;
257
dump_node_func
dump_node
;
258
op_func
generic
;
259
op_func
generic1
;
260
op_func
generic2
;
261
const
arch_irn_ops_t
*
be_ops
;
262
}
ir_op_ops
;
263
281
FIRM_API
ir_op
*
new_ir_op
(
unsigned
code,
const
char
*name,
op_pin_state
p,
282
irop_flags
flags,
op_arity
opar,
int
op_index,
283
size_t
attr_size);
284
286
FIRM_API
unsigned
ir_get_n_opcodes
(
void
);
287
294
FIRM_API
ir_op
*
ir_get_opcode
(
unsigned
code);
295
297
FIRM_API
void
ir_clear_opcodes_generic_func
(
void
);
298
302
FIRM_API
void
ir_op_set_memory_index
(
ir_op
*op,
int
memory_index);
303
308
FIRM_API
void
ir_op_set_fragile_indices
(
ir_op
*op,
int
pn_x_regular,
309
int
pn_x_except);
310
312
FIRM_API
ir_op_ops
*
get_op_ops
(
ir_op
*op);
313
316
#include "
end.h
"
317
318
#endif
libfirm
irop.h
Generated on Sat Nov 24 2012 19:13:48 for libFirm by
1.8.1.2