diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-25 00:31:25 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-25 00:41:12 +0900 |
| commit | 7f29d50e4558a700b7611dc72e87e7922ac6a345 (patch) | |
| tree | b4a8b7c41457d209eb91e29f23044610d6b4b700 /src/codegen.c | |
| parent | 36da139565202a9a39d1e4261ab8bf950041518b (diff) | |
| download | ducc-7f29d50e4558a700b7611dc72e87e7922ac6a345.tar.gz ducc-7f29d50e4558a700b7611dc72e87e7922ac6a345.tar.zst ducc-7f29d50e4558a700b7611dc72e87e7922ac6a345.zip | |
feat: support static function
Diffstat (limited to 'src/codegen.c')
| -rw-r--r-- | src/codegen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen.c b/src/codegen.c index da2cd17..82c9c96 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -546,7 +546,9 @@ void codegen_stmt(CodeGen* g, AstNode* ast) { void codegen_func(CodeGen* g, AstNode* ast) { g->current_func = ast; - fprintf(g->out, ".globl %s\n", ast->name); + if (!ast->node_function_is_static) { + fprintf(g->out, ".globl %s\n", ast->name); + } fprintf(g->out, "%s:\n", ast->name); codegen_func_prologue(g, ast); |
