From 22aa7559a37c49def05e8a43b12561b17a4af258 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Mon, 4 Aug 2025 17:38:23 -0400 Subject: make NodeInputs statically sized, peephole a + ~a and a ^ ~a --- ir.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ir.h') diff --git a/ir.h b/ir.h index 1cb3def..112ab8e 100644 --- a/ir.h +++ b/ir.h @@ -62,6 +62,15 @@ typedef enum { const char *node_type_name(NodeType t); +#define NODE_INPUT_MAX 2 + +typedef struct { + struct Node *data[NODE_INPUT_MAX]; + ptrdiff_t len; +} NodeInputs; + +typedef DYNARR(struct Node *) NodeOutputs; + typedef struct Node { union { struct Node *prev_free; @@ -70,7 +79,8 @@ typedef struct Node { int walked; NodeType type; LexSpan src_pos; - DYNARR(struct Node *) in, out; + NodeInputs in; + NodeOutputs out; Value val; }; }; -- cgit v1.2.3