From df6955e6091d236f22728ffe6b3e520ee102153a Mon Sep 17 00:00:00 2001 From: Orkuncakilkaya Date: Fri, 28 Aug 2026 01:30:37 +0300 Subject: [PATCH] Phase 7g: the compiler builds its IR with interpolation, not `+` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Answering your readability point directly: the compiler's own string-building — left uglier by the 7c `+` migration, e.g. `emit_bind(("load i32, ptr " + ip))` — now reads as interpolation: emit_bind(("load i32, ptr " + ip)) -> emit_bind(`load i32, ptr {ip}`) emit_bind(("icmp eq i32 " + (kv + (", " + itoa(ak))))) -> emit_bind(`icmp eq i32 {kv}, {itoa(ak)}`) perr(("assign to unknown " + t.s)) -> perr(`assign to unknown {t.s}`) 164 concat chains across selfhost converted by a tool that flattens the `+` tree, keeps call/index parens (only grouping parens are rewritten), and converts only **brace-free** literals — LLVM IR structure strings full of `{`/`}` stay as `+` rather than becoming awkward `{{`/`}}`. No new language surface; interpolation already desugars to the same concat. Reseeded (22565 lines); C-free fixpoint holds byte-for-byte (the strongest proof the reconstruction is exact); goldens identical; 18/18. Co-Authored-By: Claude Opus 4.8 --- selfhost/emit_addr.ludic | 4 +- selfhost/emit_core.ludic | 8 +- selfhost/emit_decl.ludic | 2 +- selfhost/emit_ecs.ludic | 16 +- selfhost/emit_expr.ludic | 78 ++-- selfhost/emit_game.ludic | 10 +- selfhost/emit_head.ludic | 2 +- selfhost/emit_intrin.ludic | 40 +- selfhost/emit_intrin2.ludic | 14 +- selfhost/emit_machine.ludic | 6 +- selfhost/emit_math.ludic | 18 +- selfhost/emit_new.ludic | 38 +- selfhost/emit_query.ludic | 30 +- selfhost/emit_save.ludic | 10 +- selfhost/emit_spawn.ludic | 6 +- selfhost/emit_stmt.ludic | 26 +- selfhost/emit_ui.ludic | 2 +- selfhost/ludicc.seed.ll | 804 ++++++++++++++++++------------------ selfhost/main.ludic | 16 +- selfhost/parse.ludic | 2 +- 20 files changed, 566 insertions(+), 566 deletions(-) diff --git a/selfhost/emit_addr.ludic b/selfhost/emit_addr.ludic index 09676839..b3ead2de 100644 --- a/selfhost/emit_addr.ludic +++ b/selfhost/emit_addr.ludic @@ -8,9 +8,9 @@ var g_addr_ty: ptr # out-param: the type at the computed address fn emit_member_addr(e: Node) -> ptr { let base = emit_expr(e.a) let s = layout_node(base.ty) - if (s == null) { perr((("member access on non-aggregate ") + base.ty)) } + if (s == null) { perr(`member access on non-aggregate {base.ty}`) } let fidx = field_index(s, e.s) - if fidx < 0 { perr(("no such field " + e.s)) } + if fidx < 0 { perr(`no such field {e.s}`) } g_addr_ty = field_type(s, e.s) let r = nreg() emit(" "); emit(r); emit(" = getelementptr inbounds "); emit(layout_ty(base.ty)) diff --git a/selfhost/emit_core.ludic b/selfhost/emit_core.ludic index 95f2ed5f..534225c1 100644 --- a/selfhost/emit_core.ludic +++ b/selfhost/emit_core.ludic @@ -39,13 +39,13 @@ fn emith(s: ptr) -> void { buf_puts(head, s) } # stack slots MUST live in the entry block (an alloca in a loop walks the stack # off its end), so they go into a per-function buffer spliced in at entry. fn emit_alloca(llt: ptr) -> ptr { - let r = (("%t") + itoa(ll_t)); ll_t = ll_t + 1 + let r = `%t{itoa(ll_t)}`; ll_t = ll_t + 1 buf_puts(falloc, " "); buf_puts(falloc, r); buf_puts(falloc, " = alloca "); buf_puts(falloc, llt); buf_puts(falloc, "\n") return r } # "%t" fresh register -fn nreg() -> ptr { let r = (("%t") + itoa(ll_t)); ll_t = ll_t + 1; return r } +fn nreg() -> ptr { let r = `%t{itoa(ll_t)}`; ll_t = ll_t + 1; return r } fn lbl(pfx: ptr) -> ptr { let r = (pfx + itoa(ll_lbl)); ll_lbl = ll_lbl + 1; return r } # Ludic type -> LLVM type. int/bool are i32; everything else (ptr/str/struct/ @@ -123,12 +123,12 @@ fn find_fn(name: ptr) -> Node { var g_computed: []Node # each: s = "Prop.field", ty = result type, a = expr fn register_computed(prop: ptr, field: ptr, ty: ptr, e: Node) -> void { - let cf = node(N_FIELD); cf.s = (prop + ("." + field)); cf.ty = ty; cf.a = e + let cf = node(N_FIELD); cf.s = `{prop}.{field}`; cf.ty = ty; cf.a = e push(g_computed, cf) } fn computed_expr(prop: ptr, field: ptr) -> Node { if (prop == null) { return null } - let key = (prop + ("." + field)) + let key = `{prop}.{field}` var i = 0 while i < len(g_computed) { if (g_computed[i].s == key) { return g_computed[i].a }; i = i + 1 } return null diff --git a/selfhost/emit_decl.ludic b/selfhost/emit_decl.ludic index 072d1b83..9f2c0178 100644 --- a/selfhost/emit_decl.ludic +++ b/selfhost/emit_decl.ludic @@ -33,7 +33,7 @@ fn emit_fn(d: Node) -> void { if not g_term { emit(" br label %ret\n") } emit("ret:\n") if (rl == "void") { emit(" ret void\n") } - else { let r = emit_bind(("load " + (rl + (", ptr %retval")))); emit(" ret "); emit(rl); emit(" "); emit(r); emit("\n") } + else { let r = emit_bind(`load {rl}, ptr %retval`); emit(" ret "); emit(rl); emit(" "); emit(r); emit("\n") } code = saved emit("define "); emit(rl); emit(" @fn_"); emit(d.s); emit("("); emit_params_sig(d); emit(") {\nentry:\n") emit(buf_str(falloc)) diff --git a/selfhost/emit_ecs.ludic b/selfhost/emit_ecs.ludic index fd943ab7..fb091522 100644 --- a/selfhost/emit_ecs.ludic +++ b/selfhost/emit_ecs.ludic @@ -27,9 +27,9 @@ fn emit_ecs_storage() -> void { emith("@L_key = internal global i32 0\n") emith("@L_entc = internal global i32 0\n") let me = itoa(MAX_ENT) - emith(("@L_alive = internal global [" + (me + " x i32] zeroinitializer\n"))) - emith(("@L_kind = internal global [" + (me + " x i32] zeroinitializer\n"))) - emith(("@L_freelist = internal global [" + (me + " x i32] zeroinitializer\n"))) + emith(`@L_alive = internal global [{me} x i32] zeroinitializer\n`) + emith(`@L_kind = internal global [{me} x i32] zeroinitializer\n`) + emith(`@L_freelist = internal global [{me} x i32] zeroinitializer\n`) emith("@L_freen = internal global i32 0\n") var i = 0 while i < len(prog) { @@ -38,12 +38,12 @@ fn emit_ecs_storage() -> void { # header). Every property in an ECS program is a component today; a property # used only via `new` would not need these, but no such program mixes the two. if c.kind == N_COMP { - emith(("@S_" + (c.s + (" = internal global [" + (me + ((" x %Cmp_") + (c.s + "] zeroinitializer\n"))))))) - emith(("@H_" + (c.s + (" = internal global [" + (me + " x i8] zeroinitializer\n"))))) + emith(`@S_{c.s} = internal global [{me} x %Cmp_{c.s}] zeroinitializer\n`) + emith(`@H_{c.s} = internal global [{me} x i8] zeroinitializer\n`) } # one enabled-flag global per model and per handler (default enabled) - if c.kind == N_ARCH { emith(("@ME_" + (c.s + " = internal global i32 1\n"))) } - if c.kind == N_SYS { emith(("@HE_" + (c.s + " = internal global i32 1\n"))) } + if c.kind == N_ARCH { emith(`@ME_{c.s} = internal global i32 1\n`) } + if c.kind == N_SYS { emith(`@HE_{c.s} = internal global i32 1\n`) } i = i + 1 } } @@ -55,7 +55,7 @@ fn emit_ecs_allocator() -> void { var i = 0 while i < len(prog) { if prog[i].kind == N_COMP { - let hn = (("%h") + itoa(i)) + let hn = `%h{itoa(i)}` emit(" "); emit(hn); emit(" = getelementptr inbounds ["); emit(me); emit(" x i8], ptr @H_"); emit(prog[i].s); emit(", i32 0, i32 %e\n") emit(" store i8 0, ptr "); emit(hn); emit("\n") } diff --git a/selfhost/emit_expr.ludic b/selfhost/emit_expr.ludic index 8bf2547e..f894a373 100644 --- a/selfhost/emit_expr.ludic +++ b/selfhost/emit_expr.ludic @@ -1,7 +1,7 @@ # emit_expr.ludic — lower an expression to IR, returning its register and type. fn emit_load_at(addr: ptr, ty: ptr) -> Val { - let r = emit_bind(("load " + (llty(ty) + (", ptr " + addr)))) + let r = emit_bind(`load {llty(ty)}, ptr {addr}`) return val(r, ty) } @@ -10,20 +10,20 @@ fn emit_load_at(addr: ptr, ty: ptr) -> Val { fn emit_logic(e: Node) -> Val { let slot = emit_alloca("i32") let la = emit_expr(e.a) - let lc = emit_bind(("icmp ne i32 " + (la.code + ", 0"))) - let lz = emit_bind(("zext i1 " + (lc + " to i32"))) + let lc = emit_bind(`icmp ne i32 {la.code}, 0`) + let lz = emit_bind(`zext i1 {lc} to i32`) emit(" store i32 "); emit(lz); emit(", ptr "); emit(slot); emit("\n") let ev = lbl("sc"); let done = lbl("scend") if (e.s == "and") { emit(" br i1 "); emit(lc); emit(", label %"); emit(ev); emit(", label %"); emit(done); emit("\n") } else { emit(" br i1 "); emit(lc); emit(", label %"); emit(done); emit(", label %"); emit(ev); emit("\n") } emit(ev); emit(":\n") let rb = emit_expr(e.b) - let rc = emit_bind(("icmp ne i32 " + (rb.code + ", 0"))) - let rz = emit_bind(("zext i1 " + (rc + " to i32"))) + let rc = emit_bind(`icmp ne i32 {rb.code}, 0`) + let rz = emit_bind(`zext i1 {rc} to i32`) emit(" store i32 "); emit(rz); emit(", ptr "); emit(slot); emit("\n") emit(" br label %"); emit(done); emit("\n") emit(done); emit(":\n") - return val(emit_bind(("load i32, ptr " + slot)), "bool") + return val(emit_bind(`load i32, ptr {slot}`), "bool") } fn cmp_code(op: ptr) -> ptr { @@ -53,7 +53,7 @@ fn arith_code(op: ptr) -> ptr { # widen an int value to Q16.16 by shifting left 16 (a fixed value passes through) fn to_fixed(v: Val) -> ptr { if (v.ty == "fixed") { return v.code } - return emit_bind(("shl i32 " + (v.code + ", 16"))) + return emit_bind(`shl i32 {v.code}, 16`) } # string operators: `a + b` concatenates, `a == b` / `a != b` compare by content. @@ -61,12 +61,12 @@ fn to_fixed(v: Val) -> ptr { fn emit_str_op(op: ptr, a: Val, b: Val) -> Val { g_uses_str = true if (op == ("+")) { - return val(emit_bind(("call ptr @fn_str_concat(ptr " + (a.code + (", ptr " + (b.code + ")"))))), "str") + return val(emit_bind(`call ptr @fn_str_concat(ptr {a.code}, ptr {b.code})`), "str") } - let r = emit_bind(("call i32 @fn_str_eq(ptr " + (a.code + (", ptr " + (b.code + ")"))))) + let r = emit_bind(`call i32 @fn_str_eq(ptr {a.code}, ptr {b.code})`) if (op == ("!=")) { - let c = emit_bind(("icmp eq i32 " + (r + ", 0"))) - return val(emit_bind(("zext i1 " + (c + " to i32"))), "bool") + let c = emit_bind(`icmp eq i32 {r}, 0`) + return val(emit_bind(`zext i1 {c} to i32`), "bool") } return val(r, "bool") } @@ -90,35 +90,35 @@ fn emit_bin(e: Node) -> Val { var ct = "i32" if fx { ac = to_fixed(a); bc = to_fixed(b) } else { if (llty(a.ty) == "ptr") or (llty(b.ty) == "ptr") { ct = "ptr" } } # `p == null`, str/record identity - let c = emit_bind(("icmp " + (cmp_code(e.s) + ((" " + (ct + " ")) + (ac + (", " + bc)))))) - return val(emit_bind(("zext i1 " + (c + " to i32"))), "bool") + let c = emit_bind(`icmp {cmp_code(e.s)} {ct} {ac}, {bc}`) + return val(emit_bind(`zext i1 {c} to i32`), "bool") } if fx { let af = to_fixed(a); let bf = to_fixed(b) if (e.s == ("*")) { - let a64 = emit_bind(("sext i32 " + (af + " to i64"))) - let b64 = emit_bind(("sext i32 " + (bf + " to i64"))) - let m = emit_bind(("mul i64 " + (a64 + (", " + b64)))) - let sh = emit_bind(("ashr i64 " + (m + ", 16"))) - return val(emit_bind(("trunc i64 " + (sh + " to i32"))), "fixed") + let a64 = emit_bind(`sext i32 {af} to i64`) + let b64 = emit_bind(`sext i32 {bf} to i64`) + let m = emit_bind(`mul i64 {a64}, {b64}`) + let sh = emit_bind(`ashr i64 {m}, 16`) + return val(emit_bind(`trunc i64 {sh} to i32`), "fixed") } if (e.s == ("/")) { - let a64 = emit_bind(("sext i32 " + (af + " to i64"))) - let ash = emit_bind(("shl i64 " + (a64 + ", 16"))) - let b64 = emit_bind(("sext i32 " + (bf + " to i64"))) - let dv = emit_bind(("sdiv i64 " + (ash + (", " + b64)))) - return val(emit_bind(("trunc i64 " + (dv + " to i32"))), "fixed") + let a64 = emit_bind(`sext i32 {af} to i64`) + let ash = emit_bind(`shl i64 {a64}, 16`) + let b64 = emit_bind(`sext i32 {bf} to i64`) + let dv = emit_bind(`sdiv i64 {ash}, {b64}`) + return val(emit_bind(`trunc i64 {dv} to i32`), "fixed") } - let r = emit_bind((arith_code(e.s) + (" i32 " + (af + (", " + bf))))) + let r = emit_bind(`{arith_code(e.s)} i32 {af}, {bf}`) return val(r, "fixed") } - let r = emit_bind((arith_code(e.s) + (" i32 " + (a.code + (", " + b.code))))) + let r = emit_bind(`{arith_code(e.s)} i32 {a.code}, {b.code}`) return val(r, "int") } fn emit_call(e: Node) -> Val { let name = e.a.s - if (name == "self") { if nself == 0 { return val("0", "entity") }; return val(emit_bind(("load i32, ptr " + self_stk[nself - 1])), "entity") } + if (name == "self") { if nself == 0 { return val("0", "entity") }; return val(emit_bind(`load i32, ptr {self_stk[nself - 1]}`), "entity") } if (name == "key") { return val(emit_bind("load i32, ptr @L_key"), "int") } if (name == "save") { emit(" call void @L_save()\n"); return val("0", "void") } if (name == "ui_build") { emit(" call void @ui_build()\n"); return val("0", "void") } @@ -130,16 +130,16 @@ fn emit_call(e: Node) -> Val { let a = emit_expr(e.kids[0]) if (llty(a.ty) == "ptr") { return a } g_uses_intstr = true - return val(emit_bind(("call ptr @fn_int_str(i32 " + (a.code + ")"))), "str") + return val(emit_bind(`call ptr @fn_int_str(i32 {a.code})`), "str") } if (name == "print") { # print(x): a value + newline (int or string) let a = emit_expr(e.kids[0]) - if (llty(a.ty) == "ptr") { emit(" call i32 (ptr, ...) @printf(ptr @.fmt_line, ptr " + (a.code + ")\n")) } - else { emit(" call i32 (ptr, ...) @printf(ptr @.fmt_int, i32 " + (a.code + ")\n")) } + if (llty(a.ty) == "ptr") { emit(" call i32 (ptr, ...) @printf(ptr @.fmt_line, ptr " + `{a.code})\n`) } + else { emit(" call i32 (ptr, ...) @printf(ptr @.fmt_int, i32 " + `{a.code})\n`) } return val("0", "void") } - if (name == "fx") { let a = emit_expr(e.kids[0]); return val(emit_bind(("shl i32 " + (a.code + ", 16"))), "fixed") } - if (name == "flr") { let a = emit_expr(e.kids[0]); return val(emit_bind(("ashr i32 " + (a.code + ", 16"))), "int") } + if (name == "fx") { let a = emit_expr(e.kids[0]); return val(emit_bind(`shl i32 {a.code}, 16`), "fixed") } + if (name == "flr") { let a = emit_expr(e.kids[0]); return val(emit_bind(`ashr i32 {a.code}, 16`), "int") } if is_intrinsic(name) { return emit_intrinsic(name, e) } if is_intrinsic2(name) { return emit_intrinsic2(name, e) } if is_math_builtin(name) { return emit_math_builtin(name, e) } @@ -147,9 +147,9 @@ fn emit_call(e: Node) -> Val { var cname = name if (fn2 == null) { # a builtin like clear()/reg() is satisfied by its rt_ function - let rtname = ("rt_" + name) + let rtname = `rt_{name}` fn2 = find_fn(rtname) - if (fn2 == null) { perr(("unknown function " + name)) } + if (fn2 == null) { perr(`unknown function {name}`) } cname = rtname } # evaluate args first (their IR is emitted before the call instruction) @@ -189,12 +189,12 @@ fn emit_expr(e: Node) -> Val { let g = find_global(e.s) if (g != null) { if g.kind == N_CONST { return val(itoa(g.a.ival), "int") } - let r = emit_bind(("load " + (llty(g.ty) + (", ptr @g_" + e.s)))) + let r = emit_bind(`load {llty(g.ty)}, ptr @g_{e.s}`) return val(r, g.ty) } # a UI_ that is not a const/var resolves to its widget index if is_ui_ident(e.s) { return val(itoa(ui_index_of(e.s)), "int") } - perr(("unknown identifier " + e.s)) + perr(`unknown identifier {e.s}`) } if e.kind == E_MEMBER { if e.a.kind == E_ID { # `Enum.Variant` -> its ordinal, a compile-time int @@ -213,10 +213,10 @@ fn emit_expr(e: Node) -> Val { if e.kind == E_BIN { return emit_bin(e) } if e.kind == E_UN { let a = emit_expr(e.a) - if (e.s == ("-")) { return val(emit_bind(("sub i32 0, " + a.code)), "int") } - if (e.s == "~") { return val(emit_bind(("xor i32 " + (a.code + (", -1")))), "int") } - let c = emit_bind(("icmp eq i32 " + (a.code + ", 0"))) - return val(emit_bind(("zext i1 " + (c + " to i32"))), "bool") + if (e.s == ("-")) { return val(emit_bind(`sub i32 0, {a.code}`), "int") } + if (e.s == "~") { return val(emit_bind(`xor i32 {a.code}, -1`), "int") } + let c = emit_bind(`icmp eq i32 {a.code}, 0`) + return val(emit_bind(`zext i1 {c} to i32`), "bool") } perr("cannot emit expression") return val("0", "int") diff --git a/selfhost/emit_game.ludic b/selfhost/emit_game.ludic index 1113df6d..679450c0 100644 --- a/selfhost/emit_game.ludic +++ b/selfhost/emit_game.ludic @@ -25,8 +25,8 @@ fn emit_calls_for_phase(phase: ptr) -> void { while i < len(prog) { let d = prog[i] if d.kind == N_SYS and (d.ty == phase) { # skip a disabled handler - let he = emit_bind(("load i32, ptr @HE_" + d.s)) - let hc = emit_bind(("icmp ne i32 " + (he + ", 0"))) + let he = emit_bind(`load i32, ptr @HE_{d.s}`) + let hc = emit_bind(`icmp ne i32 {he}, 0`) let run = lbl("hrun"); let skip = lbl("hskip") emit(" br i1 "); emit(hc); emit(", label %"); emit(run); emit(", label %"); emit(skip); emit("\n") emit(run); emit(":\n call void @sys_"); emit(d.s); emit("()\n") @@ -76,11 +76,11 @@ fn emit_game_main() -> void { emit(" br label %loop\n") emit("loop:\n") let r = emit_bind("load i32, ptr @L_running") - let rc = emit_bind(("icmp ne i32 " + (r + ", 0"))) + let rc = emit_bind(`icmp ne i32 {r}, 0`) if (find_fn("rt_running") != null) { let pr = emit_bind("call i32 @fn_rt_running()") - let pc = emit_bind(("icmp ne i32 " + (pr + ", 0"))) - let go = emit_bind(("and i1 " + (rc + (", " + pc)))) + let pc = emit_bind(`icmp ne i32 {pr}, 0`) + let go = emit_bind(`and i1 {rc}, {pc}`) emit(" br i1 "); emit(go); emit(", label %body, label %done\n") } else { emit(" br i1 "); emit(rc); emit(", label %body, label %done\n") diff --git a/selfhost/emit_head.ludic b/selfhost/emit_head.ludic index 990a8d14..141f0ecf 100644 --- a/selfhost/emit_head.ludic +++ b/selfhost/emit_head.ludic @@ -5,7 +5,7 @@ fn hexdig(n: int) -> int { if n < 10 { return 48 + n }; return 55 + n } # 0-9 # emit `@.strN = ... c"escaped\00"` and return its name; % and non-print -> \XX fn emit_str_const(s: ptr) -> ptr { - let name = ("@.str" + itoa(ll_str)) + let name = `@.str{itoa(ll_str)}` ll_str = ll_str + 1 let n = len(s) emith(name); emith(" = private unnamed_addr constant [") diff --git a/selfhost/emit_intrin.ludic b/selfhost/emit_intrin.ludic index 5195a5c6..343a9b69 100644 --- a/selfhost/emit_intrin.ludic +++ b/selfhost/emit_intrin.ludic @@ -27,48 +27,48 @@ fn emit_intrinsic(name: ptr, e: Node) -> Val { # ptr_null / ptr_is_null are the `null` literal and `x == null` now. if (name == "mem_alloc") { let n = arg_code(e, 0) - let w = emit_bind(("zext i32 " + (n + " to i64"))) - return val(emit_bind(("call ptr @malloc(i64 " + (w + ")"))), "ptr") + let w = emit_bind(`zext i32 {n} to i64`) + return val(emit_bind(`call ptr @malloc(i64 {w})`), "ptr") } if (name == "mem_realloc") { let p = arg_code(e, 0); let n = arg_code(e, 1) - let w = emit_bind(("zext i32 " + (n + " to i64"))) - return val(emit_bind(("call ptr @realloc(ptr " + (p + (", i64 " + (w + ")"))))), "ptr") + let w = emit_bind(`zext i32 {n} to i64`) + return val(emit_bind(`call ptr @realloc(ptr {p}, i64 {w})`), "ptr") } if (name == "peek8") { let p = arg_code(e, 0); let i = arg_code(e, 1) let a = emit_gep_i8(p, i) - let b = emit_bind(("load i8, ptr " + a)) - return val(emit_bind(("zext i8 " + (b + " to i32"))), "int") + let b = emit_bind(`load i8, ptr {a}`) + return val(emit_bind(`zext i8 {b} to i32`), "int") } if (name == "poke8") { let p = arg_code(e, 0); let i = arg_code(e, 1); let v = arg_code(e, 2) let a = emit_gep_i8(p, i) - let t = emit_bind(("trunc i32 " + (v + " to i8"))) + let t = emit_bind(`trunc i32 {v} to i8`) emit(" store i8 "); emit(t); emit(", ptr "); emit(a); emit("\n") return val("0", "void") } if (name == "file_open") { let p = arg_code(e, 0); let m = arg_code(e, 1) - return val(emit_bind(("call ptr @fopen(ptr " + (p + (", ptr " + (m + ")"))))), "ptr") + return val(emit_bind(`call ptr @fopen(ptr {p}, ptr {m})`), "ptr") } if (name == "file_read") or (name == "file_write") { let f = arg_code(e, 0); let b = arg_code(e, 1); let n = arg_code(e, 2) - let w = emit_bind(("zext i32 " + (n + " to i64"))) + let w = emit_bind(`zext i32 {n} to i64`) var fn2 = "@fread" if (name == "file_write") { fn2 = "@fwrite" } - let r = emit_bind(("call i64 " + (fn2 + ("(ptr " + (b + (", i64 1, i64 " + (w + (", ptr " + (f + ")"))))))))) - return val(emit_bind(("trunc i64 " + (r + " to i32"))), "int") + let r = emit_bind(`call i64 {fn2}(ptr {b}, i64 1, i64 {w}, ptr {f})`) + return val(emit_bind(`trunc i64 {r} to i32`), "int") } if (name == "file_seek") { let f = arg_code(e, 0); let off = arg_code(e, 1); let wh = arg_code(e, 2) - let o = emit_bind(("sext i32 " + (off + " to i64"))) - return val(emit_bind(("call i32 @fseek(ptr " + (f + (", i64 " + (o + (", i32 " + (wh + ")"))))))), "int") + let o = emit_bind(`sext i32 {off} to i64`) + return val(emit_bind(`call i32 @fseek(ptr {f}, i64 {o}, i32 {wh})`), "int") } if (name == "file_tell") { let f = arg_code(e, 0) - let r = emit_bind(("call i64 @ftell(ptr " + (f + ")"))) - return val(emit_bind(("trunc i64 " + (r + " to i32"))), "int") + let r = emit_bind(`call i64 @ftell(ptr {f})`) + return val(emit_bind(`trunc i64 {r} to i32`), "int") } if (name == "file_close") { let f = arg_code(e, 0) @@ -80,8 +80,8 @@ fn emit_intrinsic(name: ptr, e: Node) -> Val { if (name == "os_arg") { let i = arg_code(e, 0) let v = emit_bind("load ptr, ptr @L_argv") - let q = emit_bind(("getelementptr ptr, ptr " + (v + (", i32 " + i)))) - return val(emit_bind(("load ptr, ptr " + q)), "str") + let q = emit_bind(`getelementptr ptr, ptr {v}, i32 {i}`) + return val(emit_bind(`load ptr, ptr {q}`), "str") } if (name == "os_exit") { let n = arg_code(e, 0) @@ -94,18 +94,18 @@ fn emit_intrinsic(name: ptr, e: Node) -> Val { if (name == "file_stdout") { return val(emit_bind("load ptr, ptr @__stdoutp"), "ptr") } if (name == "os_system") { let c = arg_code(e, 0) - return val(emit_bind(("call i32 @system(ptr " + (c + ")"))), "int") + return val(emit_bind(`call i32 @system(ptr {c})`), "int") } if (name == "os_getenv") { let n = arg_code(e, 0) - return val(emit_bind(("call ptr @getenv(ptr " + (n + ")"))), "str") + return val(emit_bind(`call ptr @getenv(ptr {n})`), "str") } # bitwise ops are the operators & | ^ << >> ~ now (see emit_bin / p_mul). if (name == "peek32") { let p = arg_code(e, 0); let i = arg_code(e, 1) let g = nreg() emit(" "); emit(g); emit(" = getelementptr inbounds i32, ptr "); emit(p); emit(", i32 "); emit(i); emit("\n") - return val(emit_bind(("load i32, ptr " + g)), "int") + return val(emit_bind(`load i32, ptr {g}`), "int") } if (name == "poke32") { let p = arg_code(e, 0); let i = arg_code(e, 1); let v = arg_code(e, 2) diff --git a/selfhost/emit_intrin2.ludic b/selfhost/emit_intrin2.ludic index c4a20b08..6688ec3d 100644 --- a/selfhost/emit_intrin2.ludic +++ b/selfhost/emit_intrin2.ludic @@ -22,13 +22,13 @@ fn emit_intrinsic2(name: ptr, e: Node) -> Val { } if (name == "mem_copy") { let d = arg_code(e, 0); let s = arg_code(e, 1); let n = arg_code(e, 2) - let w = emit_bind(("zext i32 " + (n + " to i64"))) + let w = emit_bind(`zext i32 {n} to i64`) emit(" call ptr @memcpy(ptr "); emit(d); emit(", ptr "); emit(s); emit(", i64 "); emit(w); emit(")\n") return val("0", "void") } if (name == "mem_set") { let p = arg_code(e, 0); let v = arg_code(e, 1); let n = arg_code(e, 2) - let w = emit_bind(("zext i32 " + (n + " to i64"))) + let w = emit_bind(`zext i32 {n} to i64`) emit(" call ptr @memset(ptr "); emit(p); emit(", i32 "); emit(v); emit(", i64 "); emit(w); emit(")\n") return val("0", "void") } @@ -44,17 +44,17 @@ fn emit_intrinsic2(name: ptr, e: Node) -> Val { } if (name == "str_len") { let s = arg_code(e, 0) - let r = emit_bind(("call i64 @strlen(ptr " + (s + ")"))) - return val(emit_bind(("trunc i64 " + (r + " to i32"))), "int") + let r = emit_bind(`call i64 @strlen(ptr {s})`) + return val(emit_bind(`trunc i64 {r} to i32`), "int") } if (name == "os_time") { let r = emit_bind("call i64 @time(ptr null)") - return val(emit_bind(("trunc i64 " + (r + " to i32"))), "int") + return val(emit_bind(`trunc i64 {r} to i32`), "int") } if (name == "peekf") { let p = arg_code(e, 0); let i = arg_code(e, 1) let g = nreg(); emit(" "); emit(g); emit(" = getelementptr inbounds i32, ptr "); emit(p); emit(", i32 "); emit(i); emit("\n") - return val(emit_bind(("load i32, ptr " + g)), "fixed") + return val(emit_bind(`load i32, ptr {g}`), "fixed") } if (name == "pokef") { let p = arg_code(e, 0); let i = arg_code(e, 1); let v = arg_code(e, 2) @@ -65,7 +65,7 @@ fn emit_intrinsic2(name: ptr, e: Node) -> Val { if (name == "peekp") { let p = arg_code(e, 0); let i = arg_code(e, 1) let g = nreg(); emit(" "); emit(g); emit(" = getelementptr inbounds ptr, ptr "); emit(p); emit(", i32 "); emit(i); emit("\n") - return val(emit_bind(("load ptr, ptr " + g)), "ptr") + return val(emit_bind(`load ptr, ptr {g}`), "ptr") } if (name == "pokep") { let p = arg_code(e, 0); let i = arg_code(e, 1); let v = arg_code(e, 2) diff --git a/selfhost/emit_machine.ludic b/selfhost/emit_machine.ludic index 674129d6..cc722c88 100644 --- a/selfhost/emit_machine.ludic +++ b/selfhost/emit_machine.ludic @@ -4,7 +4,7 @@ fn emit_machine(st: Node) -> void { let regv = emit_expr(st.a) - let s = emit_bind(("call i32 @fn_rt_reg(i32 " + (regv.code + ")"))) + let s = emit_bind(`call i32 @fn_rt_reg(i32 {regv.code})`) if nmach < len(mach_stk) { mach_stk[nmach] = st } else { push(mach_stk, st) } nmach = nmach + 1 let endl = lbl("smend") @@ -12,7 +12,7 @@ fn emit_machine(st: Node) -> void { while i < len(st.kids) { let state = st.kids[i] let v = emit_expr(state.b) - let c = emit_bind(("icmp eq i32 " + (s + (", " + v.code)))) + let c = emit_bind(`icmp eq i32 {s}, {v.code}`) let body = lbl("sbody"); let nxt = lbl("sarm") emit(" br i1 "); emit(c); emit(", label %"); emit(body); emit(", label %"); emit(nxt); emit("\n") emit(body); emit(":\n"); g_term = false @@ -32,7 +32,7 @@ fn emit_become(st: Node) -> void { var target: Node = null var i = 0 while i < len(m.kids) { if (m.kids[i].s == st.s) { target = m.kids[i] }; i = i + 1 } - if (target == null) { perr(("become: no state " + st.s)) } + if (target == null) { perr(`become: no state {st.s}`) } let regv = emit_expr(m.a) let sv = emit_expr(target.b) emit(" call void @fn_rt_set_reg(i32 "); emit(regv.code); emit(", i32 "); emit(sv.code); emit(")\n") diff --git a/selfhost/emit_math.ludic b/selfhost/emit_math.ludic index f3e10acd..ccf8a395 100644 --- a/selfhost/emit_math.ludic +++ b/selfhost/emit_math.ludic @@ -9,21 +9,21 @@ fn is_math_builtin(name: ptr) -> bool { fn emit_math_builtin(name: ptr, e: Node) -> Val { if (name == "abs") { let a = emit_expr(e.kids[0]) - let c = emit_bind(("icmp slt i32 " + (a.code + ", 0"))) - let n = emit_bind(("sub i32 0, " + a.code)) - return val(emit_bind(("select i1 " + (c + (", i32 " + (n + (", i32 " + a.code)))))), "int") + let c = emit_bind(`icmp slt i32 {a.code}, 0`) + let n = emit_bind(`sub i32 0, {a.code}`) + return val(emit_bind(`select i1 {c}, i32 {n}, i32 {a.code}`), "int") } if (name == "min") or (name == "max") { let a = emit_expr(e.kids[0]); let b = emit_expr(e.kids[1]) var op = "slt" if (name == "max") { op = "sgt" } - let c = emit_bind(("icmp " + (op + (" i32 " + (a.code + (", " + b.code)))))) - return val(emit_bind(("select i1 " + (c + (", i32 " + (a.code + (", i32 " + b.code)))))), "int") + let c = emit_bind(`icmp {op} i32 {a.code}, {b.code}`) + return val(emit_bind(`select i1 {c}, i32 {a.code}, i32 {b.code}`), "int") } # clamp(v, lo, hi) = max(lo, min(v, hi)) let v = emit_expr(e.kids[0]); let lo = emit_expr(e.kids[1]); let hi = emit_expr(e.kids[2]) - let c1 = emit_bind(("icmp slt i32 " + (v.code + (", " + hi.code)))) - let t = emit_bind(("select i1 " + (c1 + (", i32 " + (v.code + (", i32 " + hi.code)))))) - let c2 = emit_bind(("icmp sgt i32 " + (lo.code + (", " + t)))) - return val(emit_bind(("select i1 " + (c2 + (", i32 " + (lo.code + (", i32 " + t)))))), "int") + let c1 = emit_bind(`icmp slt i32 {v.code}, {hi.code}`) + let t = emit_bind(`select i1 {c1}, i32 {v.code}, i32 {hi.code}`) + let c2 = emit_bind(`icmp sgt i32 {lo.code}, {t}`) + return val(emit_bind(`select i1 {c2}, i32 {lo.code}, i32 {t}`), "int") } diff --git a/selfhost/emit_new.ludic b/selfhost/emit_new.ludic index 45418c9d..daf0b158 100644 --- a/selfhost/emit_new.ludic +++ b/selfhost/emit_new.ludic @@ -3,8 +3,8 @@ # holder points at, so growth is visible to every holder. fn emit_sizeof(llt: ptr) -> ptr { - let p = emit_bind(("getelementptr " + (llt + ", ptr null, i32 1"))) - return emit_bind(("ptrtoint ptr " + (p + " to i64"))) + let p = emit_bind(`getelementptr {llt}, ptr null, i32 1`) + return emit_bind(`ptrtoint ptr {p} to i64`) } fn emit_new_struct(name: ptr) -> Val { @@ -12,7 +12,7 @@ fn emit_new_struct(name: ptr) -> Val { if (s == null) { perr("unknown record type in new") } let lty = layout_ty(name) let sz = emit_sizeof(lty) - let obj = emit_bind(("call ptr @malloc(i64 " + (sz + ")"))) + let obj = emit_bind(`call ptr @malloc(i64 {sz})`) var f = 0 while f < len(s.kids) { let fd = s.kids[f] @@ -31,7 +31,7 @@ fn emit_new_struct(name: ptr) -> Val { fn emit_new_slice(ty: ptr) -> Val { let sz = emit_sizeof("%LSlice") - let h = emit_bind(("call ptr @malloc(i64 " + (sz + ")"))) + let h = emit_bind(`call ptr @malloc(i64 {sz})`) let d0 = nreg(); emit(" "); emit(d0); emit(" = getelementptr inbounds %LSlice, ptr "); emit(h); emit(", i32 0, i32 0\n") emit(" store ptr null, ptr "); emit(d0); emit("\n") let d1 = nreg(); emit(" "); emit(d1); emit(" = getelementptr inbounds %LSlice, ptr "); emit(h); emit(", i32 0, i32 1\n") @@ -52,10 +52,10 @@ fn emit_len(e: Node) -> Val { let s = emit_expr(e.kids[0]) if is_slice_ty(s.ty) { # a slice: read its header length let lp = slice_field(s.code, 1) - return val(emit_bind(("load i32, ptr " + lp)), "int") + return val(emit_bind(`load i32, ptr {lp}`), "int") } - let r = emit_bind(("call i64 @strlen(ptr " + (s.code + ")"))) # a string: byte length - return val(emit_bind(("trunc i64 " + (r + " to i32"))), "int") + let r = emit_bind(`call i64 @strlen(ptr {s.code})`) # a string: byte length + return val(emit_bind(`trunc i64 {r} to i32`), "int") } fn emit_push(e: Node) -> Val { @@ -64,30 +64,30 @@ fn emit_push(e: Node) -> Val { let elt = llty(el) let h = s.code let lp = slice_field(h, 1); let cp = slice_field(h, 2); let dp = slice_field(h, 0) - let l = emit_bind(("load i32, ptr " + lp)) - let c = emit_bind(("load i32, ptr " + cp)) - let full = emit_bind(("icmp sge i32 " + (l + (", " + c)))) + let l = emit_bind(`load i32, ptr {lp}`) + let c = emit_bind(`load i32, ptr {cp}`) + let full = emit_bind(`icmp sge i32 {l}, {c}`) let grow = lbl("grow"); let put = lbl("put") emit(" br i1 "); emit(full); emit(", label %"); emit(grow); emit(", label %"); emit(put); emit("\n") emit(grow); emit(":\n") - let dbl = emit_bind(("mul i32 " + (c + ", 2"))) - let isz = emit_bind(("icmp eq i32 " + (c + ", 0"))) - let nc = emit_bind(("select i1 " + (isz + (", i32 8, i32 " + dbl)))) + let dbl = emit_bind(`mul i32 {c}, 2`) + let isz = emit_bind(`icmp eq i32 {c}, 0`) + let nc = emit_bind(`select i1 {isz}, i32 8, i32 {dbl}`) let esz = emit_sizeof(elt) - let ncw = emit_bind(("zext i32 " + (nc + " to i64"))) - let bytes = emit_bind(("mul i64 " + (ncw + (", " + esz)))) - let old = emit_bind(("load ptr, ptr " + dp)) - let nd = emit_bind(("call ptr @realloc(ptr " + (old + (", i64 " + (bytes + ")"))))) + let ncw = emit_bind(`zext i32 {nc} to i64`) + let bytes = emit_bind(`mul i64 {ncw}, {esz}`) + let old = emit_bind(`load ptr, ptr {dp}`) + let nd = emit_bind(`call ptr @realloc(ptr {old}, i64 {bytes})`) emit(" store ptr "); emit(nd); emit(", ptr "); emit(dp); emit("\n") emit(" store i32 "); emit(nc); emit(", ptr "); emit(cp); emit("\n") emit(" br label %"); emit(put); emit("\n") emit(put); emit(":\n") let v = emit_expr(e.kids[1]) - let data = emit_bind(("load ptr, ptr " + dp)) + let data = emit_bind(`load ptr, ptr {dp}`) let slot = nreg() emit(" "); emit(slot); emit(" = getelementptr inbounds "); emit(elt); emit(", ptr "); emit(data); emit(", i32 "); emit(l); emit("\n") emit(" store "); emit(elt); emit(" "); emit(v.code); emit(", ptr "); emit(slot); emit("\n") - let l1 = emit_bind(("add i32 " + (l + ", 1"))) + let l1 = emit_bind(`add i32 {l}, 1`) emit(" store i32 "); emit(l1); emit(", ptr "); emit(lp); emit("\n") return val("0", "void") } diff --git a/selfhost/emit_query.ludic b/selfhost/emit_query.ludic index 39a2dcef..e1194d17 100644 --- a/selfhost/emit_query.ludic +++ b/selfhost/emit_query.ludic @@ -18,16 +18,16 @@ fn emit_query(st: Node) -> void { let cond = lbl("qcond"); let body = lbl("qbody"); let nxt = lbl("qnext"); let endl = lbl("qend") emit(" br label %"); emit(cond); emit("\n") emit(cond); emit(":\n") - let i0 = emit_bind(("load i32, ptr " + ip)) + let i0 = emit_bind(`load i32, ptr {ip}`) let ec = emit_bind("load i32, ptr @L_entc") - let lt = emit_bind(("icmp slt i32 " + (i0 + (", " + ec)))) + let lt = emit_bind(`icmp slt i32 {i0}, {ec}`) emit(" br i1 "); emit(lt); emit(", label %"); emit(body); emit(", label %"); emit(endl); emit("\n") emit(body); emit(":\n"); g_term = false - let i1 = emit_bind(("load i32, ptr " + ip)) + let i1 = emit_bind(`load i32, ptr {ip}`) # alive? let ap = nreg(); emit(" "); emit(ap); emit(" = getelementptr inbounds ["); emit(me); emit(" x i32], ptr @L_alive, i32 0, i32 "); emit(i1); emit("\n") - let al = emit_bind(("load i32, ptr " + ap)) - let alc = emit_bind(("icmp ne i32 " + (al + ", 0"))) + let al = emit_bind(`load i32, ptr {ap}`) + let alc = emit_bind(`icmp ne i32 {al}, 0`) let ka = lbl("qa") emit(" br i1 "); emit(alc); emit(", label %"); emit(ka); emit(", label %"); emit(nxt); emit("\n") emit(ka); emit(":\n") @@ -41,15 +41,15 @@ fn emit_query(st: Node) -> void { var ok = "0" if ak > 0 { let kp = nreg(); emit(" "); emit(kp); emit(" = getelementptr inbounds ["); emit(me); emit(" x i32], ptr @L_kind, i32 0, i32 "); emit(i1); emit("\n") - let kv = emit_bind(("load i32, ptr " + kp)) - let kok = emit_bind(("icmp eq i32 " + (kv + (", " + itoa(ak))))) - let mev = emit_bind(("load i32, ptr @ME_" + tm.s)) # model-enabled flag - let meok = emit_bind(("icmp ne i32 " + (mev + ", 0"))) - ok = emit_bind(("and i1 " + (kok + (", " + meok)))) + let kv = emit_bind(`load i32, ptr {kp}`) + let kok = emit_bind(`icmp eq i32 {kv}, {itoa(ak)}`) + let mev = emit_bind(`load i32, ptr @ME_{tm.s}`) # model-enabled flag + let meok = emit_bind(`icmp ne i32 {mev}, 0`) + ok = emit_bind(`and i1 {kok}, {meok}`) } else { let hp = nreg(); emit(" "); emit(hp); emit(" = getelementptr inbounds ["); emit(me); emit(" x i8], ptr @H_"); emit(tm.s); emit(", i32 0, i32 "); emit(i1); emit("\n") - let hv = emit_bind(("load i8, ptr " + hp)) - ok = emit_bind(("icmp ne i8 " + (hv + ", 0"))) + let hv = emit_bind(`load i8, ptr {hp}`) + ok = emit_bind(`icmp ne i8 {hv}, 0`) } let keep = lbl("qt") emit(" br i1 "); emit(ok); emit(", label %"); emit(keep); emit(", label %"); emit(nxt); emit("\n") @@ -79,7 +79,7 @@ fn emit_query(st: Node) -> void { # optional where-clause if (st.b != null) { let w = emit_expr(st.b) - let wc = emit_bind(("icmp ne i32 " + (w.code + ", 0"))) + let wc = emit_bind(`icmp ne i32 {w.code}, 0`) let kw = lbl("qw") emit(" br i1 "); emit(wc); emit(", label %"); emit(kw); emit(", label %"); emit(nxt); emit("\n") emit(kw); emit(":\n") @@ -92,8 +92,8 @@ fn emit_query(st: Node) -> void { if not g_term { emit(" br label %"); emit(nxt); emit("\n") } emit(nxt); emit(":\n") - let i2 = emit_bind(("load i32, ptr " + ip)) - let i3 = emit_bind(("add i32 " + (i2 + ", 1"))) + let i2 = emit_bind(`load i32, ptr {ip}`) + let i3 = emit_bind(`add i32 {i2}, 1`) store_at("i32", i3, ip) emit(" br label %"); emit(cond); emit("\n") emit(endl); emit(":\n"); g_term = false diff --git a/selfhost/emit_save.ludic b/selfhost/emit_save.ludic index bd00b56e..2bb597bc 100644 --- a/selfhost/emit_save.ludic +++ b/selfhost/emit_save.ludic @@ -6,7 +6,7 @@ var g_iok: int = 0 fn emit_io(fn2: ptr, p: ptr, bytes: ptr) -> void { - let r = (("%io") + itoa(g_iok)); g_iok = g_iok + 1 + let r = `%io{itoa(g_iok)}`; g_iok = g_iok + 1 emit(" "); emit(r); emit(" = call i64 @"); emit(fn2); emit("(ptr "); emit(p); emit(", i64 1, i64 "); emit(bytes); emit(", ptr %f)\n") } @@ -20,16 +20,16 @@ fn emit_snapshot_blocks(fn2: ptr) -> void { emit_io(fn2, "@L_freelist", "%nalive") emit_io(fn2, "@L_kind", "%nalive") var i = 0 - while i < len(prog) { if prog[i].kind == N_VAR { emit_io(fn2, ("@g_" + prog[i].s), "4") }; i = i + 1 } + while i < len(prog) { if prog[i].kind == N_VAR { emit_io(fn2, `@g_{prog[i].s}`, "4") }; i = i + 1 } var ci = 0 i = 0 while i < len(prog) { if prog[i].kind == N_COMP { let c = prog[i].s - let csz = (("%csz") + itoa(ci)) + let csz = `%csz{itoa(ci)}` emit(" "); emit(csz); emit(" = ptrtoint ptr getelementptr (%Cmp_"); emit(c); emit(", ptr null, i32 "); emit(me); emit(") to i64\n") - emit_io(fn2, ("@S_" + c), csz) - emit_io(fn2, ("@H_" + c), me) + emit_io(fn2, `@S_{c}`, csz) + emit_io(fn2, `@H_{c}`, me) ci = ci + 1 } i = i + 1 diff --git a/selfhost/emit_spawn.ludic b/selfhost/emit_spawn.ludic index c9f1b81d..8718a6eb 100644 --- a/selfhost/emit_spawn.ludic +++ b/selfhost/emit_spawn.ludic @@ -4,7 +4,7 @@ fn emit_init_component(e: ptr, comp: ptr, rec: Node) -> void { let me = itoa(MAX_ENT) let c = find_comp(comp) - if (c == null) { perr(("spawn: unknown property " + comp)) } + if (c == null) { perr(`spawn: unknown property {comp}`) } let hp = nreg(); emit(" "); emit(hp); emit(" = getelementptr inbounds ["); emit(me); emit(" x i8], ptr @H_"); emit(comp); emit(", i32 0, i32 "); emit(e); emit("\n") emit(" store i8 1, ptr "); emit(hp); emit("\n") let slot = nreg() @@ -101,11 +101,11 @@ fn emit_despawn(st: Node) -> void { if len(g_ondespawn) > 0 { let me = itoa(MAX_ENT) let kp = nreg(); emit(" "); emit(kp); emit(" = getelementptr inbounds ["); emit(me); emit(" x i32], ptr @L_kind, i32 0, i32 "); emit(v.code); emit("\n") - let kind = emit_bind(("load i32, ptr " + kp)) + let kind = emit_bind(`load i32, ptr {kp}`) var i = 0 while i < len(g_ondespawn) { let mname = g_ondespawn[i].s - let c = emit_bind(("icmp eq i32 " + (kind + (", " + itoa(find_arch_id(mname)))))) + let c = emit_bind(`icmp eq i32 {kind}, {itoa(find_arch_id(mname))}`) let yes = lbl("dh"); let no = lbl("dhn") emit(" br i1 "); emit(c); emit(", label %"); emit(yes); emit(", label %"); emit(no); emit("\n") emit(yes); emit(":\n call void @on_despawn_"); emit(mname); emit("(i32 "); emit(v.code); emit(")\n") diff --git a/selfhost/emit_stmt.ludic b/selfhost/emit_stmt.ludic index f87b2979..17468226 100644 --- a/selfhost/emit_stmt.ludic +++ b/selfhost/emit_stmt.ludic @@ -25,13 +25,13 @@ fn emit_assign(st: Node) -> void { if li >= 0 { # a `let` binding is immutable: rebinding it is an error (mutating THROUGH # it — `x.field = …`, `x[i] = …` — is fine, and lands in the branches below). - if loc_mut[li] == 0 { perr(("cannot assign to immutable '" + (t.s + ("' (declared with let; use var) — line " + itoa(st.line))))) } + if loc_mut[li] == 0 { perr(`cannot assign to immutable '{t.s}' (declared with let; use var) — line {itoa(st.line)}`) } addr = loc_reg[li]; ty = loc_ty[li] } else { let g = find_global(t.s) - if (g == null) { perr(("assign to unknown " + t.s)) } - addr = ("@g_" + t.s); ty = g.ty + if (g == null) { perr(`assign to unknown {t.s}`) } + addr = `@g_{t.s}`; ty = g.ty } } else { if t.kind == E_MEMBER { addr = emit_member_addr(t); ty = g_addr_ty } @@ -42,19 +42,19 @@ fn emit_assign(st: Node) -> void { let rv = emit_expr(st.b) var v = rv.code if not (st.s == "=") { - let cur = emit_bind(("load " + (lt + (", ptr " + addr)))) + let cur = emit_bind(`load {lt}, ptr {addr}`) var opc = "add" if (st.s == ("-=")) { opc = "sub" } if (st.s == ("*=")) { opc = "mul" } if (st.s == ("/=")) { opc = "sdiv" } - v = emit_bind((opc + (" i32 " + (cur + (", " + v))))) + v = emit_bind(`{opc} i32 {cur}, {v}`) } store_at(lt, v, addr) } fn emit_if(st: Node) -> void { let c = emit_expr(st.a) - let cc = emit_bind(("icmp ne i32 " + (c.code + ", 0"))) + let cc = emit_bind(`icmp ne i32 {c.code}, 0`) let has_else = (st.c != null) let tl = lbl("then"); let el = lbl("else"); let en = lbl("ifend") if has_else { emit(" br i1 "); emit(cc); emit(", label %"); emit(tl); emit(", label %"); emit(el); emit("\n") } @@ -76,7 +76,7 @@ fn emit_while(st: Node) -> void { emit(" br label %"); emit(cl); emit("\n") emit(cl); emit(":\n") let c = emit_expr(st.a) - let cc = emit_bind(("icmp ne i32 " + (c.code + ", 0"))) + let cc = emit_bind(`icmp ne i32 {c.code}, 0`) emit(" br i1 "); emit(cc); emit(", label %"); emit(bl); emit(", label %"); emit(en); emit("\n") emit(bl); emit(":\n"); g_term = false loop_push(cl, en) @@ -94,9 +94,9 @@ fn emit_for(st: Node) -> void { let cl = lbl("fcond"); let bl = lbl("fbody"); let ct = lbl("fcont"); let en = lbl("fend") emit(" br label %"); emit(cl); emit("\n") emit(cl); emit(":\n") - let iv = emit_bind(("load i32, ptr " + slot)) + let iv = emit_bind(`load i32, ptr {slot}`) let hi = emit_expr(st.b) - let cc = emit_bind(("icmp slt i32 " + (iv + (", " + hi.code)))) + let cc = emit_bind(`icmp slt i32 {iv}, {hi.code}`) emit(" br i1 "); emit(cc); emit(", label %"); emit(bl); emit(", label %"); emit(en); emit("\n") emit(bl); emit(":\n"); g_term = false loop_push(ct, en) @@ -104,8 +104,8 @@ fn emit_for(st: Node) -> void { loop_pop() if not g_term { emit(" br label %"); emit(ct); emit("\n") } emit(ct); emit(":\n") - let i2 = emit_bind(("load i32, ptr " + slot)) - let i3 = emit_bind(("add i32 " + (i2 + ", 1"))) + let i2 = emit_bind(`load i32, ptr {slot}`) + let i3 = emit_bind(`add i32 {i2}, 1`) store_at("i32", i3, slot) emit(" br label %"); emit(cl); emit("\n") emit(en); emit(":\n"); g_term = false @@ -140,9 +140,9 @@ fn emit_match(st: Node) -> void { var p = 0 while p < len(arm.kids) { let pv = emit_expr(arm.kids[p]) - let c = emit_bind(("icmp eq i32 " + (sv.code + (", " + pv.code)))) + let c = emit_bind(`icmp eq i32 {sv.code}, {pv.code}`) if first { acc = c; first = false } - else { acc = emit_bind(("or i1 " + (acc + (", " + c)))) } + else { acc = emit_bind(`or i1 {acc}, {c}`) } p = p + 1 } let bodyl = lbl("mbody"); let nextl = lbl("marm") diff --git a/selfhost/emit_ui.ludic b/selfhost/emit_ui.ludic index 4b5d3f10..fac34df1 100644 --- a/selfhost/emit_ui.ludic +++ b/selfhost/emit_ui.ludic @@ -97,7 +97,7 @@ fn emit_ui_build() -> void { emit(" call void @fn_rt_ui_static_text(i32 "); emit(itoa(i)); emit(", ptr "); emit(sv.code); emit(")\n") } else { if (k == "skin") or (k == "image") { let sv = emit_expr(v) - let r = emit_bind(("call i32 @fn_rt_image_load(ptr " + (sv.code + ")"))) + let r = emit_bind(`call i32 @fn_rt_image_load(ptr {sv.code})`) if (k == "skin") { ll_ui_set(i, 20, r) } else { ll_ui_set(i, 19, r) } } else { if (k == "align") { if v.kind == E_ID { diff --git a/selfhost/ludicc.seed.ll b/selfhost/ludicc.seed.ll index 12bf6a0f..a6798936 100644 --- a/selfhost/ludicc.seed.ll +++ b/selfhost/ludicc.seed.ll @@ -10259,9 +10259,9 @@ entry: %t6 = load ptr, ptr %t5 %t7 = getelementptr inbounds %Cmp_Node, ptr %t6, i32 0, i32 1 %t8 = load ptr, ptr %t0 - %t9 = load ptr, ptr %t1 - %t10 = call ptr @fn_str_concat(ptr @.str244, ptr %t9) - %t11 = call ptr @fn_str_concat(ptr %t8, ptr %t10) + %t9 = call ptr @fn_str_concat(ptr %t8, ptr @.str244) + %t10 = load ptr, ptr %t1 + %t11 = call ptr @fn_str_concat(ptr %t9, ptr %t10) store ptr %t11, ptr %t7 %t12 = load ptr, ptr %t5 %t13 = getelementptr inbounds %Cmp_Node, ptr %t12, i32 0, i32 3 @@ -10323,9 +10323,9 @@ then0: br label %ret ifend2: %t6 = load ptr, ptr %t0 - %t7 = load ptr, ptr %t1 - %t8 = call ptr @fn_str_concat(ptr @.str245, ptr %t7) - %t9 = call ptr @fn_str_concat(ptr %t6, ptr %t8) + %t7 = call ptr @fn_str_concat(ptr %t6, ptr @.str245) + %t8 = load ptr, ptr %t1 + %t9 = call ptr @fn_str_concat(ptr %t7, ptr %t8) store ptr %t9, ptr %t10 store i32 0, ptr %t11 br label %wcond3 @@ -12309,13 +12309,13 @@ then0: %t6 = call ptr @fn_arg_code(ptr %t5, i32 0) store ptr %t6, ptr %t7 %t8 = load ptr, ptr %t7 - %t9 = call ptr @fn_str_concat(ptr %t8, ptr @.str400) - %t10 = call ptr @fn_str_concat(ptr @.str399, ptr %t9) + %t9 = call ptr @fn_str_concat(ptr @.str399, ptr %t8) + %t10 = call ptr @fn_str_concat(ptr %t9, ptr @.str400) %t11 = call ptr @fn_emit_bind(ptr %t10) store ptr %t11, ptr %t12 %t13 = load ptr, ptr %t12 - %t14 = call ptr @fn_str_concat(ptr %t13, ptr @.str402) - %t15 = call ptr @fn_str_concat(ptr @.str401, ptr %t14) + %t14 = call ptr @fn_str_concat(ptr @.str401, ptr %t13) + %t15 = call ptr @fn_str_concat(ptr %t14, ptr @.str402) %t16 = call ptr @fn_emit_bind(ptr %t15) %t17 = call ptr @fn_val(ptr %t16, ptr @.str403) store ptr %t17, ptr %retval @@ -12333,16 +12333,16 @@ then3: %t25 = call ptr @fn_arg_code(ptr %t24, i32 1) store ptr %t25, ptr %t26 %t27 = load ptr, ptr %t26 - %t28 = call ptr @fn_str_concat(ptr %t27, ptr @.str406) - %t29 = call ptr @fn_str_concat(ptr @.str405, ptr %t28) + %t28 = call ptr @fn_str_concat(ptr @.str405, ptr %t27) + %t29 = call ptr @fn_str_concat(ptr %t28, ptr @.str406) %t30 = call ptr @fn_emit_bind(ptr %t29) store ptr %t30, ptr %t31 %t32 = load ptr, ptr %t23 - %t33 = load ptr, ptr %t31 - %t34 = call ptr @fn_str_concat(ptr %t33, ptr @.str409) - %t35 = call ptr @fn_str_concat(ptr @.str408, ptr %t34) - %t36 = call ptr @fn_str_concat(ptr %t32, ptr %t35) - %t37 = call ptr @fn_str_concat(ptr @.str407, ptr %t36) + %t33 = call ptr @fn_str_concat(ptr @.str407, ptr %t32) + %t34 = call ptr @fn_str_concat(ptr %t33, ptr @.str408) + %t35 = load ptr, ptr %t31 + %t36 = call ptr @fn_str_concat(ptr %t34, ptr %t35) + %t37 = call ptr @fn_str_concat(ptr %t36, ptr @.str409) %t38 = call ptr @fn_emit_bind(ptr %t37) %t39 = call ptr @fn_val(ptr %t38, ptr @.str410) store ptr %t39, ptr %retval @@ -12368,8 +12368,8 @@ then6: %t55 = call ptr @fn_emit_bind(ptr %t54) store ptr %t55, ptr %t56 %t57 = load ptr, ptr %t56 - %t58 = call ptr @fn_str_concat(ptr %t57, ptr @.str414) - %t59 = call ptr @fn_str_concat(ptr @.str413, ptr %t58) + %t58 = call ptr @fn_str_concat(ptr @.str413, ptr %t57) + %t59 = call ptr @fn_str_concat(ptr %t58, ptr @.str414) %t60 = call ptr @fn_emit_bind(ptr %t59) %t61 = call ptr @fn_val(ptr %t60, ptr @.str415) store ptr %t61, ptr %retval @@ -12394,8 +12394,8 @@ then9: %t76 = call ptr @fn_emit_gep_i8(ptr %t74, ptr %t75) store ptr %t76, ptr %t77 %t78 = load ptr, ptr %t73 - %t79 = call ptr @fn_str_concat(ptr %t78, ptr @.str418) - %t80 = call ptr @fn_str_concat(ptr @.str417, ptr %t79) + %t79 = call ptr @fn_str_concat(ptr @.str417, ptr %t78) + %t80 = call ptr @fn_str_concat(ptr %t79, ptr @.str418) %t81 = call ptr @fn_emit_bind(ptr %t80) store ptr %t81, ptr %t82 call void @fn_emit(ptr @.str419) @@ -12421,11 +12421,11 @@ then12: %t93 = call ptr @fn_arg_code(ptr %t92, i32 1) store ptr %t93, ptr %t94 %t95 = load ptr, ptr %t91 - %t96 = load ptr, ptr %t94 - %t97 = call ptr @fn_str_concat(ptr %t96, ptr @.str427) - %t98 = call ptr @fn_str_concat(ptr @.str426, ptr %t97) - %t99 = call ptr @fn_str_concat(ptr %t95, ptr %t98) - %t100 = call ptr @fn_str_concat(ptr @.str425, ptr %t99) + %t96 = call ptr @fn_str_concat(ptr @.str425, ptr %t95) + %t97 = call ptr @fn_str_concat(ptr %t96, ptr @.str426) + %t98 = load ptr, ptr %t94 + %t99 = call ptr @fn_str_concat(ptr %t97, ptr %t98) + %t100 = call ptr @fn_str_concat(ptr %t99, ptr @.str427) %t101 = call ptr @fn_emit_bind(ptr %t100) %t102 = call ptr @fn_val(ptr %t101, ptr @.str428) store ptr %t102, ptr %retval @@ -12459,8 +12459,8 @@ then17: %t121 = call ptr @fn_arg_code(ptr %t120, i32 2) store ptr %t121, ptr %t122 %t123 = load ptr, ptr %t122 - %t124 = call ptr @fn_str_concat(ptr %t123, ptr @.str432) - %t125 = call ptr @fn_str_concat(ptr @.str431, ptr %t124) + %t124 = call ptr @fn_str_concat(ptr @.str431, ptr %t123) + %t125 = call ptr @fn_str_concat(ptr %t124, ptr @.str432) %t126 = call ptr @fn_emit_bind(ptr %t125) store ptr %t126, ptr %t127 store ptr @.str433, ptr %t128 @@ -12473,22 +12473,22 @@ then20: br label %ifend22 ifend22: %t132 = load ptr, ptr %t128 - %t133 = load ptr, ptr %t119 - %t134 = load ptr, ptr %t127 - %t135 = load ptr, ptr %t116 - %t136 = call ptr @fn_str_concat(ptr %t135, ptr @.str440) - %t137 = call ptr @fn_str_concat(ptr @.str439, ptr %t136) - %t138 = call ptr @fn_str_concat(ptr %t134, ptr %t137) - %t139 = call ptr @fn_str_concat(ptr @.str438, ptr %t138) - %t140 = call ptr @fn_str_concat(ptr %t133, ptr %t139) - %t141 = call ptr @fn_str_concat(ptr @.str437, ptr %t140) - %t142 = call ptr @fn_str_concat(ptr %t132, ptr %t141) - %t143 = call ptr @fn_str_concat(ptr @.str436, ptr %t142) + %t133 = call ptr @fn_str_concat(ptr @.str436, ptr %t132) + %t134 = call ptr @fn_str_concat(ptr %t133, ptr @.str437) + %t135 = load ptr, ptr %t119 + %t136 = call ptr @fn_str_concat(ptr %t134, ptr %t135) + %t137 = call ptr @fn_str_concat(ptr %t136, ptr @.str438) + %t138 = load ptr, ptr %t127 + %t139 = call ptr @fn_str_concat(ptr %t137, ptr %t138) + %t140 = call ptr @fn_str_concat(ptr %t139, ptr @.str439) + %t141 = load ptr, ptr %t116 + %t142 = call ptr @fn_str_concat(ptr %t140, ptr %t141) + %t143 = call ptr @fn_str_concat(ptr %t142, ptr @.str440) %t144 = call ptr @fn_emit_bind(ptr %t143) store ptr %t144, ptr %t145 %t146 = load ptr, ptr %t145 - %t147 = call ptr @fn_str_concat(ptr %t146, ptr @.str442) - %t148 = call ptr @fn_str_concat(ptr @.str441, ptr %t147) + %t147 = call ptr @fn_str_concat(ptr @.str441, ptr %t146) + %t148 = call ptr @fn_str_concat(ptr %t147, ptr @.str442) %t149 = call ptr @fn_emit_bind(ptr %t148) %t150 = call ptr @fn_val(ptr %t149, ptr @.str443) store ptr %t150, ptr %retval @@ -12509,19 +12509,19 @@ then23: %t161 = call ptr @fn_arg_code(ptr %t160, i32 2) store ptr %t161, ptr %t162 %t163 = load ptr, ptr %t159 - %t164 = call ptr @fn_str_concat(ptr %t163, ptr @.str446) - %t165 = call ptr @fn_str_concat(ptr @.str445, ptr %t164) + %t164 = call ptr @fn_str_concat(ptr @.str445, ptr %t163) + %t165 = call ptr @fn_str_concat(ptr %t164, ptr @.str446) %t166 = call ptr @fn_emit_bind(ptr %t165) store ptr %t166, ptr %t167 %t168 = load ptr, ptr %t156 - %t169 = load ptr, ptr %t167 - %t170 = load ptr, ptr %t162 - %t171 = call ptr @fn_str_concat(ptr %t170, ptr @.str450) - %t172 = call ptr @fn_str_concat(ptr @.str449, ptr %t171) - %t173 = call ptr @fn_str_concat(ptr %t169, ptr %t172) - %t174 = call ptr @fn_str_concat(ptr @.str448, ptr %t173) - %t175 = call ptr @fn_str_concat(ptr %t168, ptr %t174) - %t176 = call ptr @fn_str_concat(ptr @.str447, ptr %t175) + %t169 = call ptr @fn_str_concat(ptr @.str447, ptr %t168) + %t170 = call ptr @fn_str_concat(ptr %t169, ptr @.str448) + %t171 = load ptr, ptr %t167 + %t172 = call ptr @fn_str_concat(ptr %t170, ptr %t171) + %t173 = call ptr @fn_str_concat(ptr %t172, ptr @.str449) + %t174 = load ptr, ptr %t162 + %t175 = call ptr @fn_str_concat(ptr %t173, ptr %t174) + %t176 = call ptr @fn_str_concat(ptr %t175, ptr @.str450) %t177 = call ptr @fn_emit_bind(ptr %t176) %t178 = call ptr @fn_val(ptr %t177, ptr @.str451) store ptr %t178, ptr %retval @@ -12536,13 +12536,13 @@ then26: %t183 = call ptr @fn_arg_code(ptr %t182, i32 0) store ptr %t183, ptr %t184 %t185 = load ptr, ptr %t184 - %t186 = call ptr @fn_str_concat(ptr %t185, ptr @.str454) - %t187 = call ptr @fn_str_concat(ptr @.str453, ptr %t186) + %t186 = call ptr @fn_str_concat(ptr @.str453, ptr %t185) + %t187 = call ptr @fn_str_concat(ptr %t186, ptr @.str454) %t188 = call ptr @fn_emit_bind(ptr %t187) store ptr %t188, ptr %t189 %t190 = load ptr, ptr %t189 - %t191 = call ptr @fn_str_concat(ptr %t190, ptr @.str456) - %t192 = call ptr @fn_str_concat(ptr @.str455, ptr %t191) + %t191 = call ptr @fn_str_concat(ptr @.str455, ptr %t190) + %t192 = call ptr @fn_str_concat(ptr %t191, ptr @.str456) %t193 = call ptr @fn_emit_bind(ptr %t192) %t194 = call ptr @fn_val(ptr %t193, ptr @.str457) store ptr %t194, ptr %retval @@ -12585,10 +12585,10 @@ then35: %t214 = call ptr @fn_emit_bind(ptr @.str467) store ptr %t214, ptr %t215 %t216 = load ptr, ptr %t215 - %t217 = load ptr, ptr %t213 - %t218 = call ptr @fn_str_concat(ptr @.str469, ptr %t217) - %t219 = call ptr @fn_str_concat(ptr %t216, ptr %t218) - %t220 = call ptr @fn_str_concat(ptr @.str468, ptr %t219) + %t217 = call ptr @fn_str_concat(ptr @.str468, ptr %t216) + %t218 = call ptr @fn_str_concat(ptr %t217, ptr @.str469) + %t219 = load ptr, ptr %t213 + %t220 = call ptr @fn_str_concat(ptr %t218, ptr %t219) %t221 = call ptr @fn_emit_bind(ptr %t220) store ptr %t221, ptr %t222 %t223 = load ptr, ptr %t222 @@ -12645,8 +12645,8 @@ then47: %t249 = call ptr @fn_arg_code(ptr %t248, i32 0) store ptr %t249, ptr %t250 %t251 = load ptr, ptr %t250 - %t252 = call ptr @fn_str_concat(ptr %t251, ptr @.str486) - %t253 = call ptr @fn_str_concat(ptr @.str485, ptr %t252) + %t252 = call ptr @fn_str_concat(ptr @.str485, ptr %t251) + %t253 = call ptr @fn_str_concat(ptr %t252, ptr @.str486) %t254 = call ptr @fn_emit_bind(ptr %t253) %t255 = call ptr @fn_val(ptr %t254, ptr @.str487) store ptr %t255, ptr %retval @@ -12661,8 +12661,8 @@ then50: %t260 = call ptr @fn_arg_code(ptr %t259, i32 0) store ptr %t260, ptr %t261 %t262 = load ptr, ptr %t261 - %t263 = call ptr @fn_str_concat(ptr %t262, ptr @.str490) - %t264 = call ptr @fn_str_concat(ptr @.str489, ptr %t263) + %t263 = call ptr @fn_str_concat(ptr @.str489, ptr %t262) + %t264 = call ptr @fn_str_concat(ptr %t263, ptr @.str490) %t265 = call ptr @fn_emit_bind(ptr %t264) %t266 = call ptr @fn_val(ptr %t265, ptr @.str491) store ptr %t266, ptr %retval @@ -13079,8 +13079,8 @@ then3: %t20 = call ptr @fn_arg_code(ptr %t19, i32 2) store ptr %t20, ptr %t21 %t22 = load ptr, ptr %t21 - %t23 = call ptr @fn_str_concat(ptr %t22, ptr @.str539) - %t24 = call ptr @fn_str_concat(ptr @.str538, ptr %t23) + %t23 = call ptr @fn_str_concat(ptr @.str538, ptr %t22) + %t24 = call ptr @fn_str_concat(ptr %t23, ptr @.str539) %t25 = call ptr @fn_emit_bind(ptr %t24) store ptr %t25, ptr %t26 call void @fn_emit(ptr @.str540) @@ -13112,8 +13112,8 @@ then6: %t41 = call ptr @fn_arg_code(ptr %t40, i32 2) store ptr %t41, ptr %t42 %t43 = load ptr, ptr %t42 - %t44 = call ptr @fn_str_concat(ptr %t43, ptr @.str548) - %t45 = call ptr @fn_str_concat(ptr @.str547, ptr %t44) + %t44 = call ptr @fn_str_concat(ptr @.str547, ptr %t43) + %t45 = call ptr @fn_str_concat(ptr %t44, ptr @.str548) %t46 = call ptr @fn_emit_bind(ptr %t45) store ptr %t46, ptr %t47 call void @fn_emit(ptr @.str549) @@ -13193,13 +13193,13 @@ then18: %t85 = call ptr @fn_arg_code(ptr %t84, i32 0) store ptr %t85, ptr %t86 %t87 = load ptr, ptr %t86 - %t88 = call ptr @fn_str_concat(ptr %t87, ptr @.str571) - %t89 = call ptr @fn_str_concat(ptr @.str570, ptr %t88) + %t88 = call ptr @fn_str_concat(ptr @.str570, ptr %t87) + %t89 = call ptr @fn_str_concat(ptr %t88, ptr @.str571) %t90 = call ptr @fn_emit_bind(ptr %t89) store ptr %t90, ptr %t91 %t92 = load ptr, ptr %t91 - %t93 = call ptr @fn_str_concat(ptr %t92, ptr @.str573) - %t94 = call ptr @fn_str_concat(ptr @.str572, ptr %t93) + %t93 = call ptr @fn_str_concat(ptr @.str572, ptr %t92) + %t94 = call ptr @fn_str_concat(ptr %t93, ptr @.str573) %t95 = call ptr @fn_emit_bind(ptr %t94) %t96 = call ptr @fn_val(ptr %t95, ptr @.str574) store ptr %t96, ptr %retval @@ -13213,8 +13213,8 @@ then21: %t100 = call ptr @fn_emit_bind(ptr @.str576) store ptr %t100, ptr %t101 %t102 = load ptr, ptr %t101 - %t103 = call ptr @fn_str_concat(ptr %t102, ptr @.str578) - %t104 = call ptr @fn_str_concat(ptr @.str577, ptr %t103) + %t103 = call ptr @fn_str_concat(ptr @.str577, ptr %t102) + %t104 = call ptr @fn_str_concat(ptr %t103, ptr @.str578) %t105 = call ptr @fn_emit_bind(ptr %t104) %t106 = call ptr @fn_val(ptr %t105, ptr @.str579) store ptr %t106, ptr %retval @@ -13616,8 +13616,8 @@ then0: %t14 = load ptr, ptr %t13 %t15 = getelementptr inbounds %Cmp_Val, ptr %t14, i32 0, i32 0 %t16 = load ptr, ptr %t15 - %t17 = call ptr @fn_str_concat(ptr %t16, ptr @.str659) - %t18 = call ptr @fn_str_concat(ptr @.str658, ptr %t17) + %t17 = call ptr @fn_str_concat(ptr @.str658, ptr %t16) + %t18 = call ptr @fn_str_concat(ptr %t17, ptr @.str659) %t19 = call ptr @fn_emit_bind(ptr %t18) store ptr %t19, ptr %t20 %t21 = load ptr, ptr %t13 @@ -13627,15 +13627,15 @@ then0: %t25 = call ptr @fn_emit_bind(ptr %t24) store ptr %t25, ptr %t26 %t27 = load ptr, ptr %t20 - %t28 = load ptr, ptr %t26 - %t29 = load ptr, ptr %t13 - %t30 = getelementptr inbounds %Cmp_Val, ptr %t29, i32 0, i32 0 - %t31 = load ptr, ptr %t30 - %t32 = call ptr @fn_str_concat(ptr @.str663, ptr %t31) - %t33 = call ptr @fn_str_concat(ptr %t28, ptr %t32) - %t34 = call ptr @fn_str_concat(ptr @.str662, ptr %t33) - %t35 = call ptr @fn_str_concat(ptr %t27, ptr %t34) - %t36 = call ptr @fn_str_concat(ptr @.str661, ptr %t35) + %t28 = call ptr @fn_str_concat(ptr @.str661, ptr %t27) + %t29 = call ptr @fn_str_concat(ptr %t28, ptr @.str662) + %t30 = load ptr, ptr %t26 + %t31 = call ptr @fn_str_concat(ptr %t29, ptr %t30) + %t32 = call ptr @fn_str_concat(ptr %t31, ptr @.str663) + %t33 = load ptr, ptr %t13 + %t34 = getelementptr inbounds %Cmp_Val, ptr %t33, i32 0, i32 0 + %t35 = load ptr, ptr %t34 + %t36 = call ptr @fn_str_concat(ptr %t32, ptr %t35) %t37 = call ptr @fn_emit_bind(ptr %t36) %t38 = call ptr @fn_val(ptr %t37, ptr @.str664) store ptr %t38, ptr %retval @@ -13687,31 +13687,31 @@ then8: br label %ifend10 ifend10: %t72 = load ptr, ptr %t68 - %t73 = load ptr, ptr %t58 - %t74 = getelementptr inbounds %Cmp_Val, ptr %t73, i32 0, i32 0 - %t75 = load ptr, ptr %t74 - %t76 = load ptr, ptr %t67 - %t77 = getelementptr inbounds %Cmp_Val, ptr %t76, i32 0, i32 0 - %t78 = load ptr, ptr %t77 - %t79 = call ptr @fn_str_concat(ptr @.str672, ptr %t78) - %t80 = call ptr @fn_str_concat(ptr %t75, ptr %t79) - %t81 = call ptr @fn_str_concat(ptr @.str671, ptr %t80) - %t82 = call ptr @fn_str_concat(ptr %t72, ptr %t81) - %t83 = call ptr @fn_str_concat(ptr @.str670, ptr %t82) + %t73 = call ptr @fn_str_concat(ptr @.str670, ptr %t72) + %t74 = call ptr @fn_str_concat(ptr %t73, ptr @.str671) + %t75 = load ptr, ptr %t58 + %t76 = getelementptr inbounds %Cmp_Val, ptr %t75, i32 0, i32 0 + %t77 = load ptr, ptr %t76 + %t78 = call ptr @fn_str_concat(ptr %t74, ptr %t77) + %t79 = call ptr @fn_str_concat(ptr %t78, ptr @.str672) + %t80 = load ptr, ptr %t67 + %t81 = getelementptr inbounds %Cmp_Val, ptr %t80, i32 0, i32 0 + %t82 = load ptr, ptr %t81 + %t83 = call ptr @fn_str_concat(ptr %t79, ptr %t82) %t84 = call ptr @fn_emit_bind(ptr %t83) store ptr %t84, ptr %t85 %t86 = load ptr, ptr %t85 - %t87 = load ptr, ptr %t58 - %t88 = getelementptr inbounds %Cmp_Val, ptr %t87, i32 0, i32 0 - %t89 = load ptr, ptr %t88 - %t90 = load ptr, ptr %t67 - %t91 = getelementptr inbounds %Cmp_Val, ptr %t90, i32 0, i32 0 - %t92 = load ptr, ptr %t91 - %t93 = call ptr @fn_str_concat(ptr @.str675, ptr %t92) - %t94 = call ptr @fn_str_concat(ptr %t89, ptr %t93) - %t95 = call ptr @fn_str_concat(ptr @.str674, ptr %t94) - %t96 = call ptr @fn_str_concat(ptr %t86, ptr %t95) - %t97 = call ptr @fn_str_concat(ptr @.str673, ptr %t96) + %t87 = call ptr @fn_str_concat(ptr @.str673, ptr %t86) + %t88 = call ptr @fn_str_concat(ptr %t87, ptr @.str674) + %t89 = load ptr, ptr %t58 + %t90 = getelementptr inbounds %Cmp_Val, ptr %t89, i32 0, i32 0 + %t91 = load ptr, ptr %t90 + %t92 = call ptr @fn_str_concat(ptr %t88, ptr %t91) + %t93 = call ptr @fn_str_concat(ptr %t92, ptr @.str675) + %t94 = load ptr, ptr %t67 + %t95 = getelementptr inbounds %Cmp_Val, ptr %t94, i32 0, i32 0 + %t96 = load ptr, ptr %t95 + %t97 = call ptr @fn_str_concat(ptr %t93, ptr %t96) %t98 = call ptr @fn_emit_bind(ptr %t97) %t99 = call ptr @fn_val(ptr %t98, ptr @.str676) store ptr %t99, ptr %retval @@ -13747,47 +13747,47 @@ ifend7: %t127 = load ptr, ptr %t108 %t128 = getelementptr inbounds %Cmp_Val, ptr %t127, i32 0, i32 0 %t129 = load ptr, ptr %t128 - %t130 = load ptr, ptr %t126 - %t131 = getelementptr inbounds %Cmp_Val, ptr %t130, i32 0, i32 0 - %t132 = load ptr, ptr %t131 - %t133 = call ptr @fn_str_concat(ptr @.str678, ptr %t132) - %t134 = call ptr @fn_str_concat(ptr %t129, ptr %t133) - %t135 = call ptr @fn_str_concat(ptr @.str677, ptr %t134) + %t130 = call ptr @fn_str_concat(ptr @.str677, ptr %t129) + %t131 = call ptr @fn_str_concat(ptr %t130, ptr @.str678) + %t132 = load ptr, ptr %t126 + %t133 = getelementptr inbounds %Cmp_Val, ptr %t132, i32 0, i32 0 + %t134 = load ptr, ptr %t133 + %t135 = call ptr @fn_str_concat(ptr %t131, ptr %t134) %t136 = call ptr @fn_emit_bind(ptr %t135) store ptr %t136, ptr %t137 %t138 = load ptr, ptr %t137 - %t139 = load ptr, ptr %t108 - %t140 = getelementptr inbounds %Cmp_Val, ptr %t139, i32 0, i32 0 - %t141 = load ptr, ptr %t140 - %t142 = load ptr, ptr %t126 - %t143 = getelementptr inbounds %Cmp_Val, ptr %t142, i32 0, i32 0 - %t144 = load ptr, ptr %t143 - %t145 = call ptr @fn_str_concat(ptr @.str681, ptr %t144) - %t146 = call ptr @fn_str_concat(ptr %t141, ptr %t145) - %t147 = call ptr @fn_str_concat(ptr @.str680, ptr %t146) - %t148 = call ptr @fn_str_concat(ptr %t138, ptr %t147) - %t149 = call ptr @fn_str_concat(ptr @.str679, ptr %t148) + %t139 = call ptr @fn_str_concat(ptr @.str679, ptr %t138) + %t140 = call ptr @fn_str_concat(ptr %t139, ptr @.str680) + %t141 = load ptr, ptr %t108 + %t142 = getelementptr inbounds %Cmp_Val, ptr %t141, i32 0, i32 0 + %t143 = load ptr, ptr %t142 + %t144 = call ptr @fn_str_concat(ptr %t140, ptr %t143) + %t145 = call ptr @fn_str_concat(ptr %t144, ptr @.str681) + %t146 = load ptr, ptr %t126 + %t147 = getelementptr inbounds %Cmp_Val, ptr %t146, i32 0, i32 0 + %t148 = load ptr, ptr %t147 + %t149 = call ptr @fn_str_concat(ptr %t145, ptr %t148) %t150 = call ptr @fn_emit_bind(ptr %t149) store ptr %t150, ptr %t151 %t152 = load ptr, ptr %t117 %t153 = getelementptr inbounds %Cmp_Val, ptr %t152, i32 0, i32 0 %t154 = load ptr, ptr %t153 - %t155 = load ptr, ptr %t151 - %t156 = call ptr @fn_str_concat(ptr @.str683, ptr %t155) - %t157 = call ptr @fn_str_concat(ptr %t154, ptr %t156) - %t158 = call ptr @fn_str_concat(ptr @.str682, ptr %t157) + %t155 = call ptr @fn_str_concat(ptr @.str682, ptr %t154) + %t156 = call ptr @fn_str_concat(ptr %t155, ptr @.str683) + %t157 = load ptr, ptr %t151 + %t158 = call ptr @fn_str_concat(ptr %t156, ptr %t157) %t159 = call ptr @fn_emit_bind(ptr %t158) store ptr %t159, ptr %t160 %t161 = load ptr, ptr %t160 - %t162 = load ptr, ptr %t117 - %t163 = getelementptr inbounds %Cmp_Val, ptr %t162, i32 0, i32 0 - %t164 = load ptr, ptr %t163 - %t165 = load ptr, ptr %t151 - %t166 = call ptr @fn_str_concat(ptr @.str686, ptr %t165) - %t167 = call ptr @fn_str_concat(ptr %t164, ptr %t166) - %t168 = call ptr @fn_str_concat(ptr @.str685, ptr %t167) - %t169 = call ptr @fn_str_concat(ptr %t161, ptr %t168) - %t170 = call ptr @fn_str_concat(ptr @.str684, ptr %t169) + %t162 = call ptr @fn_str_concat(ptr @.str684, ptr %t161) + %t163 = call ptr @fn_str_concat(ptr %t162, ptr @.str685) + %t164 = load ptr, ptr %t117 + %t165 = getelementptr inbounds %Cmp_Val, ptr %t164, i32 0, i32 0 + %t166 = load ptr, ptr %t165 + %t167 = call ptr @fn_str_concat(ptr %t163, ptr %t166) + %t168 = call ptr @fn_str_concat(ptr %t167, ptr @.str686) + %t169 = load ptr, ptr %t151 + %t170 = call ptr @fn_str_concat(ptr %t168, ptr %t169) %t171 = call ptr @fn_emit_bind(ptr %t170) %t172 = call ptr @fn_val(ptr %t171, ptr @.str687) store ptr %t172, ptr %retval @@ -13804,13 +13804,13 @@ entry: %t5 = alloca ptr store ptr %arg_llt, ptr %t0 %t1 = load ptr, ptr %t0 - %t2 = call ptr @fn_str_concat(ptr %t1, ptr @.str689) - %t3 = call ptr @fn_str_concat(ptr @.str688, ptr %t2) + %t2 = call ptr @fn_str_concat(ptr @.str688, ptr %t1) + %t3 = call ptr @fn_str_concat(ptr %t2, ptr @.str689) %t4 = call ptr @fn_emit_bind(ptr %t3) store ptr %t4, ptr %t5 %t6 = load ptr, ptr %t5 - %t7 = call ptr @fn_str_concat(ptr %t6, ptr @.str691) - %t8 = call ptr @fn_str_concat(ptr @.str690, ptr %t7) + %t7 = call ptr @fn_str_concat(ptr @.str690, ptr %t6) + %t8 = call ptr @fn_str_concat(ptr %t7, ptr @.str691) %t9 = call ptr @fn_emit_bind(ptr %t8) store ptr %t9, ptr %retval br label %ret @@ -13853,8 +13853,8 @@ ifend2: %t12 = call ptr @fn_emit_sizeof(ptr %t11) store ptr %t12, ptr %t13 %t14 = load ptr, ptr %t13 - %t15 = call ptr @fn_str_concat(ptr %t14, ptr @.str694) - %t16 = call ptr @fn_str_concat(ptr @.str693, ptr %t15) + %t15 = call ptr @fn_str_concat(ptr @.str693, ptr %t14) + %t16 = call ptr @fn_str_concat(ptr %t15, ptr @.str694) %t17 = call ptr @fn_emit_bind(ptr %t16) store ptr %t17, ptr %t18 store i32 0, ptr %t19 @@ -13967,8 +13967,8 @@ entry: %t1 = call ptr @fn_emit_sizeof(ptr @.str707) store ptr %t1, ptr %t2 %t3 = load ptr, ptr %t2 - %t4 = call ptr @fn_str_concat(ptr %t3, ptr @.str709) - %t5 = call ptr @fn_str_concat(ptr @.str708, ptr %t4) + %t4 = call ptr @fn_str_concat(ptr @.str708, ptr %t3) + %t5 = call ptr @fn_str_concat(ptr %t4, ptr @.str709) %t6 = call ptr @fn_emit_bind(ptr %t5) store ptr %t6, ptr %t7 %t8 = call ptr @fn_nreg() @@ -14088,13 +14088,13 @@ ifend2: %t24 = load ptr, ptr %t9 %t25 = getelementptr inbounds %Cmp_Val, ptr %t24, i32 0, i32 0 %t26 = load ptr, ptr %t25 - %t27 = call ptr @fn_str_concat(ptr %t26, ptr @.str732) - %t28 = call ptr @fn_str_concat(ptr @.str731, ptr %t27) + %t27 = call ptr @fn_str_concat(ptr @.str731, ptr %t26) + %t28 = call ptr @fn_str_concat(ptr %t27, ptr @.str732) %t29 = call ptr @fn_emit_bind(ptr %t28) store ptr %t29, ptr %t30 %t31 = load ptr, ptr %t30 - %t32 = call ptr @fn_str_concat(ptr %t31, ptr @.str734) - %t33 = call ptr @fn_str_concat(ptr @.str733, ptr %t32) + %t32 = call ptr @fn_str_concat(ptr @.str733, ptr %t31) + %t33 = call ptr @fn_str_concat(ptr %t32, ptr @.str734) %t34 = call ptr @fn_emit_bind(ptr %t33) %t35 = call ptr @fn_val(ptr %t34, ptr @.str735) store ptr %t35, ptr %retval @@ -14172,10 +14172,10 @@ entry: %t37 = call ptr @fn_emit_bind(ptr %t36) store ptr %t37, ptr %t38 %t39 = load ptr, ptr %t34 - %t40 = load ptr, ptr %t38 - %t41 = call ptr @fn_str_concat(ptr @.str739, ptr %t40) - %t42 = call ptr @fn_str_concat(ptr %t39, ptr %t41) - %t43 = call ptr @fn_str_concat(ptr @.str738, ptr %t42) + %t40 = call ptr @fn_str_concat(ptr @.str738, ptr %t39) + %t41 = call ptr @fn_str_concat(ptr %t40, ptr @.str739) + %t42 = load ptr, ptr %t38 + %t43 = call ptr @fn_str_concat(ptr %t41, ptr %t42) %t44 = call ptr @fn_emit_bind(ptr %t43) store ptr %t44, ptr %t45 %t46 = call ptr @fn_lbl(ptr @.str740) @@ -14196,35 +14196,35 @@ entry: call void @fn_emit(ptr %t53) call void @fn_emit(ptr @.str746) %t54 = load ptr, ptr %t38 - %t55 = call ptr @fn_str_concat(ptr %t54, ptr @.str748) - %t56 = call ptr @fn_str_concat(ptr @.str747, ptr %t55) + %t55 = call ptr @fn_str_concat(ptr @.str747, ptr %t54) + %t56 = call ptr @fn_str_concat(ptr %t55, ptr @.str748) %t57 = call ptr @fn_emit_bind(ptr %t56) store ptr %t57, ptr %t58 %t59 = load ptr, ptr %t38 - %t60 = call ptr @fn_str_concat(ptr %t59, ptr @.str750) - %t61 = call ptr @fn_str_concat(ptr @.str749, ptr %t60) + %t60 = call ptr @fn_str_concat(ptr @.str749, ptr %t59) + %t61 = call ptr @fn_str_concat(ptr %t60, ptr @.str750) %t62 = call ptr @fn_emit_bind(ptr %t61) store ptr %t62, ptr %t63 %t64 = load ptr, ptr %t63 - %t65 = load ptr, ptr %t58 - %t66 = call ptr @fn_str_concat(ptr @.str752, ptr %t65) - %t67 = call ptr @fn_str_concat(ptr %t64, ptr %t66) - %t68 = call ptr @fn_str_concat(ptr @.str751, ptr %t67) + %t65 = call ptr @fn_str_concat(ptr @.str751, ptr %t64) + %t66 = call ptr @fn_str_concat(ptr %t65, ptr @.str752) + %t67 = load ptr, ptr %t58 + %t68 = call ptr @fn_str_concat(ptr %t66, ptr %t67) %t69 = call ptr @fn_emit_bind(ptr %t68) store ptr %t69, ptr %t70 %t71 = load ptr, ptr %t17 %t72 = call ptr @fn_emit_sizeof(ptr %t71) store ptr %t72, ptr %t73 %t74 = load ptr, ptr %t70 - %t75 = call ptr @fn_str_concat(ptr %t74, ptr @.str754) - %t76 = call ptr @fn_str_concat(ptr @.str753, ptr %t75) + %t75 = call ptr @fn_str_concat(ptr @.str753, ptr %t74) + %t76 = call ptr @fn_str_concat(ptr %t75, ptr @.str754) %t77 = call ptr @fn_emit_bind(ptr %t76) store ptr %t77, ptr %t78 %t79 = load ptr, ptr %t78 - %t80 = load ptr, ptr %t73 - %t81 = call ptr @fn_str_concat(ptr @.str756, ptr %t80) - %t82 = call ptr @fn_str_concat(ptr %t79, ptr %t81) - %t83 = call ptr @fn_str_concat(ptr @.str755, ptr %t82) + %t80 = call ptr @fn_str_concat(ptr @.str755, ptr %t79) + %t81 = call ptr @fn_str_concat(ptr %t80, ptr @.str756) + %t82 = load ptr, ptr %t73 + %t83 = call ptr @fn_str_concat(ptr %t81, ptr %t82) %t84 = call ptr @fn_emit_bind(ptr %t83) store ptr %t84, ptr %t85 %t86 = load ptr, ptr %t30 @@ -14232,11 +14232,11 @@ entry: %t88 = call ptr @fn_emit_bind(ptr %t87) store ptr %t88, ptr %t89 %t90 = load ptr, ptr %t89 - %t91 = load ptr, ptr %t85 - %t92 = call ptr @fn_str_concat(ptr %t91, ptr @.str760) - %t93 = call ptr @fn_str_concat(ptr @.str759, ptr %t92) - %t94 = call ptr @fn_str_concat(ptr %t90, ptr %t93) - %t95 = call ptr @fn_str_concat(ptr @.str758, ptr %t94) + %t91 = call ptr @fn_str_concat(ptr @.str758, ptr %t90) + %t92 = call ptr @fn_str_concat(ptr %t91, ptr @.str759) + %t93 = load ptr, ptr %t85 + %t94 = call ptr @fn_str_concat(ptr %t92, ptr %t93) + %t95 = call ptr @fn_str_concat(ptr %t94, ptr @.str760) %t96 = call ptr @fn_emit_bind(ptr %t95) store ptr %t96, ptr %t97 call void @fn_emit(ptr @.str761) @@ -14301,8 +14301,8 @@ entry: call void @fn_emit(ptr %t127) call void @fn_emit(ptr @.str779) %t128 = load ptr, ptr %t34 - %t129 = call ptr @fn_str_concat(ptr %t128, ptr @.str781) - %t130 = call ptr @fn_str_concat(ptr @.str780, ptr %t129) + %t129 = call ptr @fn_str_concat(ptr @.str780, ptr %t128) + %t130 = call ptr @fn_str_concat(ptr %t129, ptr @.str781) %t131 = call ptr @fn_emit_bind(ptr %t130) store ptr %t131, ptr %t132 call void @fn_emit(ptr @.str782) @@ -14330,10 +14330,10 @@ entry: store ptr %arg_ty, ptr %t1 %t2 = load ptr, ptr %t1 %t3 = call ptr @fn_llty(ptr %t2) - %t4 = load ptr, ptr %t0 - %t5 = call ptr @fn_str_concat(ptr @.str788, ptr %t4) - %t6 = call ptr @fn_str_concat(ptr %t3, ptr %t5) - %t7 = call ptr @fn_str_concat(ptr @.str787, ptr %t6) + %t4 = call ptr @fn_str_concat(ptr @.str787, ptr %t3) + %t5 = call ptr @fn_str_concat(ptr %t4, ptr @.str788) + %t6 = load ptr, ptr %t0 + %t7 = call ptr @fn_str_concat(ptr %t5, ptr %t6) %t8 = call ptr @fn_emit_bind(ptr %t7) store ptr %t8, ptr %t9 %t10 = load ptr, ptr %t9 @@ -14370,13 +14370,13 @@ entry: %t8 = load ptr, ptr %t7 %t9 = getelementptr inbounds %Cmp_Val, ptr %t8, i32 0, i32 0 %t10 = load ptr, ptr %t9 - %t11 = call ptr @fn_str_concat(ptr %t10, ptr @.str791) - %t12 = call ptr @fn_str_concat(ptr @.str790, ptr %t11) + %t11 = call ptr @fn_str_concat(ptr @.str790, ptr %t10) + %t12 = call ptr @fn_str_concat(ptr %t11, ptr @.str791) %t13 = call ptr @fn_emit_bind(ptr %t12) store ptr %t13, ptr %t14 %t15 = load ptr, ptr %t14 - %t16 = call ptr @fn_str_concat(ptr %t15, ptr @.str793) - %t17 = call ptr @fn_str_concat(ptr @.str792, ptr %t16) + %t16 = call ptr @fn_str_concat(ptr @.str792, ptr %t15) + %t17 = call ptr @fn_str_concat(ptr %t16, ptr @.str793) %t18 = call ptr @fn_emit_bind(ptr %t17) store ptr %t18, ptr %t19 call void @fn_emit(ptr @.str794) @@ -14432,13 +14432,13 @@ ifend2: %t43 = load ptr, ptr %t42 %t44 = getelementptr inbounds %Cmp_Val, ptr %t43, i32 0, i32 0 %t45 = load ptr, ptr %t44 - %t46 = call ptr @fn_str_concat(ptr %t45, ptr @.str810) - %t47 = call ptr @fn_str_concat(ptr @.str809, ptr %t46) + %t46 = call ptr @fn_str_concat(ptr @.str809, ptr %t45) + %t47 = call ptr @fn_str_concat(ptr %t46, ptr @.str810) %t48 = call ptr @fn_emit_bind(ptr %t47) store ptr %t48, ptr %t49 %t50 = load ptr, ptr %t49 - %t51 = call ptr @fn_str_concat(ptr %t50, ptr @.str812) - %t52 = call ptr @fn_str_concat(ptr @.str811, ptr %t51) + %t51 = call ptr @fn_str_concat(ptr @.str811, ptr %t50) + %t52 = call ptr @fn_str_concat(ptr %t51, ptr @.str812) %t53 = call ptr @fn_emit_bind(ptr %t52) store ptr %t53, ptr %t54 call void @fn_emit(ptr @.str813) @@ -14707,8 +14707,8 @@ ifend2: %t9 = load ptr, ptr %t0 %t10 = getelementptr inbounds %Cmp_Val, ptr %t9, i32 0, i32 0 %t11 = load ptr, ptr %t10 - %t12 = call ptr @fn_str_concat(ptr %t11, ptr @.str859) - %t13 = call ptr @fn_str_concat(ptr @.str858, ptr %t12) + %t12 = call ptr @fn_str_concat(ptr @.str858, ptr %t11) + %t13 = call ptr @fn_str_concat(ptr %t12, ptr @.str859) %t14 = call ptr @fn_emit_bind(ptr %t13) store ptr %t14, ptr %retval br label %ret @@ -14737,13 +14737,13 @@ then0: %t6 = load ptr, ptr %t1 %t7 = getelementptr inbounds %Cmp_Val, ptr %t6, i32 0, i32 0 %t8 = load ptr, ptr %t7 - %t9 = load ptr, ptr %t2 - %t10 = getelementptr inbounds %Cmp_Val, ptr %t9, i32 0, i32 0 - %t11 = load ptr, ptr %t10 - %t12 = call ptr @fn_str_concat(ptr %t11, ptr @.str863) - %t13 = call ptr @fn_str_concat(ptr @.str862, ptr %t12) - %t14 = call ptr @fn_str_concat(ptr %t8, ptr %t13) - %t15 = call ptr @fn_str_concat(ptr @.str861, ptr %t14) + %t9 = call ptr @fn_str_concat(ptr @.str861, ptr %t8) + %t10 = call ptr @fn_str_concat(ptr %t9, ptr @.str862) + %t11 = load ptr, ptr %t2 + %t12 = getelementptr inbounds %Cmp_Val, ptr %t11, i32 0, i32 0 + %t13 = load ptr, ptr %t12 + %t14 = call ptr @fn_str_concat(ptr %t10, ptr %t13) + %t15 = call ptr @fn_str_concat(ptr %t14, ptr @.str863) %t16 = call ptr @fn_emit_bind(ptr %t15) %t17 = call ptr @fn_val(ptr %t16, ptr @.str864) store ptr %t17, ptr %retval @@ -14752,13 +14752,13 @@ ifend2: %t18 = load ptr, ptr %t1 %t19 = getelementptr inbounds %Cmp_Val, ptr %t18, i32 0, i32 0 %t20 = load ptr, ptr %t19 - %t21 = load ptr, ptr %t2 - %t22 = getelementptr inbounds %Cmp_Val, ptr %t21, i32 0, i32 0 - %t23 = load ptr, ptr %t22 - %t24 = call ptr @fn_str_concat(ptr %t23, ptr @.str867) - %t25 = call ptr @fn_str_concat(ptr @.str866, ptr %t24) - %t26 = call ptr @fn_str_concat(ptr %t20, ptr %t25) - %t27 = call ptr @fn_str_concat(ptr @.str865, ptr %t26) + %t21 = call ptr @fn_str_concat(ptr @.str865, ptr %t20) + %t22 = call ptr @fn_str_concat(ptr %t21, ptr @.str866) + %t23 = load ptr, ptr %t2 + %t24 = getelementptr inbounds %Cmp_Val, ptr %t23, i32 0, i32 0 + %t25 = load ptr, ptr %t24 + %t26 = call ptr @fn_str_concat(ptr %t22, ptr %t25) + %t27 = call ptr @fn_str_concat(ptr %t26, ptr @.str867) %t28 = call ptr @fn_emit_bind(ptr %t27) store ptr %t28, ptr %t29 %t30 = load ptr, ptr %t0 @@ -14767,13 +14767,13 @@ ifend2: br i1 %t32, label %then3, label %ifend5 then3: %t33 = load ptr, ptr %t29 - %t34 = call ptr @fn_str_concat(ptr %t33, ptr @.str870) - %t35 = call ptr @fn_str_concat(ptr @.str869, ptr %t34) + %t34 = call ptr @fn_str_concat(ptr @.str869, ptr %t33) + %t35 = call ptr @fn_str_concat(ptr %t34, ptr @.str870) %t36 = call ptr @fn_emit_bind(ptr %t35) store ptr %t36, ptr %t37 %t38 = load ptr, ptr %t37 - %t39 = call ptr @fn_str_concat(ptr %t38, ptr @.str872) - %t40 = call ptr @fn_str_concat(ptr @.str871, ptr %t39) + %t39 = call ptr @fn_str_concat(ptr @.str871, ptr %t38) + %t40 = call ptr @fn_str_concat(ptr %t39, ptr @.str872) %t41 = call ptr @fn_emit_bind(ptr %t40) %t42 = call ptr @fn_val(ptr %t41, ptr @.str873) store ptr %t42, ptr %retval @@ -15051,21 +15051,21 @@ ifend29: %t159 = getelementptr inbounds %Cmp_Node, ptr %t158, i32 0, i32 1 %t160 = load ptr, ptr %t159 %t161 = call ptr @fn_cmp_code(ptr %t160) - %t162 = load ptr, ptr %t134 - %t163 = call ptr @fn_str_concat(ptr %t162, ptr @.str891) - %t164 = call ptr @fn_str_concat(ptr @.str890, ptr %t163) - %t165 = load ptr, ptr %t129 - %t166 = load ptr, ptr %t133 - %t167 = call ptr @fn_str_concat(ptr @.str892, ptr %t166) - %t168 = call ptr @fn_str_concat(ptr %t165, ptr %t167) - %t169 = call ptr @fn_str_concat(ptr %t164, ptr %t168) - %t170 = call ptr @fn_str_concat(ptr %t161, ptr %t169) - %t171 = call ptr @fn_str_concat(ptr @.str889, ptr %t170) + %t162 = call ptr @fn_str_concat(ptr @.str889, ptr %t161) + %t163 = call ptr @fn_str_concat(ptr %t162, ptr @.str890) + %t164 = load ptr, ptr %t134 + %t165 = call ptr @fn_str_concat(ptr %t163, ptr %t164) + %t166 = call ptr @fn_str_concat(ptr %t165, ptr @.str891) + %t167 = load ptr, ptr %t129 + %t168 = call ptr @fn_str_concat(ptr %t166, ptr %t167) + %t169 = call ptr @fn_str_concat(ptr %t168, ptr @.str892) + %t170 = load ptr, ptr %t133 + %t171 = call ptr @fn_str_concat(ptr %t169, ptr %t170) %t172 = call ptr @fn_emit_bind(ptr %t171) store ptr %t172, ptr %t173 %t174 = load ptr, ptr %t173 - %t175 = call ptr @fn_str_concat(ptr %t174, ptr @.str894) - %t176 = call ptr @fn_str_concat(ptr @.str893, ptr %t175) + %t175 = call ptr @fn_str_concat(ptr @.str893, ptr %t174) + %t176 = call ptr @fn_str_concat(ptr %t175, ptr @.str894) %t177 = call ptr @fn_emit_bind(ptr %t176) %t178 = call ptr @fn_val(ptr %t177, ptr @.str895) store ptr %t178, ptr %retval @@ -15089,30 +15089,30 @@ then35: br i1 %t191, label %then38, label %ifend40 then38: %t192 = load ptr, ptr %t183 - %t193 = call ptr @fn_str_concat(ptr %t192, ptr @.str898) - %t194 = call ptr @fn_str_concat(ptr @.str897, ptr %t193) + %t193 = call ptr @fn_str_concat(ptr @.str897, ptr %t192) + %t194 = call ptr @fn_str_concat(ptr %t193, ptr @.str898) %t195 = call ptr @fn_emit_bind(ptr %t194) store ptr %t195, ptr %t196 %t197 = load ptr, ptr %t186 - %t198 = call ptr @fn_str_concat(ptr %t197, ptr @.str900) - %t199 = call ptr @fn_str_concat(ptr @.str899, ptr %t198) + %t198 = call ptr @fn_str_concat(ptr @.str899, ptr %t197) + %t199 = call ptr @fn_str_concat(ptr %t198, ptr @.str900) %t200 = call ptr @fn_emit_bind(ptr %t199) store ptr %t200, ptr %t201 %t202 = load ptr, ptr %t196 - %t203 = load ptr, ptr %t201 - %t204 = call ptr @fn_str_concat(ptr @.str902, ptr %t203) - %t205 = call ptr @fn_str_concat(ptr %t202, ptr %t204) - %t206 = call ptr @fn_str_concat(ptr @.str901, ptr %t205) + %t203 = call ptr @fn_str_concat(ptr @.str901, ptr %t202) + %t204 = call ptr @fn_str_concat(ptr %t203, ptr @.str902) + %t205 = load ptr, ptr %t201 + %t206 = call ptr @fn_str_concat(ptr %t204, ptr %t205) %t207 = call ptr @fn_emit_bind(ptr %t206) store ptr %t207, ptr %t208 %t209 = load ptr, ptr %t208 - %t210 = call ptr @fn_str_concat(ptr %t209, ptr @.str904) - %t211 = call ptr @fn_str_concat(ptr @.str903, ptr %t210) + %t210 = call ptr @fn_str_concat(ptr @.str903, ptr %t209) + %t211 = call ptr @fn_str_concat(ptr %t210, ptr @.str904) %t212 = call ptr @fn_emit_bind(ptr %t211) store ptr %t212, ptr %t213 %t214 = load ptr, ptr %t213 - %t215 = call ptr @fn_str_concat(ptr %t214, ptr @.str906) - %t216 = call ptr @fn_str_concat(ptr @.str905, ptr %t215) + %t215 = call ptr @fn_str_concat(ptr @.str905, ptr %t214) + %t216 = call ptr @fn_str_concat(ptr %t215, ptr @.str906) %t217 = call ptr @fn_emit_bind(ptr %t216) %t218 = call ptr @fn_val(ptr %t217, ptr @.str907) store ptr %t218, ptr %retval @@ -15126,30 +15126,30 @@ ifend40: br i1 %t223, label %then41, label %ifend43 then41: %t224 = load ptr, ptr %t183 - %t225 = call ptr @fn_str_concat(ptr %t224, ptr @.str910) - %t226 = call ptr @fn_str_concat(ptr @.str909, ptr %t225) + %t225 = call ptr @fn_str_concat(ptr @.str909, ptr %t224) + %t226 = call ptr @fn_str_concat(ptr %t225, ptr @.str910) %t227 = call ptr @fn_emit_bind(ptr %t226) store ptr %t227, ptr %t228 %t229 = load ptr, ptr %t228 - %t230 = call ptr @fn_str_concat(ptr %t229, ptr @.str912) - %t231 = call ptr @fn_str_concat(ptr @.str911, ptr %t230) + %t230 = call ptr @fn_str_concat(ptr @.str911, ptr %t229) + %t231 = call ptr @fn_str_concat(ptr %t230, ptr @.str912) %t232 = call ptr @fn_emit_bind(ptr %t231) store ptr %t232, ptr %t233 %t234 = load ptr, ptr %t186 - %t235 = call ptr @fn_str_concat(ptr %t234, ptr @.str914) - %t236 = call ptr @fn_str_concat(ptr @.str913, ptr %t235) + %t235 = call ptr @fn_str_concat(ptr @.str913, ptr %t234) + %t236 = call ptr @fn_str_concat(ptr %t235, ptr @.str914) %t237 = call ptr @fn_emit_bind(ptr %t236) store ptr %t237, ptr %t238 %t239 = load ptr, ptr %t233 - %t240 = load ptr, ptr %t238 - %t241 = call ptr @fn_str_concat(ptr @.str916, ptr %t240) - %t242 = call ptr @fn_str_concat(ptr %t239, ptr %t241) - %t243 = call ptr @fn_str_concat(ptr @.str915, ptr %t242) + %t240 = call ptr @fn_str_concat(ptr @.str915, ptr %t239) + %t241 = call ptr @fn_str_concat(ptr %t240, ptr @.str916) + %t242 = load ptr, ptr %t238 + %t243 = call ptr @fn_str_concat(ptr %t241, ptr %t242) %t244 = call ptr @fn_emit_bind(ptr %t243) store ptr %t244, ptr %t245 %t246 = load ptr, ptr %t245 - %t247 = call ptr @fn_str_concat(ptr %t246, ptr @.str918) - %t248 = call ptr @fn_str_concat(ptr @.str917, ptr %t247) + %t247 = call ptr @fn_str_concat(ptr @.str917, ptr %t246) + %t248 = call ptr @fn_str_concat(ptr %t247, ptr @.str918) %t249 = call ptr @fn_emit_bind(ptr %t248) %t250 = call ptr @fn_val(ptr %t249, ptr @.str919) store ptr %t250, ptr %retval @@ -15159,12 +15159,12 @@ ifend43: %t252 = getelementptr inbounds %Cmp_Node, ptr %t251, i32 0, i32 1 %t253 = load ptr, ptr %t252 %t254 = call ptr @fn_arith_code(ptr %t253) - %t255 = load ptr, ptr %t183 - %t256 = load ptr, ptr %t186 - %t257 = call ptr @fn_str_concat(ptr @.str921, ptr %t256) - %t258 = call ptr @fn_str_concat(ptr %t255, ptr %t257) - %t259 = call ptr @fn_str_concat(ptr @.str920, ptr %t258) - %t260 = call ptr @fn_str_concat(ptr %t254, ptr %t259) + %t255 = call ptr @fn_str_concat(ptr %t254, ptr @.str920) + %t256 = load ptr, ptr %t183 + %t257 = call ptr @fn_str_concat(ptr %t255, ptr %t256) + %t258 = call ptr @fn_str_concat(ptr %t257, ptr @.str921) + %t259 = load ptr, ptr %t186 + %t260 = call ptr @fn_str_concat(ptr %t258, ptr %t259) %t261 = call ptr @fn_emit_bind(ptr %t260) store ptr %t261, ptr %t262 %t263 = load ptr, ptr %t262 @@ -15176,16 +15176,16 @@ ifend37: %t266 = getelementptr inbounds %Cmp_Node, ptr %t265, i32 0, i32 1 %t267 = load ptr, ptr %t266 %t268 = call ptr @fn_arith_code(ptr %t267) - %t269 = load ptr, ptr %t22 - %t270 = getelementptr inbounds %Cmp_Val, ptr %t269, i32 0, i32 0 - %t271 = load ptr, ptr %t270 - %t272 = load ptr, ptr %t27 - %t273 = getelementptr inbounds %Cmp_Val, ptr %t272, i32 0, i32 0 - %t274 = load ptr, ptr %t273 - %t275 = call ptr @fn_str_concat(ptr @.str924, ptr %t274) - %t276 = call ptr @fn_str_concat(ptr %t271, ptr %t275) - %t277 = call ptr @fn_str_concat(ptr @.str923, ptr %t276) - %t278 = call ptr @fn_str_concat(ptr %t268, ptr %t277) + %t269 = call ptr @fn_str_concat(ptr %t268, ptr @.str923) + %t270 = load ptr, ptr %t22 + %t271 = getelementptr inbounds %Cmp_Val, ptr %t270, i32 0, i32 0 + %t272 = load ptr, ptr %t271 + %t273 = call ptr @fn_str_concat(ptr %t269, ptr %t272) + %t274 = call ptr @fn_str_concat(ptr %t273, ptr @.str924) + %t275 = load ptr, ptr %t27 + %t276 = getelementptr inbounds %Cmp_Val, ptr %t275, i32 0, i32 0 + %t277 = load ptr, ptr %t276 + %t278 = call ptr @fn_str_concat(ptr %t274, ptr %t277) %t279 = call ptr @fn_emit_bind(ptr %t278) store ptr %t279, ptr %t280 %t281 = load ptr, ptr %t280 @@ -15350,8 +15350,8 @@ ifend32: %t76 = load ptr, ptr %t68 %t77 = getelementptr inbounds %Cmp_Val, ptr %t76, i32 0, i32 0 %t78 = load ptr, ptr %t77 - %t79 = call ptr @fn_str_concat(ptr %t78, ptr @.str954) - %t80 = call ptr @fn_str_concat(ptr @.str953, ptr %t79) + %t79 = call ptr @fn_str_concat(ptr @.str953, ptr %t78) + %t80 = call ptr @fn_str_concat(ptr %t79, ptr @.str954) %t81 = call ptr @fn_emit_bind(ptr %t80) %t82 = call ptr @fn_val(ptr %t81, ptr @.str955) store ptr %t82, ptr %retval @@ -15416,8 +15416,8 @@ then39: %t124 = load ptr, ptr %t123 %t125 = getelementptr inbounds %Cmp_Val, ptr %t124, i32 0, i32 0 %t126 = load ptr, ptr %t125 - %t127 = call ptr @fn_str_concat(ptr %t126, ptr @.str966) - %t128 = call ptr @fn_str_concat(ptr @.str965, ptr %t127) + %t127 = call ptr @fn_str_concat(ptr @.str965, ptr %t126) + %t128 = call ptr @fn_str_concat(ptr %t127, ptr @.str966) %t129 = call ptr @fn_emit_bind(ptr %t128) %t130 = call ptr @fn_val(ptr %t129, ptr @.str967) store ptr %t130, ptr %retval @@ -15440,8 +15440,8 @@ then42: %t143 = load ptr, ptr %t142 %t144 = getelementptr inbounds %Cmp_Val, ptr %t143, i32 0, i32 0 %t145 = load ptr, ptr %t144 - %t146 = call ptr @fn_str_concat(ptr %t145, ptr @.str970) - %t147 = call ptr @fn_str_concat(ptr @.str969, ptr %t146) + %t146 = call ptr @fn_str_concat(ptr @.str969, ptr %t145) + %t147 = call ptr @fn_str_concat(ptr %t146, ptr @.str970) %t148 = call ptr @fn_emit_bind(ptr %t147) %t149 = call ptr @fn_val(ptr %t148, ptr @.str971) store ptr %t149, ptr %retval @@ -15902,12 +15902,12 @@ ifend35: %t127 = getelementptr inbounds %Cmp_Node, ptr %t126, i32 0, i32 3 %t128 = load ptr, ptr %t127 %t129 = call ptr @fn_llty(ptr %t128) - %t130 = load ptr, ptr %t0 - %t131 = getelementptr inbounds %Cmp_Node, ptr %t130, i32 0, i32 1 - %t132 = load ptr, ptr %t131 - %t133 = call ptr @fn_str_concat(ptr @.str994, ptr %t132) - %t134 = call ptr @fn_str_concat(ptr %t129, ptr %t133) - %t135 = call ptr @fn_str_concat(ptr @.str993, ptr %t134) + %t130 = call ptr @fn_str_concat(ptr @.str993, ptr %t129) + %t131 = call ptr @fn_str_concat(ptr %t130, ptr @.str994) + %t132 = load ptr, ptr %t0 + %t133 = getelementptr inbounds %Cmp_Node, ptr %t132, i32 0, i32 1 + %t134 = load ptr, ptr %t133 + %t135 = call ptr @fn_str_concat(ptr %t131, ptr %t134) %t136 = call ptr @fn_emit_bind(ptr %t135) store ptr %t136, ptr %t137 %t138 = load ptr, ptr %t137 @@ -16108,8 +16108,8 @@ then69: %t275 = load ptr, ptr %t258 %t276 = getelementptr inbounds %Cmp_Val, ptr %t275, i32 0, i32 0 %t277 = load ptr, ptr %t276 - %t278 = call ptr @fn_str_concat(ptr %t277, ptr @.str1003) - %t279 = call ptr @fn_str_concat(ptr @.str1002, ptr %t278) + %t278 = call ptr @fn_str_concat(ptr @.str1002, ptr %t277) + %t279 = call ptr @fn_str_concat(ptr %t278, ptr @.str1003) %t280 = call ptr @fn_emit_bind(ptr %t279) %t281 = call ptr @fn_val(ptr %t280, ptr @.str1004) store ptr %t281, ptr %retval @@ -16118,13 +16118,13 @@ ifend71: %t282 = load ptr, ptr %t258 %t283 = getelementptr inbounds %Cmp_Val, ptr %t282, i32 0, i32 0 %t284 = load ptr, ptr %t283 - %t285 = call ptr @fn_str_concat(ptr %t284, ptr @.str1006) - %t286 = call ptr @fn_str_concat(ptr @.str1005, ptr %t285) + %t285 = call ptr @fn_str_concat(ptr @.str1005, ptr %t284) + %t286 = call ptr @fn_str_concat(ptr %t285, ptr @.str1006) %t287 = call ptr @fn_emit_bind(ptr %t286) store ptr %t287, ptr %t288 %t289 = load ptr, ptr %t288 - %t290 = call ptr @fn_str_concat(ptr %t289, ptr @.str1008) - %t291 = call ptr @fn_str_concat(ptr @.str1007, ptr %t290) + %t290 = call ptr @fn_str_concat(ptr @.str1007, ptr %t289) + %t291 = call ptr @fn_str_concat(ptr %t290, ptr @.str1008) %t292 = call ptr @fn_emit_bind(ptr %t291) %t293 = call ptr @fn_val(ptr %t292, ptr @.str1009) store ptr %t293, ptr %retval @@ -16259,13 +16259,13 @@ then6: %t31 = load ptr, ptr %t4 %t32 = getelementptr inbounds %Cmp_Node, ptr %t31, i32 0, i32 1 %t33 = load ptr, ptr %t32 - %t34 = load ptr, ptr %t0 - %t35 = getelementptr inbounds %Cmp_Node, ptr %t34, i32 0, i32 8 - %t36 = load i32, ptr %t35 - %t37 = call ptr @fn_itoa(i32 %t36) - %t38 = call ptr @fn_str_concat(ptr @.str1020, ptr %t37) - %t39 = call ptr @fn_str_concat(ptr %t33, ptr %t38) - %t40 = call ptr @fn_str_concat(ptr @.str1019, ptr %t39) + %t34 = call ptr @fn_str_concat(ptr @.str1019, ptr %t33) + %t35 = call ptr @fn_str_concat(ptr %t34, ptr @.str1020) + %t36 = load ptr, ptr %t0 + %t37 = getelementptr inbounds %Cmp_Node, ptr %t36, i32 0, i32 8 + %t38 = load i32, ptr %t37 + %t39 = call ptr @fn_itoa(i32 %t38) + %t40 = call ptr @fn_str_concat(ptr %t35, ptr %t39) call void @fn_perr(ptr %t40) br label %ifend8 ifend8: @@ -16375,10 +16375,10 @@ ifend2: br i1 %t109, label %then18, label %ifend20 then18: %t110 = load ptr, ptr %t93 - %t111 = load ptr, ptr %t5 - %t112 = call ptr @fn_str_concat(ptr @.str1026, ptr %t111) - %t113 = call ptr @fn_str_concat(ptr %t110, ptr %t112) - %t114 = call ptr @fn_str_concat(ptr @.str1025, ptr %t113) + %t111 = call ptr @fn_str_concat(ptr @.str1025, ptr %t110) + %t112 = call ptr @fn_str_concat(ptr %t111, ptr @.str1026) + %t113 = load ptr, ptr %t5 + %t114 = call ptr @fn_str_concat(ptr %t112, ptr %t113) %t115 = call ptr @fn_emit_bind(ptr %t114) store ptr %t115, ptr %t116 store ptr @.str1027, ptr %t117 @@ -16413,12 +16413,12 @@ then27: br label %ifend29 ifend29: %t133 = load ptr, ptr %t117 - %t134 = load ptr, ptr %t116 - %t135 = load ptr, ptr %t102 - %t136 = call ptr @fn_str_concat(ptr @.str1035, ptr %t135) - %t137 = call ptr @fn_str_concat(ptr %t134, ptr %t136) - %t138 = call ptr @fn_str_concat(ptr @.str1034, ptr %t137) - %t139 = call ptr @fn_str_concat(ptr %t133, ptr %t138) + %t134 = call ptr @fn_str_concat(ptr %t133, ptr @.str1034) + %t135 = load ptr, ptr %t116 + %t136 = call ptr @fn_str_concat(ptr %t134, ptr %t135) + %t137 = call ptr @fn_str_concat(ptr %t136, ptr @.str1035) + %t138 = load ptr, ptr %t102 + %t139 = call ptr @fn_str_concat(ptr %t137, ptr %t138) %t140 = call ptr @fn_emit_bind(ptr %t139) store ptr %t140, ptr %t102 br label %ifend20 @@ -16450,8 +16450,8 @@ entry: %t6 = load ptr, ptr %t5 %t7 = getelementptr inbounds %Cmp_Val, ptr %t6, i32 0, i32 0 %t8 = load ptr, ptr %t7 - %t9 = call ptr @fn_str_concat(ptr %t8, ptr @.str1037) - %t10 = call ptr @fn_str_concat(ptr @.str1036, ptr %t9) + %t9 = call ptr @fn_str_concat(ptr @.str1036, ptr %t8) + %t10 = call ptr @fn_str_concat(ptr %t9, ptr @.str1037) %t11 = call ptr @fn_emit_bind(ptr %t10) store ptr %t11, ptr %t12 %t13 = load ptr, ptr %t0 @@ -16597,8 +16597,8 @@ entry: %t14 = load ptr, ptr %t13 %t15 = getelementptr inbounds %Cmp_Val, ptr %t14, i32 0, i32 0 %t16 = load ptr, ptr %t15 - %t17 = call ptr @fn_str_concat(ptr %t16, ptr @.str1063) - %t18 = call ptr @fn_str_concat(ptr @.str1062, ptr %t17) + %t17 = call ptr @fn_str_concat(ptr @.str1062, ptr %t16) + %t18 = call ptr @fn_str_concat(ptr %t17, ptr @.str1063) %t19 = call ptr @fn_emit_bind(ptr %t18) store ptr %t19, ptr %t20 call void @fn_emit(ptr @.str1064) @@ -16701,12 +16701,12 @@ entry: %t33 = call ptr @fn_emit_expr(ptr %t32) store ptr %t33, ptr %t34 %t35 = load ptr, ptr %t29 - %t36 = load ptr, ptr %t34 - %t37 = getelementptr inbounds %Cmp_Val, ptr %t36, i32 0, i32 0 - %t38 = load ptr, ptr %t37 - %t39 = call ptr @fn_str_concat(ptr @.str1084, ptr %t38) - %t40 = call ptr @fn_str_concat(ptr %t35, ptr %t39) - %t41 = call ptr @fn_str_concat(ptr @.str1083, ptr %t40) + %t36 = call ptr @fn_str_concat(ptr @.str1083, ptr %t35) + %t37 = call ptr @fn_str_concat(ptr %t36, ptr @.str1084) + %t38 = load ptr, ptr %t34 + %t39 = getelementptr inbounds %Cmp_Val, ptr %t38, i32 0, i32 0 + %t40 = load ptr, ptr %t39 + %t41 = call ptr @fn_str_concat(ptr %t37, ptr %t40) %t42 = call ptr @fn_emit_bind(ptr %t41) store ptr %t42, ptr %t43 call void @fn_emit(ptr @.str1085) @@ -16751,8 +16751,8 @@ ifend2: %t61 = call ptr @fn_emit_bind(ptr %t60) store ptr %t61, ptr %t62 %t63 = load ptr, ptr %t62 - %t64 = call ptr @fn_str_concat(ptr %t63, ptr @.str1095) - %t65 = call ptr @fn_str_concat(ptr @.str1094, ptr %t64) + %t64 = call ptr @fn_str_concat(ptr @.str1094, ptr %t63) + %t65 = call ptr @fn_str_concat(ptr %t64, ptr @.str1095) %t66 = call ptr @fn_emit_bind(ptr %t65) store ptr %t66, ptr %t67 %t68 = load ptr, ptr %t67 @@ -16962,12 +16962,12 @@ wbody7: %t54 = load ptr, ptr %t5 %t55 = getelementptr inbounds %Cmp_Val, ptr %t54, i32 0, i32 0 %t56 = load ptr, ptr %t55 - %t57 = load ptr, ptr %t53 - %t58 = getelementptr inbounds %Cmp_Val, ptr %t57, i32 0, i32 0 - %t59 = load ptr, ptr %t58 - %t60 = call ptr @fn_str_concat(ptr @.str1106, ptr %t59) - %t61 = call ptr @fn_str_concat(ptr %t56, ptr %t60) - %t62 = call ptr @fn_str_concat(ptr @.str1105, ptr %t61) + %t57 = call ptr @fn_str_concat(ptr @.str1105, ptr %t56) + %t58 = call ptr @fn_str_concat(ptr %t57, ptr @.str1106) + %t59 = load ptr, ptr %t53 + %t60 = getelementptr inbounds %Cmp_Val, ptr %t59, i32 0, i32 0 + %t61 = load ptr, ptr %t60 + %t62 = call ptr @fn_str_concat(ptr %t58, ptr %t61) %t63 = call ptr @fn_emit_bind(ptr %t62) store ptr %t63, ptr %t64 %t65 = load i32, ptr %t33 @@ -16980,10 +16980,10 @@ then9: br label %ifend11 else10: %t68 = load ptr, ptr %t32 - %t69 = load ptr, ptr %t64 - %t70 = call ptr @fn_str_concat(ptr @.str1108, ptr %t69) - %t71 = call ptr @fn_str_concat(ptr %t68, ptr %t70) - %t72 = call ptr @fn_str_concat(ptr @.str1107, ptr %t71) + %t69 = call ptr @fn_str_concat(ptr @.str1107, ptr %t68) + %t70 = call ptr @fn_str_concat(ptr %t69, ptr @.str1108) + %t71 = load ptr, ptr %t64 + %t72 = call ptr @fn_str_concat(ptr %t70, ptr %t71) %t73 = call ptr @fn_emit_bind(ptr %t72) store ptr %t73, ptr %t32 br label %ifend11 @@ -17624,16 +17624,16 @@ entry: %t0 = call ptr @fn_itoa(i32 1024) store ptr %t0, ptr %t1 %t2 = load ptr, ptr %t1 - %t3 = call ptr @fn_str_concat(ptr %t2, ptr @.str1134) - %t4 = call ptr @fn_str_concat(ptr @.str1133, ptr %t3) + %t3 = call ptr @fn_str_concat(ptr @.str1133, ptr %t2) + %t4 = call ptr @fn_str_concat(ptr %t3, ptr @.str1134) call void @fn_emith(ptr %t4) %t5 = load ptr, ptr %t1 - %t6 = call ptr @fn_str_concat(ptr %t5, ptr @.str1136) - %t7 = call ptr @fn_str_concat(ptr @.str1135, ptr %t6) + %t6 = call ptr @fn_str_concat(ptr @.str1135, ptr %t5) + %t7 = call ptr @fn_str_concat(ptr %t6, ptr @.str1136) call void @fn_emith(ptr %t7) %t8 = load ptr, ptr %t1 - %t9 = call ptr @fn_str_concat(ptr %t8, ptr @.str1138) - %t10 = call ptr @fn_str_concat(ptr @.str1137, ptr %t9) + %t9 = call ptr @fn_str_concat(ptr @.str1137, ptr %t8) + %t10 = call ptr @fn_str_concat(ptr %t9, ptr @.str1138) call void @fn_emith(ptr %t10) call void @fn_emith(ptr @.str1139) store i32 0, ptr %t11 @@ -17666,25 +17666,25 @@ then3: %t32 = load ptr, ptr %t25 %t33 = getelementptr inbounds %Cmp_Node, ptr %t32, i32 0, i32 1 %t34 = load ptr, ptr %t33 - %t35 = load ptr, ptr %t1 - %t36 = load ptr, ptr %t25 - %t37 = getelementptr inbounds %Cmp_Node, ptr %t36, i32 0, i32 1 - %t38 = load ptr, ptr %t37 - %t39 = call ptr @fn_str_concat(ptr %t38, ptr @.str1143) - %t40 = call ptr @fn_str_concat(ptr @.str1142, ptr %t39) - %t41 = call ptr @fn_str_concat(ptr %t35, ptr %t40) - %t42 = call ptr @fn_str_concat(ptr @.str1141, ptr %t41) - %t43 = call ptr @fn_str_concat(ptr %t34, ptr %t42) - %t44 = call ptr @fn_str_concat(ptr @.str1140, ptr %t43) + %t35 = call ptr @fn_str_concat(ptr @.str1140, ptr %t34) + %t36 = call ptr @fn_str_concat(ptr %t35, ptr @.str1141) + %t37 = load ptr, ptr %t1 + %t38 = call ptr @fn_str_concat(ptr %t36, ptr %t37) + %t39 = call ptr @fn_str_concat(ptr %t38, ptr @.str1142) + %t40 = load ptr, ptr %t25 + %t41 = getelementptr inbounds %Cmp_Node, ptr %t40, i32 0, i32 1 + %t42 = load ptr, ptr %t41 + %t43 = call ptr @fn_str_concat(ptr %t39, ptr %t42) + %t44 = call ptr @fn_str_concat(ptr %t43, ptr @.str1143) call void @fn_emith(ptr %t44) %t45 = load ptr, ptr %t25 %t46 = getelementptr inbounds %Cmp_Node, ptr %t45, i32 0, i32 1 %t47 = load ptr, ptr %t46 - %t48 = load ptr, ptr %t1 - %t49 = call ptr @fn_str_concat(ptr %t48, ptr @.str1146) - %t50 = call ptr @fn_str_concat(ptr @.str1145, ptr %t49) - %t51 = call ptr @fn_str_concat(ptr %t47, ptr %t50) - %t52 = call ptr @fn_str_concat(ptr @.str1144, ptr %t51) + %t48 = call ptr @fn_str_concat(ptr @.str1144, ptr %t47) + %t49 = call ptr @fn_str_concat(ptr %t48, ptr @.str1145) + %t50 = load ptr, ptr %t1 + %t51 = call ptr @fn_str_concat(ptr %t49, ptr %t50) + %t52 = call ptr @fn_str_concat(ptr %t51, ptr @.str1146) call void @fn_emith(ptr %t52) br label %ifend5 ifend5: @@ -17699,8 +17699,8 @@ then6: %t59 = load ptr, ptr %t25 %t60 = getelementptr inbounds %Cmp_Node, ptr %t59, i32 0, i32 1 %t61 = load ptr, ptr %t60 - %t62 = call ptr @fn_str_concat(ptr %t61, ptr @.str1148) - %t63 = call ptr @fn_str_concat(ptr @.str1147, ptr %t62) + %t62 = call ptr @fn_str_concat(ptr @.str1147, ptr %t61) + %t63 = call ptr @fn_str_concat(ptr %t62, ptr @.str1148) call void @fn_emith(ptr %t63) br label %ifend8 ifend8: @@ -17715,8 +17715,8 @@ then9: %t70 = load ptr, ptr %t25 %t71 = getelementptr inbounds %Cmp_Node, ptr %t70, i32 0, i32 1 %t72 = load ptr, ptr %t71 - %t73 = call ptr @fn_str_concat(ptr %t72, ptr @.str1150) - %t74 = call ptr @fn_str_concat(ptr @.str1149, ptr %t73) + %t73 = call ptr @fn_str_concat(ptr @.str1149, ptr %t72) + %t74 = call ptr @fn_str_concat(ptr %t73, ptr @.str1150) call void @fn_emith(ptr %t74) br label %ifend11 ifend11: @@ -18036,10 +18036,10 @@ ifend2: %t55 = call ptr @fn_emit_bind(ptr @.str1208) store ptr %t55, ptr %t56 %t57 = load ptr, ptr %t54 - %t58 = load ptr, ptr %t56 - %t59 = call ptr @fn_str_concat(ptr @.str1210, ptr %t58) - %t60 = call ptr @fn_str_concat(ptr %t57, ptr %t59) - %t61 = call ptr @fn_str_concat(ptr @.str1209, ptr %t60) + %t58 = call ptr @fn_str_concat(ptr @.str1209, ptr %t57) + %t59 = call ptr @fn_str_concat(ptr %t58, ptr @.str1210) + %t60 = load ptr, ptr %t56 + %t61 = call ptr @fn_str_concat(ptr %t59, ptr %t60) %t62 = call ptr @fn_emit_bind(ptr %t61) store ptr %t62, ptr %t63 call void @fn_emit(ptr @.str1211) @@ -18077,8 +18077,8 @@ ifend2: %t79 = call ptr @fn_emit_bind(ptr %t78) store ptr %t79, ptr %t80 %t81 = load ptr, ptr %t80 - %t82 = call ptr @fn_str_concat(ptr %t81, ptr @.str1223) - %t83 = call ptr @fn_str_concat(ptr @.str1222, ptr %t82) + %t82 = call ptr @fn_str_concat(ptr @.str1222, ptr %t81) + %t83 = call ptr @fn_str_concat(ptr %t82, ptr @.str1223) %t84 = call ptr @fn_emit_bind(ptr %t83) store ptr %t84, ptr %t85 %t86 = call ptr @fn_lbl(ptr @.str1224) @@ -18152,11 +18152,11 @@ then8: %t132 = call ptr @fn_emit_bind(ptr %t131) store ptr %t132, ptr %t133 %t134 = load ptr, ptr %t133 - %t135 = load i32, ptr %t119 - %t136 = call ptr @fn_itoa(i32 %t135) - %t137 = call ptr @fn_str_concat(ptr @.str1237, ptr %t136) - %t138 = call ptr @fn_str_concat(ptr %t134, ptr %t137) - %t139 = call ptr @fn_str_concat(ptr @.str1236, ptr %t138) + %t135 = call ptr @fn_str_concat(ptr @.str1236, ptr %t134) + %t136 = call ptr @fn_str_concat(ptr %t135, ptr @.str1237) + %t137 = load i32, ptr %t119 + %t138 = call ptr @fn_itoa(i32 %t137) + %t139 = call ptr @fn_str_concat(ptr %t136, ptr %t138) %t140 = call ptr @fn_emit_bind(ptr %t139) store ptr %t140, ptr %t141 %t142 = load ptr, ptr %t114 @@ -18166,15 +18166,15 @@ then8: %t146 = call ptr @fn_emit_bind(ptr %t145) store ptr %t146, ptr %t147 %t148 = load ptr, ptr %t147 - %t149 = call ptr @fn_str_concat(ptr %t148, ptr @.str1240) - %t150 = call ptr @fn_str_concat(ptr @.str1239, ptr %t149) + %t149 = call ptr @fn_str_concat(ptr @.str1239, ptr %t148) + %t150 = call ptr @fn_str_concat(ptr %t149, ptr @.str1240) %t151 = call ptr @fn_emit_bind(ptr %t150) store ptr %t151, ptr %t152 %t153 = load ptr, ptr %t141 - %t154 = load ptr, ptr %t152 - %t155 = call ptr @fn_str_concat(ptr @.str1242, ptr %t154) - %t156 = call ptr @fn_str_concat(ptr %t153, ptr %t155) - %t157 = call ptr @fn_str_concat(ptr @.str1241, ptr %t156) + %t154 = call ptr @fn_str_concat(ptr @.str1241, ptr %t153) + %t155 = call ptr @fn_str_concat(ptr %t154, ptr @.str1242) + %t156 = load ptr, ptr %t152 + %t157 = call ptr @fn_str_concat(ptr %t155, ptr %t156) %t158 = call ptr @fn_emit_bind(ptr %t157) store ptr %t158, ptr %t120 br label %ifend10 @@ -18201,8 +18201,8 @@ else9: %t169 = call ptr @fn_emit_bind(ptr %t168) store ptr %t169, ptr %t170 %t171 = load ptr, ptr %t170 - %t172 = call ptr @fn_str_concat(ptr %t171, ptr @.str1250) - %t173 = call ptr @fn_str_concat(ptr @.str1249, ptr %t172) + %t172 = call ptr @fn_str_concat(ptr @.str1249, ptr %t171) + %t173 = call ptr @fn_str_concat(ptr %t172, ptr @.str1250) %t174 = call ptr @fn_emit_bind(ptr %t173) store ptr %t174, ptr %t120 br label %ifend10 @@ -18363,8 +18363,8 @@ then22: %t275 = load ptr, ptr %t274 %t276 = getelementptr inbounds %Cmp_Val, ptr %t275, i32 0, i32 0 %t277 = load ptr, ptr %t276 - %t278 = call ptr @fn_str_concat(ptr %t277, ptr @.str1268) - %t279 = call ptr @fn_str_concat(ptr @.str1267, ptr %t278) + %t278 = call ptr @fn_str_concat(ptr @.str1267, ptr %t277) + %t279 = call ptr @fn_str_concat(ptr %t278, ptr @.str1268) %t280 = call ptr @fn_emit_bind(ptr %t279) store ptr %t280, ptr %t281 %t282 = call ptr @fn_lbl(ptr @.str1269) @@ -18414,8 +18414,8 @@ ifend27: %t302 = call ptr @fn_emit_bind(ptr %t301) store ptr %t302, ptr %t303 %t304 = load ptr, ptr %t303 - %t305 = call ptr @fn_str_concat(ptr %t304, ptr @.str1280) - %t306 = call ptr @fn_str_concat(ptr @.str1279, ptr %t305) + %t305 = call ptr @fn_str_concat(ptr @.str1279, ptr %t304) + %t306 = call ptr @fn_str_concat(ptr %t305, ptr @.str1280) %t307 = call ptr @fn_emit_bind(ptr %t306) store ptr %t307, ptr %t308 %t309 = load ptr, ptr %t308 @@ -19083,12 +19083,12 @@ wbody4: %t40 = load ptr, ptr %t39 store ptr %t40, ptr %t41 %t42 = load ptr, ptr %t24 - %t43 = load ptr, ptr %t41 - %t44 = call i32 @fn_find_arch_id(ptr %t43) - %t45 = call ptr @fn_itoa(i32 %t44) - %t46 = call ptr @fn_str_concat(ptr @.str1348, ptr %t45) - %t47 = call ptr @fn_str_concat(ptr %t42, ptr %t46) - %t48 = call ptr @fn_str_concat(ptr @.str1347, ptr %t47) + %t43 = call ptr @fn_str_concat(ptr @.str1347, ptr %t42) + %t44 = call ptr @fn_str_concat(ptr %t43, ptr @.str1348) + %t45 = load ptr, ptr %t41 + %t46 = call i32 @fn_find_arch_id(ptr %t45) + %t47 = call ptr @fn_itoa(i32 %t46) + %t48 = call ptr @fn_str_concat(ptr %t44, ptr %t47) %t49 = call ptr @fn_emit_bind(ptr %t48) store ptr %t49, ptr %t50 %t51 = call ptr @fn_lbl(ptr @.str1349) @@ -19432,8 +19432,8 @@ then5: %t37 = call ptr @fn_emit_bind(ptr %t36) store ptr %t37, ptr %t38 %t39 = load ptr, ptr %t38 - %t40 = call ptr @fn_str_concat(ptr %t39, ptr @.str1396) - %t41 = call ptr @fn_str_concat(ptr @.str1395, ptr %t40) + %t40 = call ptr @fn_str_concat(ptr @.str1395, ptr %t39) + %t41 = call ptr @fn_str_concat(ptr %t40, ptr @.str1396) %t42 = call ptr @fn_emit_bind(ptr %t41) store ptr %t42, ptr %t43 %t44 = call ptr @fn_lbl(ptr @.str1397) @@ -19631,8 +19631,8 @@ ifend8: %t31 = call ptr @fn_emit_bind(ptr @.str1423) store ptr %t31, ptr %t32 %t33 = load ptr, ptr %t32 - %t34 = call ptr @fn_str_concat(ptr %t33, ptr @.str1425) - %t35 = call ptr @fn_str_concat(ptr @.str1424, ptr %t34) + %t34 = call ptr @fn_str_concat(ptr @.str1424, ptr %t33) + %t35 = call ptr @fn_str_concat(ptr %t34, ptr @.str1425) %t36 = call ptr @fn_emit_bind(ptr %t35) store ptr %t36, ptr %t37 %t38 = call ptr @fn_find_fn(ptr @.str1426) @@ -19644,15 +19644,15 @@ then9: %t42 = call ptr @fn_emit_bind(ptr @.str1427) store ptr %t42, ptr %t43 %t44 = load ptr, ptr %t43 - %t45 = call ptr @fn_str_concat(ptr %t44, ptr @.str1429) - %t46 = call ptr @fn_str_concat(ptr @.str1428, ptr %t45) + %t45 = call ptr @fn_str_concat(ptr @.str1428, ptr %t44) + %t46 = call ptr @fn_str_concat(ptr %t45, ptr @.str1429) %t47 = call ptr @fn_emit_bind(ptr %t46) store ptr %t47, ptr %t48 %t49 = load ptr, ptr %t37 - %t50 = load ptr, ptr %t48 - %t51 = call ptr @fn_str_concat(ptr @.str1431, ptr %t50) - %t52 = call ptr @fn_str_concat(ptr %t49, ptr %t51) - %t53 = call ptr @fn_str_concat(ptr @.str1430, ptr %t52) + %t50 = call ptr @fn_str_concat(ptr @.str1430, ptr %t49) + %t51 = call ptr @fn_str_concat(ptr %t50, ptr @.str1431) + %t52 = load ptr, ptr %t48 + %t53 = call ptr @fn_str_concat(ptr %t51, ptr %t52) %t54 = call ptr @fn_emit_bind(ptr %t53) store ptr %t54, ptr %t55 call void @fn_emit(ptr @.str1432) @@ -19726,8 +19726,8 @@ entry: %t6 = load ptr, ptr %t5 %t7 = getelementptr inbounds %Cmp_Val, ptr %t6, i32 0, i32 0 %t8 = load ptr, ptr %t7 - %t9 = call ptr @fn_str_concat(ptr %t8, ptr @.str1453) - %t10 = call ptr @fn_str_concat(ptr @.str1452, ptr %t9) + %t9 = call ptr @fn_str_concat(ptr @.str1452, ptr %t8) + %t10 = call ptr @fn_str_concat(ptr %t9, ptr @.str1453) %t11 = call ptr @fn_emit_bind(ptr %t10) store ptr %t11, ptr %t12 %t13 = load i32, ptr @g_nmach @@ -19812,12 +19812,12 @@ wbody6: %t72 = call ptr @fn_emit_expr(ptr %t71) store ptr %t72, ptr %t73 %t74 = load ptr, ptr %t12 - %t75 = load ptr, ptr %t73 - %t76 = getelementptr inbounds %Cmp_Val, ptr %t75, i32 0, i32 0 - %t77 = load ptr, ptr %t76 - %t78 = call ptr @fn_str_concat(ptr @.str1456, ptr %t77) - %t79 = call ptr @fn_str_concat(ptr %t74, ptr %t78) - %t80 = call ptr @fn_str_concat(ptr @.str1455, ptr %t79) + %t75 = call ptr @fn_str_concat(ptr @.str1455, ptr %t74) + %t76 = call ptr @fn_str_concat(ptr %t75, ptr @.str1456) + %t77 = load ptr, ptr %t73 + %t78 = getelementptr inbounds %Cmp_Val, ptr %t77, i32 0, i32 0 + %t79 = load ptr, ptr %t78 + %t80 = call ptr @fn_str_concat(ptr %t76, ptr %t79) %t81 = call ptr @fn_emit_bind(ptr %t80) store ptr %t81, ptr %t82 %t83 = call ptr @fn_lbl(ptr @.str1457) @@ -21227,8 +21227,8 @@ then17: %t105 = load ptr, ptr %t104 %t106 = getelementptr inbounds %Cmp_Val, ptr %t105, i32 0, i32 0 %t107 = load ptr, ptr %t106 - %t108 = call ptr @fn_str_concat(ptr %t107, ptr @.str1558) - %t109 = call ptr @fn_str_concat(ptr @.str1557, ptr %t108) + %t108 = call ptr @fn_str_concat(ptr @.str1557, ptr %t107) + %t109 = call ptr @fn_str_concat(ptr %t108, ptr @.str1558) %t110 = call ptr @fn_emit_bind(ptr %t109) store ptr %t110, ptr %t111 %t112 = load ptr, ptr %t70 @@ -21564,8 +21564,8 @@ then9: br label %ifend11 else10: %t74 = load ptr, ptr %t12 - %t75 = call ptr @fn_str_concat(ptr %t74, ptr @.str1580) - %t76 = call ptr @fn_str_concat(ptr @.str1579, ptr %t75) + %t75 = call ptr @fn_str_concat(ptr @.str1579, ptr %t74) + %t76 = call ptr @fn_str_concat(ptr %t75, ptr @.str1580) %t77 = call ptr @fn_emit_bind(ptr %t76) store ptr %t77, ptr %t78 call void @fn_emit(ptr @.str1581) @@ -22293,8 +22293,8 @@ else25: br i1 %t62, label %then30, label %else31 then30: %t63 = load ptr, ptr %t23 - %t64 = call ptr @fn_str_concat(ptr %t63, ptr @.str1613) - %t65 = call ptr @fn_str_concat(ptr @.str1612, ptr %t64) + %t64 = call ptr @fn_str_concat(ptr @.str1612, ptr %t63) + %t65 = call ptr @fn_str_concat(ptr %t64, ptr @.str1613) store ptr %t65, ptr %t66 %t67 = load ptr, ptr @__stderrp %t68 = load ptr, ptr %t66 @@ -22498,9 +22498,9 @@ ifend68: %t172 = call ptr @fn_ensure_slash(ptr %t171) store ptr %t172, ptr %t173 %t174 = load ptr, ptr %t166 - %t175 = load ptr, ptr %t159 - %t176 = call ptr @fn_str_concat(ptr @.str1623, ptr %t175) - %t177 = call ptr @fn_str_concat(ptr %t174, ptr %t176) + %t175 = call ptr @fn_str_concat(ptr %t174, ptr @.str1623) + %t176 = load ptr, ptr %t159 + %t177 = call ptr @fn_str_concat(ptr %t175, ptr %t176) store ptr %t177, ptr %t178 %t179 = load i32, ptr @g_g_windowed %t180 = icmp ne i32 %t179, 0 @@ -22510,17 +22510,17 @@ then69: %t182 = call ptr @fn_path_join(ptr %t181, ptr @.str1624) store ptr %t182, ptr %t183 %t184 = load ptr, ptr %t178 - %t185 = load ptr, ptr %t183 - %t186 = call ptr @fn_str_concat(ptr %t185, ptr @.str1626) - %t187 = call ptr @fn_str_concat(ptr @.str1625, ptr %t186) - %t188 = call ptr @fn_str_concat(ptr %t184, ptr %t187) + %t185 = call ptr @fn_str_concat(ptr %t184, ptr @.str1625) + %t186 = load ptr, ptr %t183 + %t187 = call ptr @fn_str_concat(ptr %t185, ptr %t186) + %t188 = call ptr @fn_str_concat(ptr %t187, ptr @.str1626) store ptr %t188, ptr %t178 br label %ifend71 ifend71: %t189 = load ptr, ptr %t178 - %t190 = load ptr, ptr %t1 - %t191 = call ptr @fn_str_concat(ptr @.str1627, ptr %t190) - %t192 = call ptr @fn_str_concat(ptr %t189, ptr %t191) + %t190 = call ptr @fn_str_concat(ptr %t189, ptr @.str1627) + %t191 = load ptr, ptr %t1 + %t192 = call ptr @fn_str_concat(ptr %t190, ptr %t191) store ptr %t192, ptr %t178 %t193 = load ptr, ptr %t178 %t194 = call i32 @system(ptr %t193) diff --git a/selfhost/main.ludic b/selfhost/main.ludic index 77a77a4a..2aab231c 100644 --- a/selfhost/main.ludic +++ b/selfhost/main.ludic @@ -77,7 +77,7 @@ entry { # an unknown flag is ignored (with a note) rather than mistaken for the # input file — '-' is ASCII 45 if peek8(a, 0) == 45 { - let m = ("ludicc: ignoring unknown flag " + (a + "\n")) + let m = `ludicc: ignoring unknown flag {a}\n` file_write(file_stderr(), m, len(m)) } else { path = a } } } } } } } } @@ -117,14 +117,14 @@ entry { # a run with no explicit -o lands in a temp file if run and (out == null) { - out = (("/tmp/ludic-run-") + strip_ludic(base_name(path))) + out = `/tmp/ludic-run-{strip_ludic(base_name(path))}` } # make the output directory if the user asked for e.g. bin/app let odir = dir_of(out) - if len(odir) > 0 { os_system((("mkdir -p ") + odir)) } + if len(odir) > 0 { os_system(`mkdir -p {odir}`) } - let ll = (out + ".ll") + let ll = `{out}.ll` if not ir_flush(ll) { die("ludicc: cannot write IR\n") } let cc = getenv_or("LUDIC_CC", "clang") @@ -134,15 +134,15 @@ entry { # platform layer and the Cocoa framework. # -Wno-override-module: our IR carries an explicit target triple, which clang # would otherwise warn about on every build. - var cmd = (cc + ((" -O2 -Wno-override-module ") + ll)) + var cmd = `{cc} -O2 -Wno-override-module {ll}` if g_windowed { let cocoa = path_join(home, "runtime/native/cocoa.ll") - cmd = (cmd + (" " + (cocoa + (" -framework Cocoa -Wl,-rpath,@loader_path")))) + cmd = `{cmd} {cocoa} -framework Cocoa -Wl,-rpath,@loader_path` } - cmd = (cmd + ((" -o ") + out)) + cmd = `{cmd} -o {out}` let rc = os_system(cmd) - if not save { os_system((("rm -f ") + ll)) } + if not save { os_system(`rm -f {ll}`) } if rc != 0 { die("ludicc: link failed\n") } # run mode: execute the binary we just built and forward its exit code diff --git a/selfhost/parse.ludic b/selfhost/parse.ludic index a748b19e..b34057dd 100644 --- a/selfhost/parse.ludic +++ b/selfhost/parse.ludic @@ -393,7 +393,7 @@ fn do_import(rel: ptr) -> void { if already_loaded(full) { return } push(loaded_paths, full) let src = read_file(full) - if (src == null) { perr(("cannot open import " + full)) } + if (src == null) { perr(`cannot open import {full}`) } let saved_toks = toks; let saved_pi = pi; let saved_dir = cur_dir cur_dir = dir_of(full) lex(src) # resets the global token stream