From 7fd575859a6e75287c1261071ff8ca44319c18c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EC=8B=9C=EC=9B=90?= Date: Sun, 16 Aug 2026 19:44:51 +0900 Subject: [PATCH] extract M5 ownership state helpers --- fec/src/own.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 fec/src/own.h diff --git a/fec/src/own.h b/fec/src/own.h new file mode 100644 index 0000000..eb0ff65 --- /dev/null +++ b/fec/src/own.h @@ -0,0 +1,24 @@ +#ifndef FE_OWN_H +#define FE_OWN_H + +#include "types.h" +#include "diag.h" + +#define FE_OWN_NODE_CONSUMED 0x100U +#define FE_OWN_NODE_DEFER_CAPTURE 0x200U + +enum FeOwnMoveState { + FE_OWN_AVAILABLE = 0, + FE_OWN_MOVED = 1, + FE_OWN_MAYBE_MOVED = 2 +}; + +int fe_own_is_copy_type(FeType *type); +void fe_own_mark_consumed(FeDiags *diags, int *state, FeNode *decl, + FeNode *expr, FeType *type, int in_defer); +void fe_own_check_use(FeDiags *diags, int state, FeLoc loc); +int fe_own_merge_move(int left, int right); +int fe_own_loop_entry(int before, int after); +int fe_own_loop_exit(int state, int after); + +#endif