stage1 重制类型转换系统 修复问题 提供更多表达式

This commit is contained in:
zzy committed 2026-09-16 11:36:29 +08:00
1 parent f6a0bce9f0
commit 7cbe2d2b9a
7 files changed
+509 -248

No files matched your search

+11 -4
View File
@@ -11,6 +11,16 @@ typedef enum {
SPL_INTRIN_ASSERT,
SPL_INTRIN_BREAKPOINT,
SPL_INTRIN_LEN,
SPL_INTRIN_INT_CAST,
SPL_INTRIN_TRUNCATE,
SPL_INTRIN_BIT_CAST,
SPL_INTRIN_FLOAT_CAST,
SPL_INTRIN_INT_FROM_FLOAT,
SPL_INTRIN_FLOAT_FROM_INT,
SPL_INTRIN_INT_FROM_BOOL,
SPL_INTRIN_INT_FROM_PTR,
SPL_INTRIN_PTR_FROM_INT,
SPL_INTRIN_PTR_CAST,
} spl_intrin_t;
typedef enum {
@@ -33,13 +43,10 @@ typedef struct {
spl_intrin_result_t result;
} spl_intrin_info_t;
/* 统一入口:名字 → 枚举。name 允许带或不带 '@'。 */
spl_intrin_t spl_intrin_lookup_call(const char *name);
/* 统一入口:字段形态,按接收者类型分派。 */
spl_intrin_t spl_intrin_lookup_field(spl_lang_type_kind_t recv_kind, const char *field);
spl_intrin_t spl_intrin_lookup_cast(spl_type_t *type, spl_type_id_t ft, spl_type_id_t tt);
/* 从枚举取得元数据,SEMA/AST2IR 都从这里读。 */
const spl_intrin_info_t *spl_intrin_info(spl_intrin_t kind);
/* ---- 与 IR 侧共享的类型布局约定 ---- */