aboutsummaryrefslogtreecommitdiff
path: root/src/AstGen.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-06-07 19:13:50 +0300
committerVeikka Tuominen <git@vexu.eu>2022-06-07 21:27:06 +0300
commitfbd7e4506f46b73e351e1f3eb5e7cfc16ebbfc1f (patch)
tree574527e8cba0bc39eb18b722ef6a4221528215c8 /src/AstGen.zig
parente4c0b848a46347fccced787488605ac66e83c38a (diff)
downloadzig-fbd7e4506f46b73e351e1f3eb5e7cfc16ebbfc1f.tar.gz
zig-fbd7e4506f46b73e351e1f3eb5e7cfc16ebbfc1f.zip
stage2: implement asm with multiple outputs
Diffstat (limited to 'src/AstGen.zig')
-rw-r--r--src/AstGen.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig
index 36944c1a8a..831071c479 100644
--- a/src/AstGen.zig
+++ b/src/AstGen.zig
@@ -6876,6 +6876,9 @@ fn asmExpr(
const constraint = (try astgen.strLitAsString(constraint_token)).index;
const has_arrow = token_tags[symbolic_name + 4] == .arrow;
if (has_arrow) {
+ if (output_type_bits != 0) {
+ return astgen.failNode(output_node, "inline assembly allows up to one output value", .{});
+ }
output_type_bits |= @as(u32, 1) << @intCast(u5, i);
const out_type_node = node_datas[output_node].lhs;
const out_type_inst = try typeExpr(gz, scope, out_type_node);
@@ -6892,7 +6895,7 @@ fn asmExpr(
outputs[i] = .{
.name = name,
.constraint = constraint,
- .operand = try localVarRef(gz, scope, rl, node, ident_token),
+ .operand = try localVarRef(gz, scope, .ref, node, ident_token),
};
}
}