diff options
author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-11-06 02:46:44 +0100 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2024-11-06 12:17:01 +0100 |
commit | 3e51be9d94e561549281e386ce1b7554018ef4dd (patch) | |
tree | a88f20aba911030f16e692351cf5489746917910 /cc.h | |
parent | f66a661359a39e10af01508ad02429517b8460e3 (diff) |
cproc: Implement defer statement.defer
implemented by keeping a list of deferred blocks in a function, and
emitting them before scope exits (return, lbracket, break, continue)
TODO: error checking, the compiler should error should a compile time
jump (goto) would go over a defer statement.
Diffstat (limited to 'cc.h')
-rw-r--r-- | cc.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -26,6 +26,7 @@ enum tokenkind { TCONSTEXPR, TCONTINUE, TDEFAULT, + TDEFER, TDO, TDOUBLE, TELSE, @@ -558,6 +559,9 @@ struct value *mkintconst(unsigned long long); struct func *mkfunc(struct decl *, char *, struct type *, struct scope *); void delfunc(struct func *); struct type *functype(struct func *); +void funcstartdefer(struct func *); +void funcenddefer(struct func *); +void funcdefer(struct func *); void funclabel(struct func *, struct block *); struct value *funcexpr(struct func *, struct expr *); void funcjmp(struct func *, struct block *); |