diff options
| author | LemonBoy <thatlemon@gmail.com> | 2019-09-05 12:22:02 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-09-05 13:04:58 -0400 |
| commit | fabf45f5fc0a1827913be5675130db5db514c136 (patch) | |
| tree | c81705ac2785869cd53a7a2dc758c0b9be38c718 /src/ast_render.cpp | |
| parent | a7fd14096c8dbc9cb5ed9a3731753b24e32d5757 (diff) | |
| download | zig-fabf45f5fc0a1827913be5675130db5db514c136.tar.gz zig-fabf45f5fc0a1827913be5675130db5db514c136.zip | |
Add the noinline keyword for function declarations
Diffstat (limited to 'src/ast_render.cpp')
| -rw-r--r-- | src/ast_render.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ast_render.cpp b/src/ast_render.cpp index 54a659f7b1..fedd46a48b 100644 --- a/src/ast_render.cpp +++ b/src/ast_render.cpp @@ -124,8 +124,13 @@ static const char *export_string(bool is_export) { // zig_unreachable(); //} -static const char *inline_string(bool is_inline) { - return is_inline ? "inline " : ""; +static const char *inline_string(FnInline fn_inline) { + switch (fn_inline) { + case FnInlineAlways: return "inline "; + case FnInlineNever: return "noinline "; + case FnInlineAuto: return ""; + } + zig_unreachable(); } static const char *const_or_var_string(bool is_const) { @@ -436,7 +441,7 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) { const char *pub_str = visib_mod_string(node->data.fn_proto.visib_mod); const char *extern_str = extern_string(node->data.fn_proto.is_extern); const char *export_str = export_string(node->data.fn_proto.is_export); - const char *inline_str = inline_string(node->data.fn_proto.is_inline); + const char *inline_str = inline_string(node->data.fn_proto.fn_inline); fprintf(ar->f, "%s%s%s%sfn ", pub_str, inline_str, export_str, extern_str); if (node->data.fn_proto.name != nullptr) { print_symbol(ar, node->data.fn_proto.name); |
