commit 73c5481ef5b2d36af642a3cb715b6247c632b82d
parent 9e4de86912bda3eee5d83f894f9dd8b9e4282133
Author: Drew DeVault <sir@cmpwn.com>
Date: Thu, 2 Sep 2021 12:05:18 +0200
cmd/harec: add label to qval
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cmd/harec/qbe.ha b/cmd/harec/qbe.ha
@@ -3,9 +3,10 @@ use hare::types;
type global = str;
type temporary = str;
+type label = str;
type qvoid = void;
type constant = (u32 | u64 | f32 | f64 | str | qvoid);
-type qval = (global | temporary | constant);
+type qval = (global | temporary | label | constant);
type value = struct {
value: qval,
@@ -127,6 +128,7 @@ fn emit(
qv: qval => match (qv) {
g: global => fmt::fprintf(ctx.out, " ${}", g)!,
t: temporary => fmt::fprintf(ctx.out, " %{}", t)!,
+ l: label => fmt::fprintf(ctx.out, " @{}", l)!,
c: constant => match (c) {
qvoid => abort(),
v: (u32 | u64 | f32 | f64 | str) =>