3 #if defined(__cplusplus)
15 enum clast_expr_type type
;
19 struct clast_expr expr
;
23 /* Represents the term
24 * val * var (if var != NULL)
26 * val (if var == NULL)
29 struct clast_expr expr
;
31 struct clast_expr
*var
;
34 #define CLAST_PARALLEL_NOT 0
35 #define CLAST_PARALLEL_OMP 1
36 #define CLAST_PARALLEL_MPI 2
38 enum clast_red_type
{ clast_red_sum
, clast_red_min
, clast_red_max
};
39 struct clast_reduction
{
40 struct clast_expr expr
;
41 enum clast_red_type type
;
43 struct clast_expr
* elts
[1];
46 enum clast_bin_type
{ clast_bin_fdiv
, clast_bin_cdiv
,
47 clast_bin_div
, clast_bin_mod
};
49 struct clast_expr expr
;
50 enum clast_bin_type type
;
51 struct clast_expr
* LHS
;
56 struct clast_stmt_op
{
57 void (*free
)(struct clast_stmt
*);
60 #define CLAST_STMT_IS_A(stmt, type) ((stmt)->op == &(type))
62 extern const struct clast_stmt_op stmt_root
;
63 extern const struct clast_stmt_op stmt_ass
;
64 extern const struct clast_stmt_op stmt_user
;
65 extern const struct clast_stmt_op stmt_block
;
66 extern const struct clast_stmt_op stmt_for
;
67 extern const struct clast_stmt_op stmt_guard
;
70 const struct clast_stmt_op
*op
;
71 struct clast_stmt
*next
;
75 struct clast_stmt stmt
;
76 CloogNames
* names
; /**< Names of iterators and parameters. */
79 struct clast_assignment
{
80 struct clast_stmt stmt
;
82 struct clast_expr
* RHS
;
86 struct clast_stmt stmt
;
87 struct clast_stmt
* body
;
90 struct clast_user_stmt
{
91 struct clast_stmt stmt
;
93 CloogStatement
* statement
;
94 struct clast_stmt
* substitutions
;
98 struct clast_stmt stmt
;
100 const char * iterator
;
101 struct clast_expr
* LB
;
102 struct clast_expr
* UB
;
104 struct clast_stmt
* body
;
106 /* Comma separated list of loop private variables for OpenMP parallelization */
108 /* Comma separated list of reduction variable/operators for OpenMP parallelization */
109 char *reduction_vars
;
112 struct clast_equation
{
113 struct clast_expr
* LHS
;
114 struct clast_expr
* RHS
;
119 struct clast_stmt stmt
;
120 struct clast_stmt
* then
;
122 struct clast_equation eq
[1];
126 struct clast_stmt
*cloog_clast_create_from_input(CloogInput
*input
,
127 CloogOptions
*options
);
128 struct clast_stmt
*cloog_clast_create(CloogProgram
*program
,
129 CloogOptions
*options
);
130 void cloog_clast_free(struct clast_stmt
*s
);
132 struct clast_name
*new_clast_name(const char *name
);
133 struct clast_term
*new_clast_term(cloog_int_t c
, struct clast_expr
*v
);
134 struct clast_binary
*new_clast_binary(enum clast_bin_type t
,
135 struct clast_expr
*lhs
, cloog_int_t rhs
);
136 struct clast_reduction
*new_clast_reduction(enum clast_red_type t
, int n
);
137 struct clast_root
*new_clast_root(CloogNames
*names
);
138 struct clast_assignment
*new_clast_assignment(const char *lhs
,
139 struct clast_expr
*rhs
);
140 struct clast_user_stmt
*new_clast_user_stmt(CloogDomain
*domain
,
141 CloogStatement
*stmt
, struct clast_stmt
*subs
);
142 struct clast_block
*new_clast_block(void);
143 struct clast_for
*new_clast_for(CloogDomain
*domain
, const char *it
,
144 struct clast_expr
*LB
, struct clast_expr
*UB
,
145 CloogStride
*stride
);
146 struct clast_guard
*new_clast_guard(int n
);
148 void free_clast_name(struct clast_name
*t
);
149 void free_clast_term(struct clast_term
*t
);
150 void free_clast_binary(struct clast_binary
*b
);
151 void free_clast_reduction(struct clast_reduction
*r
);
152 void free_clast_expr(struct clast_expr
*e
);
153 void free_clast_stmt(struct clast_stmt
*s
);
155 int clast_expr_equal(struct clast_expr
*e1
, struct clast_expr
*e2
);
157 struct clast_expr
*clast_bound_from_constraint(CloogConstraint
*constraint
,
158 int level
, CloogNames
*names
);
160 typedef enum filterType
{exact
, subset
} ClastFilterType
;
162 typedef struct clastFilter
{
164 const int *stmts_filter
;
166 ClastFilterType filter_type
;
169 void clast_filter(struct clast_stmt
*node
, ClastFilter filter
,
170 struct clast_for
***loops
, int *nloops
, int **stmts
, int *nstmts
);
172 #if defined(__cplusplus)
175 #endif /* define _H */