26 free_range(p, a->range);
31 for(uint32_t i = 0; i < a->len; i++) {
35 free_specializedlist(p, a);
51 free_variable(p, &a->var);
68 switch (a->unary_type) {
75 if (a->ctor.exp)
free_exp(p, a->ctor.exp);
81 if (a->captures) free_capturelist(p, a->captures);
86 if (a->if_exp)
free_exp(p, a->if_exp);
100 if (a->effects.ptr) vector_release(&a->effects);
106 if (a->captures) free_capturelist(p, a->captures);
141 free_range(p, a->d.range);
152 free_exp_func[a->exp_type](p, &a->d);
154 mp_free2(p,
sizeof(
Exp), a);
159 for(uint32_t i = 0; i < a->len; i++) {
160 Arg *arg = arglist_ptr_at(a, i);
161 free_variable(p, &arg->
var);
187 for(uint32_t i = 0; i < a->len; i++) {
188 const Handler handler = handlerlist_at(a, i);
191 free_handlerlist(p, a);
196 free_handler_list(p, a->handler);
201 for(m_uint i = 0; i < a->list->len; i++) {
202 Stmt* stmt = stmtlist_ptr_at(a->list, i);
205 free_stmtlist(p, a->list);
229 if (a->else_body)
free_stmt(p, a->else_body);
233 free_enumvaluelist(p, a->list);
238 if (a->data) xfree(a->data);
245 for(uint32_t i = 0; i < a->len; i++) {
246 const Variable tgt = variablelist_at(a, i);
253 free_variable_list(p, a->l);
257#define free_stmt_retry (void *)dummy_func
258#define free_stmt_break (void *)dummy_func
259#define free_stmt_continue (void *)dummy_func
260#define free_stmt_return free_stmt_exp
261#define free_stmt_while free_stmt_flow
262#define free_stmt_until free_stmt_flow
265 free_taglist(p, a->list);
266 free_mstr(p, a->data);
278 for(uint32_t i = 0; i < a->selection->len; i++) {
279 Stmt_Using item = usingstmtlist_ptr_at(a->selection, i);
283 free_usingstmtlist(p, a->selection);
290 free_stmt_func[a->stmt_type](p, &a->d);
294 free_stmt_func[a->stmt_type](p, &a->d);
295 mp_free2(p,
sizeof(
Stmt), a);
299 for(m_uint i = 0; i < a->len; i++) {
300 Stmt stmt = stmtlist_at(a, i);
301 free_stmt2(p, &stmt);
313 if (a->base.tmpl)
free_tmpl(p, a->base.tmpl);
314 if (a->traits) free_taglist(p, a->traits);
320 if (a->traits) free_taglist(p, a->traits);
354 for(uint32_t i = 0; i < a->len; i++) {
355 const TmplArg arg = tmplarglist_at(a, i);
359 free_tmplarglist(p, a);
363 for(m_uint i = 0; i < a->len; i++) {
364 Section section = sectionlist_at(a, i);
365 free_section(p, §ion);
367 free_sectionlist(p, a);
ANN void free_variablelist(MemPool p, VariableList *)
#define AST_FREE(type, name)
ANN void free_tmpl(MemPool p, Tmpl *)
ANN void free_stmt_list(MemPool, StmtList *)
ANN void free_ast(MemPool p, Ast)
ANN void free_trait_def(MemPool p, Trait_Def)
ANN void free_stmt(MemPool p, Stmt *)
ANN void free_class_def(MemPool p, Class_Def)
ANN void free_union_def(MemPool p, Union_Def)
ANN void free_type_decl(MemPool p, Type_Decl *)
ANN void free_specialized_list(MemPool p, SpecializedList *)
ANN void free_fptr_def(MemPool p, Fptr_Def)
ANN void free_type_def(MemPool p, Type_Def)
ANN void free_func_def(MemPool p, Func_Def)
ANN void free_tmplarg_list(MemPool p, TmplArgList *)
ANN void free_enum_def(MemPool p, Enum_Def)
Exp *ANN void free_array_sub(MemPool p, Array_Sub)
ANN void free_exp(MemPool p, Exp *)
ANN void free_arg_list(MemPool p, ArgList *)
ANN void free_func_base(MemPool p, Func_Base *)
ANEW const Type_Decl Exp * exp
ANN void free_extend_def(MemPool p, Extend_Def)
ANN void free_prim_def(MemPool p, Prim_Def)
#define DECL_STMT_FUNC(prefix, type, arg, mod)
#define DECL_EXP_FUNC(prefix, type, arg, mod)
include this file to use gwion-ast library