From 15c316b0d8152c0a1ad5b4b26efdf3fdc8cfb4c0 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 20 Mar 2019 19:00:23 -0400 Subject: add docs for assembly and fix global assembly parsing Previously, global assembly was parsed expecting it to have the template syntax. However global assembly has no inputs, outputs, or clobbers, and thus does not have template syntax. This is now fixed. This commit also adds a compile error for using volatile on global assembly, since it is meaningless. closes #1515 --- src/ast_render.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ast_render.cpp') diff --git a/src/ast_render.cpp b/src/ast_render.cpp index 84a952fa99..eb4b4e56c4 100644 --- a/src/ast_render.cpp +++ b/src/ast_render.cpp @@ -862,8 +862,8 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) { case NodeTypeAsmExpr: { AstNodeAsmExpr *asm_expr = &node->data.asm_expr; - const char *volatile_str = asm_expr->is_volatile ? " volatile" : ""; - fprintf(ar->f, "asm%s (\"%s\"\n", volatile_str, buf_ptr(asm_expr->asm_template)); + const char *volatile_str = (asm_expr->volatile_token != nullptr) ? " volatile" : ""; + fprintf(ar->f, "asm%s (\"%s\"\n", volatile_str, buf_ptr(&asm_expr->asm_template->data.str_lit.str)); print_indent(ar); fprintf(ar->f, ": "); for (size_t i = 0; i < asm_expr->output_list.length; i += 1) { -- cgit v1.2.3