My Project
Loading...
Searching...
No Matches
ast_free.c File Reference
#include "gwion_util.h"
#include "gwion_ast.h"

Go to the source code of this file.

Macros

#define free_stmt_retry   (void *)dummy_func
 
#define free_stmt_break   (void *)dummy_func
 
#define free_stmt_continue   (void *)dummy_func
 
#define free_stmt_return   free_stmt_exp
 
#define free_stmt_while   free_stmt_flow
 
#define free_stmt_until   free_stmt_flow
 

Functions

 AST_FREE (StmtList *, stmt_list)
 
static AST_FREE (Stmt *, stmt2)
 
 AST_FREE (Array_Sub, array_sub)
 
 AST_FREE (Range *, range)
 
ANN AST_FREE (Exp_Lambda *, exp_lambda)
 
ANN AST_FREE (Exp_Array *, exp_array)
 
ANN AST_FREE (Exp_Slice *, exp_slice)
 
 AST_FREE (SpecializedList *, specialized_list)
 
 AST_FREE (Type_Decl *, type_decl)
 
static AST_FREE (Variable *, variable)
 
ANN AST_FREE (Exp_Decl *, exp_decl)
 
static ANN AST_FREE (Exp_Binary *, exp_binary)
 
static ANN AST_FREE (Exp_Cast *, exp_cast)
 
static ANN AST_FREE (Exp_Postfix *, exp_post)
 
static ANN AST_FREE (Exp_Unary *, exp_unary)
 
static ANN AST_FREE (Exp_If *, exp_if)
 
 AST_FREE (Tmpl *, tmpl)
 
ANN AST_FREE (Func_Base *, func_base)
 
 AST_FREE (Func_Def, func_def)
 
ANN AST_FREE (Type_Def, type_def)
 
ANN AST_FREE (Fptr_Def, fptr_def)
 
static ANN AST_FREE (Exp_Call *, exp_call)
 
static ANN AST_FREE (Exp_Dot *, exp_dot)
 
static ANN AST_FREE (Exp_Primary *, prim)
 
static ANN AST_FREE (Exp_Named *, exp_named)
 
static ANN AST_FREE (Type_Decl **, exp_td)
 
 AST_FREE (Exp *, exp)
 
 AST_FREE (ArgList *, arg_list)
 
static ANN AST_FREE (Stmt_Code, stmt_code)
 
static ANN AST_FREE (struct Stmt_Exp_ *, stmt_exp)
 
static ANN AST_FREE (struct Stmt_Flow_ *, stmt_flow)
 
static ANN AST_FREE (struct Match *, stmt_case)
 
static ANN AST_FREE (HandlerList *, handler_list)
 
static ANN AST_FREE (struct Stmt_Try_ *, stmt_try)
 
static ANN AST_FREE (struct Match *, stmt_match)
 
static ANN AST_FREE (Stmt_For, stmt_for)
 
static ANN AST_FREE (Stmt_Each, stmt_each)
 
static ANN AST_FREE (Stmt_Loop, stmt_loop)
 
static ANN AST_FREE (Stmt_If, stmt_if)
 
ANN AST_FREE (Enum_Def, enum_def)
 
static ANN AST_FREE (Stmt_PP, stmt_pp)
 
static ANN AST_FREE (Stmt_Defer, stmt_defer)
 
ANN AST_FREE (VariableList *, variable_list)
 
ANN AST_FREE (Union_Def, union_def)
 
 AST_FREE (Spread_Def, stmt_spread)
 
static AST_FREE (Stmt_Using, stmt_using)
 
static AST_FREE (Stmt_Import, stmt_import)
 
 DECL_STMT_FUNC (free, void, MemPool,)
 
 AST_FREE (Stmt *, stmt)
 
 AST_FREE (Extend_Def, extend_def)
 
 AST_FREE (Class_Def, class_def)
 
 AST_FREE (Trait_Def, trait_def)
 
 AST_FREE (Prim_Def, prim_def)
 
static ANN AST_FREE (const Section *, section)
 
 AST_FREE (TmplArgList *, tmplarg_list)
 
 AST_FREE (Ast, ast)
 

Macro Definition Documentation

◆ free_stmt_break

#define free_stmt_break   (void *)dummy_func

Definition at line 258 of file ast_free.c.

◆ free_stmt_continue

#define free_stmt_continue   (void *)dummy_func

Definition at line 259 of file ast_free.c.

◆ free_stmt_retry

#define free_stmt_retry   (void *)dummy_func

Definition at line 257 of file ast_free.c.

◆ free_stmt_return

#define free_stmt_return   free_stmt_exp

Definition at line 260 of file ast_free.c.

◆ free_stmt_until

#define free_stmt_until   free_stmt_flow

Definition at line 262 of file ast_free.c.

◆ free_stmt_while

#define free_stmt_while   free_stmt_flow

Definition at line 261 of file ast_free.c.

Function Documentation

◆ AST_FREE() [1/55]

AST_FREE ( ArgList * ,
arg_list  )

Definition at line 158 of file ast_free.c.

158 {
159 for(uint32_t i = 0; i < a->len; i++) {
160 Arg *arg = arglist_ptr_at(a, i);
161 free_variable(p, &arg->var);
162 if (arg->exp) free_exp(p, arg->exp);
163 }
164 free_arglist(p, a);
165}
ANN void free_exp(MemPool p, Exp *)
Definition absyn.h:310
Exp * exp
Definition absyn.h:312
Variable var
Definition absyn.h:311

◆ AST_FREE() [2/55]

AST_FREE ( Array_Sub ,
array_sub  )

Definition at line 7 of file ast_free.c.

7 {
8 if (a->exp) free_exp(p, a->exp);
9 mp_free(p, Array_Sub, a);
10}
array_subscript.
Definition absyn.h:352

◆ AST_FREE() [3/55]

AST_FREE ( Ast ,
ast  )

Definition at line 362 of file ast_free.c.

362 {
363 for(m_uint i = 0; i < a->len; i++) {
364 Section section = sectionlist_at(a, i);
365 free_section(p, &section);
366 }
367 free_sectionlist(p, a);
368}

◆ AST_FREE() [4/55]

AST_FREE ( Class_Def ,
class_def  )

Definition at line 311 of file ast_free.c.

311 {
312 if (a->base.ext) free_type_decl(p, a->base.ext);
313 if (a->base.tmpl) free_tmpl(p, a->base.tmpl);
314 if (a->traits) free_taglist(p, a->traits);
315 if (a->body) free_ast(p, a->body);
316 mp_free(p, Class_Def, a);
317}
ANN void free_tmpl(MemPool p, Tmpl *)
ANN void free_ast(MemPool p, Ast)
ANN void free_type_decl(MemPool p, Type_Decl *)

◆ AST_FREE() [5/55]

static ANN AST_FREE ( const Section * ,
section  )
static

Definition at line 329 of file ast_free.c.

329 {
330 const ae_section_t t = a->section_type;
331 if (t == ae_section_class)
332 free_class_def(p, a->d.class_def);
333 else if (t == ae_section_trait)
334 free_trait_def(p, a->d.trait_def);
335 else if (t == ae_section_extend)
336 free_extend_def(p, a->d.extend_def);
337 else if (t == ae_section_stmt)
338 free_stmt_list(p, a->d.stmt_list);
339 else if (t == ae_section_func)
340 free_func_def(p, a->d.func_def);
341 else if (t == ae_section_enum)
342 free_enum_def(p, a->d.enum_def);
343 else if (t == ae_section_union)
344 free_union_def(p, a->d.union_def);
345 else if (t == ae_section_fptr)
346 free_fptr_def(p, a->d.fptr_def);
347 else if (t == ae_section_type)
348 free_type_def(p, a->d.type_def);
349 else if (t == ae_section_primitive)
350 free_prim_def(p, a->d.prim_def);
351}
ANN void free_stmt_list(MemPool, StmtList *)
ANN void free_trait_def(MemPool p, Trait_Def)
ANN void free_class_def(MemPool p, Class_Def)
ANN void free_union_def(MemPool p, Union_Def)
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)
ae_section_t
Definition absyn.h:824
@ ae_section_primitive
Definition absyn.h:834
@ ae_section_class
Definition absyn.h:827
@ ae_section_enum
Definition absyn.h:830
@ ae_section_union
Definition absyn.h:831
@ ae_section_fptr
Definition absyn.h:832
@ ae_section_func
Definition absyn.h:826
@ ae_section_type
Definition absyn.h:833
@ ae_section_stmt
Definition absyn.h:825
@ ae_section_extend
Definition absyn.h:829
@ ae_section_trait
Definition absyn.h:828
ANN void free_enum_def(MemPool p, Enum_Def)
ANN void free_extend_def(MemPool p, Extend_Def)
ANN void free_prim_def(MemPool p, Prim_Def)

◆ AST_FREE() [6/55]

ANN AST_FREE ( Enum_Def ,
enum_def  )

Definition at line 232 of file ast_free.c.

232 {
233 free_enumvaluelist(p, a->list);
234 mp_free(p, Enum_Def, a);
235}

◆ AST_FREE() [7/55]

AST_FREE ( Exp * ,
exp  )

Definition at line 151 of file ast_free.c.

151 {
152 free_exp_func[a->exp_type](p, &a->d);
153 Exp* next = a->next;
154 mp_free2(p, sizeof(Exp), a);
155 if (next) free_exp(p, next);
156}
Definition absyn.h:559
Exp * next
Definition absyn.h:578

◆ AST_FREE() [8/55]

ANN AST_FREE ( Exp_Array * ,
exp_array  )

Definition at line 20 of file ast_free.c.

20 {
21 free_array_sub(p, a->array);
22 free_exp(p, a->base);
23}
Exp *ANN void free_array_sub(MemPool p, Array_Sub)

◆ AST_FREE() [9/55]

static ANN AST_FREE ( Exp_Binary * ,
exp_binary  )
static

Definition at line 55 of file ast_free.c.

55 {
56 free_exp(p, a->lhs);
57 free_exp(p, a->rhs);
58}

◆ AST_FREE() [10/55]

static ANN AST_FREE ( Exp_Call * ,
exp_call  )
static

Definition at line 124 of file ast_free.c.

124 {
125 if (a->tmpl) free_tmpl(p, a->tmpl);
126 free_exp(p, a->func);
127 if (a->args) free_exp(p, a->args);
128}

◆ AST_FREE() [11/55]

static ANN AST_FREE ( Exp_Cast * ,
exp_cast  )
static

Definition at line 60 of file ast_free.c.

60 {
61 free_type_decl(p, a->td);
62 free_exp(p, a->exp);
63}

◆ AST_FREE() [12/55]

ANN AST_FREE ( Exp_Decl * ,
exp_decl  )

Definition at line 50 of file ast_free.c.

50 {
51 free_variable(p, &a->var);
52 if(a->args) free_exp(p, a->args);
53}

◆ AST_FREE() [13/55]

static ANN AST_FREE ( Exp_Dot * ,
exp_dot  )
static

Definition at line 130 of file ast_free.c.

130 {
131 if (a->base) free_exp(p, a->base);
132}

◆ AST_FREE() [14/55]

static ANN AST_FREE ( Exp_If * ,
exp_if  )
static

Definition at line 84 of file ast_free.c.

84 {
85 free_exp(p, a->cond);
86 if (a->if_exp) free_exp(p, a->if_exp);
87 free_exp(p, a->else_exp);
88}

◆ AST_FREE() [15/55]

ANN AST_FREE ( Exp_Lambda * ,
exp_lambda  )

Definition at line 18 of file ast_free.c.

18{ free_func_def(p, a->def); }

◆ AST_FREE() [16/55]

static ANN AST_FREE ( Exp_Named * ,
exp_named  )
static

Definition at line 144 of file ast_free.c.

144 {
145 free_exp(p, a->exp);
146}

◆ AST_FREE() [17/55]

static ANN AST_FREE ( Exp_Postfix * ,
exp_post  )
inlinestatic

Definition at line 65 of file ast_free.c.

65{ free_exp(p, a->exp); }

◆ AST_FREE() [18/55]

static ANN AST_FREE ( Exp_Primary * ,
prim  )
static

Definition at line 134 of file ast_free.c.

134 {
135 const ae_prim_t t = a->prim_type;
136 if (t == ae_prim_hack || t == ae_prim_dict || t == ae_prim_interp)
137 free_exp(p, a->d.exp);
138 else if (t == ae_prim_array)
139 free_array_sub(p, a->d.array);
140 else if (t == ae_prim_range)
141 free_range(p, a->d.range);
142}
ae_prim_t
Definition absyn.h:422
@ ae_prim_array
Definition absyn.h:427
@ ae_prim_hack
Definition absyn.h:430
@ ae_prim_interp
Definition absyn.h:433
@ ae_prim_range
Definition absyn.h:428
@ ae_prim_dict
Definition absyn.h:429

◆ AST_FREE() [19/55]

ANN AST_FREE ( Exp_Slice * ,
exp_slice  )

Definition at line 25 of file ast_free.c.

25 {
26 free_range(p, a->range);
27 free_exp(p, a->base);
28}

◆ AST_FREE() [20/55]

static ANN AST_FREE ( Exp_Unary * ,
exp_unary  )
static

Definition at line 67 of file ast_free.c.

67 {
68 switch (a->unary_type) {
69 case unary_exp:
70// if (a->exp)
71free_exp(p, a->exp);
72 break;
73 case unary_td:
74 free_type_decl(p, a->ctor.td);
75 if (a->ctor.exp) free_exp(p, a->ctor.exp);
76 break;
77 case unary_code:
78 if (a->code) free_stmt_list(p, a->code);
79 break;
80 }
81 if (a->captures) free_capturelist(p, a->captures);
82}
@ unary_code
Definition absyn.h:522
@ unary_exp
Definition absyn.h:522
@ unary_td
Definition absyn.h:522

◆ AST_FREE() [21/55]

AST_FREE ( Extend_Def ,
extend_def  )

Definition at line 306 of file ast_free.c.

306 {
307 free_type_decl(p, a->td);
308 mp_free(p, Extend_Def, a);
309}

◆ AST_FREE() [22/55]

ANN AST_FREE ( Fptr_Def ,
fptr_def  )

Definition at line 119 of file ast_free.c.

119 {
120 free_func_base(p, a->base);
121 mp_free(p, Fptr_Def, a);
122}
ANN void free_func_base(MemPool p, Func_Base *)

◆ AST_FREE() [23/55]

ANN AST_FREE ( Func_Base * ,
func_base  )

Definition at line 96 of file ast_free.c.

96 {
97 if (a->args) free_arg_list(p, a->args);
98 if (a->td) free_type_decl(p, a->td);
99 if (a->tmpl) free_tmpl(p, a->tmpl);
100 if (a->effects.ptr) vector_release(&a->effects);
101}
ANN void free_arg_list(MemPool p, ArgList *)

◆ AST_FREE() [24/55]

AST_FREE ( Func_Def ,
func_def  )

Definition at line 103 of file ast_free.c.

103 {
104 free_func_base(p, a->base);
105 if (!a->builtin && a->d.code) free_stmt_list(p, a->d.code);
106 if (a->captures) free_capturelist(p, a->captures);
107 mp_free(p, Func_Def, a);
108}

◆ AST_FREE() [25/55]

static ANN AST_FREE ( HandlerList * ,
handler_list  )
static

Definition at line 186 of file ast_free.c.

186 {
187 for(uint32_t i = 0; i < a->len; i++) {
188 const Handler handler = handlerlist_at(a, i);
189 free_stmt(p, handler.stmt);
190 }
191 free_handlerlist(p, a);
192}
ANN void free_stmt(MemPool p, Stmt *)
Stmt * stmt
Definition absyn.h:95

◆ AST_FREE() [26/55]

AST_FREE ( Prim_Def ,
prim_def  )

Definition at line 325 of file ast_free.c.

325 {
326 mp_free(p, Prim_Def, a);
327}

◆ AST_FREE() [27/55]

AST_FREE ( Range * ,
range  )

Definition at line 12 of file ast_free.c.

12 {
13 if (a->start) free_exp(p, a->start);
14 if (a->end) free_exp(p, a->end);
15 mp_free(p, Range, a);
16}
range.
Definition absyn.h:371

◆ AST_FREE() [28/55]

AST_FREE ( SpecializedList * ,
specialized_list  )

Definition at line 30 of file ast_free.c.

30 {
31 for(uint32_t i = 0; i < a->len; i++) {
32 const Specialized spec = specializedlist_at(a, i);
33 if (spec.traits) free_taglist(p, spec.traits);
34 }
35 free_specializedlist(p, a);
36}
TagList * traits
Definition absyn.h:389

◆ AST_FREE() [29/55]

AST_FREE ( Spread_Def ,
stmt_spread  )

Definition at line 264 of file ast_free.c.

264 {
265 free_taglist(p, a->list);
266 free_mstr(p, a->data);
267}

◆ AST_FREE() [30/55]

AST_FREE ( Stmt * ,
stmt  )

Definition at line 293 of file ast_free.c.

293 {
294 free_stmt_func[a->stmt_type](p, &a->d);
295 mp_free2(p, sizeof(Stmt), a);
296}
Definition absyn.h:187

◆ AST_FREE() [31/55]

static AST_FREE ( Stmt * ,
stmt2  )
static

Definition at line 289 of file ast_free.c.

289 {
290 free_stmt_func[a->stmt_type](p, &a->d);
291}

◆ AST_FREE() [32/55]

static ANN AST_FREE ( Stmt_Code ,
stmt_code  )
static

Definition at line 167 of file ast_free.c.

167 {
168 if (a->stmt_list) free_stmt_list(p, a->stmt_list);
169}

◆ AST_FREE() [33/55]

static ANN AST_FREE ( Stmt_Defer ,
stmt_defer  )
static

Definition at line 242 of file ast_free.c.

242{ free_stmt(p, a->stmt); }

◆ AST_FREE() [34/55]

static ANN AST_FREE ( Stmt_Each ,
stmt_each  )
static

Definition at line 216 of file ast_free.c.

216 {
217 free_exp(p, a->exp);
218 free_stmt(p, a->body);
219}

◆ AST_FREE() [35/55]

static ANN AST_FREE ( Stmt_For ,
stmt_for  )
static

Definition at line 209 of file ast_free.c.

209 {
210 free_stmt(p, a->c1);
211 free_stmt(p, a->c2);
212 if (a->c3) free_exp(p, a->c3);
213 free_stmt(p, a->body);
214}

◆ AST_FREE() [36/55]

static ANN AST_FREE ( Stmt_If ,
stmt_if  )
static

Definition at line 226 of file ast_free.c.

226 {
227 free_exp(p, a->cond);
228 free_stmt(p, a->if_body);
229 if (a->else_body) free_stmt(p, a->else_body);
230}

◆ AST_FREE() [37/55]

static AST_FREE ( Stmt_Import ,
stmt_import  )
static

Definition at line 276 of file ast_free.c.

276 {
277 if(a->selection) {
278 for(uint32_t i = 0; i < a->selection->len; i++) {
279 Stmt_Using item = usingstmtlist_ptr_at(a->selection, i);
280 if(item->d.exp)
281 free_exp(p, item->d.exp);
282 }
283 free_usingstmtlist(p, a->selection);
284 }
285}
Exp * exp
Definition absyn.h:137
union Stmt_Using_::@2 d

◆ AST_FREE() [38/55]

static ANN AST_FREE ( Stmt_Loop ,
stmt_loop  )
static

Definition at line 221 of file ast_free.c.

221 {
222 free_exp(p, a->cond);
223 free_stmt(p, a->body);
224}

◆ AST_FREE() [39/55]

static ANN AST_FREE ( Stmt_PP ,
stmt_pp  )
static

Definition at line 237 of file ast_free.c.

237 {
238 if (a->data) xfree(a->data);
239 if (a->exp) free_exp(p, a->exp);
240}

◆ AST_FREE() [40/55]

static AST_FREE ( Stmt_Using ,
stmt_using  )
static

Definition at line 269 of file ast_free.c.

269 {
270 if(a->tag.sym)
271 free_exp(p, a->d.exp);
272 else
273 free_type_decl(p, a->d.td);
274}

◆ AST_FREE() [41/55]

AST_FREE ( StmtList * ,
stmt_list  )

Definition at line 298 of file ast_free.c.

298 {
299 for(m_uint i = 0; i < a->len; i++) {
300 Stmt stmt = stmtlist_at(a, i);
301 free_stmt2(p, &stmt);
302 }
303 free_stmtlist(p, a);
304}

◆ AST_FREE() [42/55]

static ANN AST_FREE ( struct Match * ,
stmt_case  )
static

Definition at line 180 of file ast_free.c.

180 {
181 free_exp(p, a->cond);
182 free_stmt_list(p, a->list);
183 if (a->when) free_exp(p, a->when);
184}

◆ AST_FREE() [43/55]

static ANN AST_FREE ( struct Match * ,
stmt_match  )
static

Definition at line 199 of file ast_free.c.

199 {
200 free_exp(p, a->cond);
201 for(m_uint i = 0; i < a->list->len; i++) {
202 Stmt* stmt = stmtlist_ptr_at(a->list, i);
203 free_stmt_case(p, &stmt->d.stmt_match);
204 }
205 free_stmtlist(p, a->list);
206 if (a->where) free_stmt(p, a->where);
207}
union Stmt::stmt_data d
struct Match stmt_match
Definition absyn.h:197

◆ AST_FREE() [44/55]

static ANN AST_FREE ( struct Stmt_Exp_ * ,
stmt_exp  )
inlinestatic

Definition at line 171 of file ast_free.c.

171 {
172 if (a->val) free_exp(p, a->val);
173}

◆ AST_FREE() [45/55]

static ANN AST_FREE ( struct Stmt_Flow_ * ,
stmt_flow  )
static

Definition at line 175 of file ast_free.c.

175 {
176 free_exp(p, a->cond);
177 free_stmt(p, a->body);
178}

◆ AST_FREE() [46/55]

static ANN AST_FREE ( struct Stmt_Try_ * ,
stmt_try  )
static

Definition at line 194 of file ast_free.c.

194 {
195 free_stmt(p, a->stmt);
196 free_handler_list(p, a->handler);
197}

◆ AST_FREE() [47/55]

AST_FREE ( Tmpl * ,
tmpl  )

Definition at line 90 of file ast_free.c.

90 {
91 if (!a->call) free_specialized_list(p, a->list);
92 else free_tmplarg_list(p, a->call);
93 mp_free(p, Tmpl, a);
94}
ANN void free_specialized_list(MemPool p, SpecializedList *)
ANN void free_tmplarg_list(MemPool p, TmplArgList *)
Definition absyn.h:478

◆ AST_FREE() [48/55]

AST_FREE ( TmplArgList * ,
tmplarg_list  )

Definition at line 353 of file ast_free.c.

353 {
354 for(uint32_t i = 0; i < a->len; i++) {
355 const TmplArg arg = tmplarglist_at(a, i);
356 if(arg.type == tmplarg_td) free_type_decl(p, arg.d.td);
357 else free_exp(p, arg.d.exp);
358 }
359 free_tmplarglist(p, a);
360}
@ tmplarg_td
Definition absyn.h:254
Exp * exp
Definition absyn.h:261
enum tmplarg_t type
Definition absyn.h:263
union TmplArg::@3 d
Type_Decl * td
Definition absyn.h:260

◆ AST_FREE() [49/55]

AST_FREE ( Trait_Def ,
trait_def  )

Definition at line 319 of file ast_free.c.

319 {
320 if (a->traits) free_taglist(p, a->traits);
321 if (a->body) free_ast(p, a->body);
322 mp_free(p, Trait_Def, a);
323}

◆ AST_FREE() [50/55]

static ANN AST_FREE ( Type_Decl ** ,
exp_td  )
static

Definition at line 148 of file ast_free.c.

148{ free_type_decl(p, *a); }

◆ AST_FREE() [51/55]

AST_FREE ( Type_Decl * ,
type_decl  )

Definition at line 38 of file ast_free.c.

38 {
39 if (a->types) free_tmplarg_list(p, a->types);
40 if (a->array) free_array_sub(p, a->array);
41 if (a->fptr) free_fptr_def(p, a->fptr);
42 if (a->next) free_type_decl(p, a->next);
43 mp_free(p, Type_Decl, a);
44}

◆ AST_FREE() [52/55]

ANN AST_FREE ( Type_Def ,
type_def  )

Definition at line 110 of file ast_free.c.

110 {
111 free_type_decl(p, a->ext);
112 if (a->when) {
113 free_exp(p, a->when);
114 if (a->when_def) free_func_def(p, a->when_def);
115 }
116 mp_free(p, Type_Def, a);
117}

◆ AST_FREE() [53/55]

ANN AST_FREE ( Union_Def ,
union_def  )

Definition at line 252 of file ast_free.c.

252 {
253 free_variable_list(p, a->l);
254 mp_free(p, Union_Def, a);
255}

◆ AST_FREE() [54/55]

static AST_FREE ( Variable * ,
variable  )
static

Definition at line 46 of file ast_free.c.

46 {
47 if (a->td) free_type_decl(p, a->td);
48}

◆ AST_FREE() [55/55]

ANN AST_FREE ( VariableList * ,
variable_list  )

Definition at line 244 of file ast_free.c.

244 {
245 for(uint32_t i = 0; i < a->len; i++) {
246 const Variable tgt = variablelist_at(a, i);
247 free_type_decl(p, tgt.td);
248 }
249 free_variablelist(p, a);
250}
ANN void free_variablelist(MemPool p, VariableList *)
variable declaration
Definition absyn.h:244
Type_Decl * td
Definition absyn.h:245

◆ DECL_STMT_FUNC()

DECL_STMT_FUNC ( free ,
void ,
MemPool  )