33 lines
1.2 KiB
C
33 lines
1.2 KiB
C
|
|
#include <assert.h>
|
||
|
|
#include <stdbool.h>
|
||
|
|
|
||
|
|
#include "context.h"
|
||
|
|
#include "scope.h"
|
||
|
|
|
||
|
|
#define GC_TRAVERSE_STUB(name, T) \
|
||
|
|
void \
|
||
|
|
name(T arg, gc_visitor visitor, void *opaque) \
|
||
|
|
{ \
|
||
|
|
(void)arg; \
|
||
|
|
(void)visitor; \
|
||
|
|
(void)opaque; \
|
||
|
|
\
|
||
|
|
assert(false && "Stub " #name " called"); \
|
||
|
|
}
|
||
|
|
|
||
|
|
#define GC_DEINIT_STUB(name, T) \
|
||
|
|
void name(struct apfl_allocator allocator, T arg) \
|
||
|
|
{ \
|
||
|
|
(void)allocator; \
|
||
|
|
(void)arg; \
|
||
|
|
\
|
||
|
|
assert(false && "Stub " #name " called"); \
|
||
|
|
}
|
||
|
|
|
||
|
|
GC_TRAVERSE_STUB(apfl_gc_var_traverse, struct apfl_value *)
|
||
|
|
GC_TRAVERSE_STUB(apfl_gc_scope_traverse, struct scope *)
|
||
|
|
GC_TRAVERSE_STUB(apfl_gc_matcher_traverse, struct matcher *)
|
||
|
|
|
||
|
|
GC_DEINIT_STUB(apfl_scope_deinit, struct scope *)
|
||
|
|
GC_DEINIT_STUB(apfl_matcher_deinit, struct matcher *)
|