diff options
| author | WormHeamer | 2025-08-03 21:51:29 -0400 |
|---|---|---|
| committer | WormHeamer | 2025-08-03 21:51:29 -0400 |
| commit | a49e785e8536acd6d5ff2c6bebf8d9902d2f3620 (patch) | |
| tree | a84dc858dc046df1c99488a1ae32a9b0003f03e7 /ir.h | |
| parent | 3cdc850f2a7dbf1e170242417d67acf8d7e7b0d8 (diff) | |
add booleans and comparison operators
Diffstat (limited to 'ir.h')
| -rw-r--r-- | ir.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -16,6 +16,7 @@ typedef enum { typedef enum { T_TUPLE, + T_BOOL, T_INT } BaseType; @@ -26,6 +27,7 @@ typedef struct Type { } Type; int type_eql(Type *a, Type *b); +int type_base_eql(Type *a, Type *b); /* nodes */ @@ -39,6 +41,7 @@ typedef enum { N_OP_AND, N_OP_OR, N_OP_XOR, N_OP_SHL, N_OP_SHR, N_OP_NEG, N_OP_NOT, + N_CMP_EQL, N_CMP_NEQ, N_CMP_LES, N_CMP_GTR, N_CMP_LTE, N_CMP_GTE, N_VALUE } NodeType; @@ -103,10 +106,13 @@ void node_remove(Proc *p, Node *src, Node *dest); Node *node_new_empty(Proc *p, NodeType t); Node *node_newv(Proc *p, NodeType t, ...); Node *node_dedup_lit(Proc *p, Value v); -Node *node_new_lit_i64(Proc *p, int64_t i); Value node_compute(Node *n, Lexer *l); Node *node_peephole(Node *n, Proc *p, Lexer *l); +Node *node_new_lit(Proc *p, Value v); +Node *node_new_lit_bool(Proc *p, int b); +Node *node_new_lit_i64(Proc *p, int64_t i); + #define node_new(...) node_newv(__VA_ARGS__, NULL) void proc_init(Proc *proc, Str name); |
