1 #ifndef ISL_AST_PRIVATE_H
2 #define ISL_AST_PRIVATE_H
11 /* An expression is either an integer, an identifier or an operation
12 * with zero or more arguments.
19 enum isl_ast_expr_type type
;
25 enum isl_ast_op_type op
;
33 #define EL isl_ast_expr
35 #include <isl_list_templ.h>
37 __isl_give isl_ast_expr
*isl_ast_expr_alloc_int_si(isl_ctx
*ctx
, int i
);
38 __isl_give isl_ast_expr
*isl_ast_expr_alloc_op(isl_ctx
*ctx
,
39 enum isl_ast_op_type op
, int n_arg
);
40 __isl_give isl_ast_expr
*isl_ast_expr_alloc_binary(enum isl_ast_op_type type
,
41 __isl_take isl_ast_expr
*expr1
, __isl_take isl_ast_expr
*expr2
);
44 #define EL isl_ast_node
46 #include <isl_list_templ.h>
48 /* A node is either a block, an if, a for, a user node or a mark node.
49 * "else_node" is NULL if the if node does not have an else branch.
50 * "cond" and "inc" are NULL for degenerate for nodes.
51 * In case of a mark node, "mark" is the mark and "node" is the marked node.
57 enum isl_ast_node_type type
;
61 isl_ast_node_list
*children
;
66 isl_ast_node
*else_node
;
69 unsigned degenerate
: 1;
70 isl_ast_expr
*iterator
;
88 __isl_give isl_ast_node
*isl_ast_node_alloc_for(__isl_take isl_id
*id
);
89 __isl_give isl_ast_node
*isl_ast_node_for_mark_degenerate(
90 __isl_take isl_ast_node
*node
);
91 __isl_give isl_ast_node
*isl_ast_node_alloc_if(__isl_take isl_ast_expr
*guard
);
92 __isl_give isl_ast_node
*isl_ast_node_alloc_block(
93 __isl_take isl_ast_node_list
*list
);
94 __isl_give isl_ast_node
*isl_ast_node_alloc_mark(__isl_take isl_id
*id
,
95 __isl_take isl_ast_node
*node
);
96 __isl_give isl_ast_node
*isl_ast_node_from_ast_node_list(
97 __isl_take isl_ast_node_list
*list
);
98 __isl_give isl_ast_node
*isl_ast_node_for_set_body(
99 __isl_take isl_ast_node
*node
, __isl_take isl_ast_node
*body
);
100 __isl_give isl_ast_node
*isl_ast_node_if_set_then(
101 __isl_take isl_ast_node
*node
, __isl_take isl_ast_node
*child
);
103 struct isl_ast_print_options
{
107 __isl_give isl_printer
*(*print_for
)(__isl_take isl_printer
*p
,
108 __isl_take isl_ast_print_options
*options
,
109 __isl_keep isl_ast_node
*node
, void *user
);
110 void *print_for_user
;
111 __isl_give isl_printer
*(*print_user
)(__isl_take isl_printer
*p
,
112 __isl_take isl_ast_print_options
*options
,
113 __isl_keep isl_ast_node
*node
, void *user
);
114 void *print_user_user
;
117 __isl_give isl_printer
*isl_ast_node_list_print(
118 __isl_keep isl_ast_node_list
*list
, __isl_take isl_printer
*p
,
119 __isl_keep isl_ast_print_options
*options
);