Accept comptime-known expression for asm

This commit is contained in:
LemonBoy
2019-12-02 21:07:44 +01:00
committed by Andrew Kelley
parent b7be57766b
commit 26c8930b95
8 changed files with 193 additions and 88 deletions

View File

@@ -884,7 +884,9 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
{
AstNodeAsmExpr *asm_expr = &node->data.asm_expr;
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));
fprintf(ar->f, "asm%s (", volatile_str);
render_node_ungrouped(ar, asm_expr->asm_template);
fprintf(ar->f, ")");
print_indent(ar);
fprintf(ar->f, ": ");
for (size_t i = 0; i < asm_expr->output_list.length; i += 1) {