aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codegen.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-09-01 23:44:51 +0900
committernsfisis <nsfisis@gmail.com>2025-09-01 23:55:56 +0900
commit09a245679c8d01eaec71b22985a9895667280cad (patch)
treef77024dbfb3f69d48bed3c7faaae994d0d9a173d /src/codegen.c
parent5c1716417609ac2cea1470b3d3bb38a6e758279a (diff)
downloadducc-09a245679c8d01eaec71b22985a9895667280cad.tar.gz
ducc-09a245679c8d01eaec71b22985a9895667280cad.tar.zst
ducc-09a245679c8d01eaec71b22985a9895667280cad.zip
feat: partially support anonymous structs/unions/enums
Diffstat (limited to 'src/codegen.c')
-rw-r--r--src/codegen.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 9aa9a77..bce71c9 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -2,19 +2,17 @@
#include "common.h"
#include "preprocess.h"
-enum GenMode {
+typedef enum {
GenMode_lval,
GenMode_rval,
-};
-typedef enum GenMode GenMode;
+} GenMode;
-struct CodeGen {
+typedef struct {
FILE* out;
int next_label;
int* loop_labels;
AstNode* current_func;
-};
-typedef struct CodeGen CodeGen;
+} CodeGen;
static CodeGen* codegen_new(FILE* out) {
CodeGen* g = calloc(1, sizeof(CodeGen));