Skip to content

Commit 994b636

Browse files
authored
Merge pull request #2071 from andrew4328/intern-type-tag-dsfklsdl
Intern type tag dsfklsdl
2 parents b71ebb4 + 9bba78a commit 994b636

126 files changed

Lines changed: 7050 additions & 6211 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BOOTSTRAP/cli.c

Lines changed: 5390 additions & 4896 deletions
Large diffs are not rendered by default.

BOOTSTRAP/monolithic.lsts

Lines changed: 821 additions & 656 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LSTSFLAGS = MALLOC_CHECK_=3
88
# recommendation: ulimit -s unlimited
99

1010
dev: install-production
11-
lm --print-ast tests/promises/lm-ast/constructor.lsts > out.txt
11+
lm tests/promises/lm-type/intern-type-tag.lsts
1212
gcc tmp.c
1313
./a.out
1414

PLUGINS/BACKEND/C/compile-c.lsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let plugins-backend-c-compile(): Nil = (
66
let fragment = mk-fragment();
77
let kt = typeof-term(rhs);
88
if not(kt.is-open) {
9-
if kt.is-t(c"Blob",0) {
9+
if kt.is-t(interned-tag-blob,0) {
1010
fragment.term = rhs;
1111
global-ctx = global-ctx.bind(key.key, kt, fragment);
1212
std-c-fragment-context = std-c-fragment-context.bind(def-to-sym(program-term), fragment);

PLUGINS/BACKEND/C/mangle-identifier.lsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let mangle-identifier(kt: Type): S = (
3737
TAny{} => mangle-identifier(c"?");
3838
TVar{name=name} => mangle-identifier(name);
3939
TGround{tag=tag, parameters=parameters} => (
40-
let r = mangle-identifier(tag);
40+
let r = mangle-identifier(untern(tag));
4141
if parameters.length > 0 then r = r + mangle-identifier(c"<");
4242
let c-has-prev = false;
4343
for c in parameters {

PLUGINS/BACKEND/C/std-c-compile-args.lsts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
let std-c-compile-args(callee-ctx: FContext, caller-ctx: FContext, lhs: AST, rhs: AST, f: Fragment): Tuple<Fragment,FContext,FContext> = (
44
match lhs {
55
App{lhs-rst=left, right:App{ left:Lit{key:c":"}, right:App{left-lhs=left:Var{k1=key}, right:AType{kt=tt}} }} => (
6-
if typeof-term(rhs).is-t(c"Cons",2) {
6+
if typeof-term(rhs).is-t(interned-tag-cons,2) {
77
match rhs {
88
App{le=left, re=right} => (
9-
if kt.is-t(c"...",0) {
10-
kt = kt.slot(c"...",0).r1;
9+
if kt.is-t(interned-tag-vararg,0) {
10+
kt = kt.slot(interned-tag-vararg,0).r1;
1111
if can-unify(kt, typeof-term(re)) {
1212
if kt.is-open { callee-ctx = union(callee-ctx, unify(kt, typeof-term(re), rhs)); };
1313
let c1 = std-c-compile-expr(caller-ctx, re, false);
@@ -30,8 +30,8 @@ let std-c-compile-args(callee-ctx: FContext, caller-ctx: FContext, lhs: AST, rhs
3030
);
3131
}
3232
} else {
33-
if kt.is-t(c"...",0) {
34-
kt = kt.slot(c"...",0).r1;
33+
if kt.is-t(interned-tag-vararg,0) {
34+
kt = kt.slot(interned-tag-vararg,0).r1;
3535
if can-unify(kt, typeof-term(rhs)) {
3636
if kt.is-open { callee-ctx = union(callee-ctx, unify(kt, typeof-term(rhs), rhs)); };
3737
let c1 = std-c-compile-expr(caller-ctx, rhs, false);
@@ -53,11 +53,11 @@ let std-c-compile-args(callee-ctx: FContext, caller-ctx: FContext, lhs: AST, rhs
5353
(f, callee-ctx, caller-ctx)
5454
);
5555
App{ left:Lit{key:c":"}, right:App{left-lhs=left:Var{k2=key}, right:AType{kt=tt}} } => (
56-
if typeof-term(rhs).is-t(c"Cons",2) {
56+
if typeof-term(rhs).is-t(interned-tag-cons,2) {
5757
match rhs {
5858
App{le=left, re=right} => (
59-
if kt.is-t(c"...",0) {
60-
kt = kt.slot(c"...",0).r1;
59+
if kt.is-t(interned-tag-vararg,0) {
60+
kt = kt.slot(interned-tag-vararg,0).r1;
6161
if kt.is-open { callee-ctx = union(callee-ctx, unify(kt, typeof-term(re), rhs)); };
6262
let c1 = std-c-compile-expr(caller-ctx, re, false);
6363
caller-ctx = open(c1.context);
@@ -70,8 +70,8 @@ let std-c-compile-args(callee-ctx: FContext, caller-ctx: FContext, lhs: AST, rhs
7070
);
7171
}
7272
} else {
73-
if kt.is-t(c"...",0) {
74-
kt = kt.slot(c"...",0).r1;
73+
if kt.is-t(interned-tag-vararg,0) {
74+
kt = kt.slot(interned-tag-vararg,0).r1;
7575
if can-unify(kt, typeof-term(rhs)) {
7676
if kt.is-open { callee-ctx = union(callee-ctx, unify(kt, typeof-term(rhs), rhs)); };
7777
let c1 = std-c-compile-expr(caller-ctx, rhs, false);

PLUGINS/BACKEND/C/std-c-compile-call.lsts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let std-c-compile-call(ctx: FContext, fname: CString, args: AST): Fragment = std
44
let std-c-compile-call(ctx: FContext, fname: CString, return-hint-if-constructor: Type, args: AST): Fragment = (
55
let fterm = Some(mk-tctx()).maybe-find-callable(fname, typeof-term(args), args, return-hint-if-constructor)
66
.expect("std-c-compile-call Function \{fname} was null\nArguments: \{typeof-term(args)}, Return Hint \{return-hint-if-constructor}\nAt \{args.location}\n").blame-or-zero;
7-
if typeof-term(fterm).is-t(c"Blob",0) {
7+
if typeof-term(fterm).is-t(interned-tag-blob,0) {
88
if typeof-term(fterm).is-open and fname!=c"open" and fname!=c"mov" then {
99
for tr in Some(mk-tctx()).lookups(fname) {
1010
print("STD C compile call candidate \{fname} : \{tr.dt-or-zero}\n");
@@ -20,7 +20,7 @@ let std-c-compile-call(ctx: FContext, fname: CString, return-hint-if-constructor
2020
);
2121
_ => fail("Unexpected fterm in std-c-compile-call: \{fname}\n\{fterm}\n");
2222
}; r
23-
} else if typeof-term(fterm).is-t(c"Prop",0) { std-c-compile-expr(ctx, args, false)
23+
} else if typeof-term(fterm).is-t(interned-tag-prop,0) { std-c-compile-expr(ctx, args, false)
2424
} else {
2525
if typeof-term(fterm).is-open then {
2626
for tr in Some(mk-tctx()).lookups(fname) {
@@ -29,7 +29,7 @@ let std-c-compile-call(ctx: FContext, fname: CString, return-hint-if-constructor
2929
exit-error("STD C compile call is open \{fname} (\{typeof-term(args)})\n\{typeof-term(fterm)}\nArgs \{args}\n", args);
3030
};
3131
let push-args = std-c-compile-push-args(ctx, args);
32-
let function-id = if typeof-term(fterm).is-t(c"FFI",0) or typeof-term(fterm).is-t(c"C-FFI",0)
32+
let function-id = if typeof-term(fterm).is-t(interned-tag-ffi,0) or typeof-term(fterm).is-t(interned-tag-cffi,0)
3333
then fname else mangle-identifier-function(fname, typeof-term(fterm));
3434
let ictx = mk-fragment().set(c"function-id", SAtom(function-id));
3535
let inner-ctx = mk-fctx().bind(c"ictx", t0(c"ImplicitContext"), ictx)

PLUGINS/BACKEND/C/std-c-compile-expr.lsts

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
7070
Var{ key=key } => (
7171
if typeof-term(t) <: type-c-void {
7272
mk-fragment().set(c"expression",SAtom(c"({})"));
73-
} else if typeof-term(t).is-t(c"C-FFI",0) {
73+
} else if typeof-term(t).is-t(interned-tag-cffi,0) {
7474
mk-fragment().set(c"expression",SAtom(key.replace(c"-",c"_").rewrite-if-reserved));
7575
} else {
7676
let def = var-to-def(t);
@@ -81,20 +81,20 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
8181
}
8282
);
8383
AType{ tt=tt } => (
84-
if tt.is-t(c"Type",1) {
84+
if tt.is-t(interned-tag-type,1) {
8585
mk-fragment().set(c"expression",SAtom(c"0"));
8686
} else {
8787
mk-fragment().set(c"expression",std-c-mangle-type(tt, t));
8888
}
8989
);
9090
App{ left:Abs{lhs=lhs:Var{name=key}, rhs:ASTNil{}}, rhs=right } => (
9191
let lt = typeof-term(lhs).without-modifiers;
92-
let vid = if lt.is-t(c"Nil",0) or lt <: type-c-void then SAtom(c"({})") else if std-c-is-ctype(lt) then SAtom(name.replace(c"-",c"_").rewrite-if-reserved) else SAtom(uuid());
92+
let vid = if lt.is-t(interned-tag-nil,0) or lt <: type-c-void then SAtom(c"({})") else if std-c-is-ctype(lt) then SAtom(name.replace(c"-",c"_").rewrite-if-reserved) else SAtom(uuid());
9393
let v = mk-fragment().set(c"expression",vid);
9494
let f = mk-fragment();
9595
std-c-fragment-context = std-c-fragment-context.bind( lhs, v );
9696
ctx = ctx.bind( name, lt, v );
97-
if lt.is-t(c"Nil",0) or lt.is-t(c"Never",0) or lt <: type-c-void {
97+
if lt.is-t(interned-tag-nil,0) or lt.is-t(interned-tag-never,0) or lt <: type-c-void {
9898
} else if lt <: type-c-label {
9999
f = f.set(c"expression", v.get(c"expression") + SAtom(c":"));
100100
} else {
@@ -110,7 +110,7 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
110110
_ => (
111111
let rf = std-c-compile-expr(ctx, rhs, false);
112112
f = f.set(c"frame", f.get(c"frame") + rf.get(c"frame"));
113-
if lt.is-t(c"Nil",0) or lt.is-t(c"Never",0) or lt <: type-c-void {
113+
if lt.is-t(interned-tag-nil,0) or lt.is-t(interned-tag-never,0) or lt <: type-c-void {
114114
f = f.set(c"expression", SAtom(c"({") + rf.get(c"expression") + SAtom(c";({});})"));
115115
} else {
116116
f = f.set(c"expression", SAtom(c"({")
@@ -129,13 +129,13 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
129129
);
130130
);
131131
App{ left:App{left:App{left:Var{key:c"if"}, cond=right}, tr=right}, fa=right } => (
132-
let ec = if typeof-term(cond).is-t(c"Bool",0)
132+
let ec = if typeof-term(cond).is-t(interned-tag-bool,0)
133133
then std-c-compile-expr(ctx, cond, false )
134134
else std-c-compile-call(ctx, c"into-branch-conditional", cond);
135135
let et = std-c-compile-expr( open(ec.context), tr, false );
136-
if typeof-term(tr).is-t(c"Never",0) then et = never-as-expr(et, typeof-term(t), t);
136+
if typeof-term(tr).is-t(interned-tag-never,0) then et = never-as-expr(et, typeof-term(t), t);
137137
let ef = std-c-compile-expr( open(ec.context), fa, false );
138-
if typeof-term(fa).is-t(c"Never",0) then ef = never-as-expr(ef, typeof-term(t), t);
138+
if typeof-term(fa).is-t(interned-tag-never,0) then ef = never-as-expr(ef, typeof-term(t), t);
139139

140140
let ictx = mk-fragment();
141141
ctx = ctx.bind(c"c", t0(c"Bool"), ec);
@@ -148,10 +148,10 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
148148
);
149149
App{ o-t=left:Var{key:c"open"}, inner-term=right } => (
150150
let tt = typeof-term(inner-term);
151-
if tt.is-t(c"Array",2) { match tt.slot(c"Array",2) {
152-
TGround{ tag:c"Array", parameters:[_..TAny{}..] } => std-c-compile-expr(ctx, inner-term, false);
153-
TGround{ tag:c"Array", parameters:[TAny{}..inner-tt..] } => std-c-compile-call(ctx, c"open", inner-term);
154-
TGround{ tag:c"Array", parameters:[array-length..inner-tt..] } => std-c-compile-expr(ctx, inner-term, false);
151+
if tt.is-t(interned-tag-array,2) { match tt.slot(interned-tag-array,2) {
152+
TGround{ tag:interned-tag-array, parameters:[_..TAny{}..] } => std-c-compile-expr(ctx, inner-term, false);
153+
TGround{ tag:interned-tag-array, parameters:[TAny{}..inner-tt..] } => std-c-compile-call(ctx, c"open", inner-term);
154+
TGround{ tag:interned-tag-array, parameters:[array-length..inner-tt..] } => std-c-compile-expr(ctx, inner-term, false);
155155
}} else std-c-compile-call(ctx, c"open", inner-term)
156156
);
157157
App{ o-t=left:Var{key:c"sizeof"}, right:AType{tt=tt} } => (
@@ -160,30 +160,17 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
160160
);
161161
Lit{val=key} => (
162162
let tt = typeof-term(t);
163-
if tt.is-t(c"C",1) and tt.r1.is-t(c"uint8_t",0) then mk-expression(val)
164-
else if tt.is-t(c"C",1) and tt.r1.is-t(c"uint06_t",0) then mk-expression(val)
165-
else if tt.is-t(c"C",1) and tt.r1.is-t(c"uint22_t",0) then mk-expression(val)
166-
else if tt.is-t(c"C",1) and tt.r1.is-t(c"uint64_t",0) then mk-expression(val)
167-
else if tt.is-t(c"C",1) and tt.r1.is-t(c"int8_t",0) then mk-expression(val)
168-
else if tt.is-t(c"C",1) and tt.r1.is-t(c"int06_t",0) then mk-expression(val)
169-
else if tt.is-t(c"C",1) and tt.r1.is-t(c"int22_t",0) then mk-expression(val)
170-
else if tt.is-t(c"C",1) and tt.r1.is-t(c"int64_t",0) then mk-expression(val)
171-
else if tt.is-t(c"C",1) and tt.r1.is-t(c":Label",0) then mk-expression(val)
172-
else if tt.is-t(c"L",0) then mk-expression(val)
173-
else if tt.is-t(c"CString",0) then mk-expression(val.escape-as-cstring)
174-
else if tt.slot(c"Array",2).l1.slot(c"C",1).l1.is-t(c"char",0) then mk-expression(val.escape-as-cstring)
175-
else if tt.is-t(c"Regex",0) {
163+
if tt.is-t(interned-tag-l,0) then mk-expression(val)
164+
else if tt.is-t(interned-tag-cstring,0) then mk-expression(val.escape-as-cstring)
165+
else if tt.slot(interned-tag-array,2).l1.slot(interned-tag-c,1).l1.is-t(interned-tag-char,0) then mk-expression(val.escape-as-cstring)
166+
else if tt.is-t(interned-tag-regex,0) {
176167
let rgx-id = uuid();
177168
assemble-header-section = assemble-header-section +
178169
SAtom(c"regex_t ") + SAtom(rgx-id) + SAtom(c";\n");
179170
assemble-global-initializer-section = assemble-global-initializer-section +
180171
SAtom(c"{int return_code = regcomp(&") + SAtom(rgx-id) + SAtom(c", ") +
181172
val.escape-as-cstring + SAtom(c", REG_EXTENDED); if(return_code){ fprintf(stderr,\"Could not compile regex.\"); exit(1);}};\n");
182173
mk-expression(rgx-id);
183-
} else if tt.is-datatype and tt.is-t(c"List",1) and val==c"LEOF" {
184-
std-c-compile-call(ctx, val, typeof-term(t), mk-nil());
185-
} else if tt.is-datatype and tt.is-t(c"HashtableEq",2) and val==c"HashtableEqEOF" {
186-
std-c-compile-call(ctx, val, typeof-term(t), mk-nil());
187174
} else { match val {
188175
c"True" => mk-expression(c"(1)");
189176
c"False" => mk-expression(c"(0)");
@@ -236,9 +223,9 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
236223
App{ lt=left, rt=right } => (
237224
let lt-tt = typeof-term(lt);
238225
let rt-tt = typeof-term(rt);
239-
if lt-tt.is-t(c"Type",1) and rt-tt <: t1(c"Type",t0(c"CString")).rewrite-type-alias
226+
if lt-tt.is-t(interned-tag-type,1) and rt-tt <: t1(c"Type",t0(c"CString")).rewrite-type-alias
240227
then (
241-
let lt-val = lt-tt.slot(c"Type",1).l1.into(type(String)).into(type(CString));
228+
let lt-val = lt-tt.slot(interned-tag-type,1).l1.into(type(String)).into(type(CString));
242229
mk-expression(lt-val.escape-as-cstring)
243230
) else std-c-compile-call(ctx, fname2, right);
244231
);

PLUGINS/BACKEND/C/std-c-compile-global.lsts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
4040
else if k==c"bsearch" then std-c-force-import-clib(c"stdlib.h")
4141
else if k==c"qsort" then std-c-force-import-clib(c"stdlib.h")
4242
else if k==c"__compar_fn_t" then std-c-force-import-clib(c"stdlib.h")
43-
else if kt.is-open or kt.is-t(c"Blob",0) or kt.is-t(c"FFI",0) or kt.is-t(c"Prop",0) then ()
43+
else if kt.is-open or kt.is-t(interned-tag-blob,0) or kt.is-t(interned-tag-ffi,0) or kt.is-t(interned-tag-prop,0) then ()
4444
else if k==c"main" and not(non-zero(compile-global-c-main-term)) then {
4545
compile-global-c-main-term = term;
4646
} else match term {
4747
App{left:Lit{key:c":"}, right:App{left:ASTNil{}, right:AType{tt=tt}}} => (
48-
if not(tt.is-t(c"C-FFI",0)) and not(tt.is-t(c"C-Fragment",0)) {
48+
if not(tt.is-t(interned-tag-cffi,0)) and not(tt.is-t(interned-tag-cfragment,0)) {
4949
let clean-tt = kt.weaken.without-phi;
5050
k = mangle-identifier(k, clean-tt);
5151
};
@@ -56,30 +56,30 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
5656
text = text + SAtom(k);
5757
text = text + post-decl;
5858
text = text + SAtom(c";\n");
59-
if kt.is-t(c"Nil",0) or kt.is-t(c"Never",0) or kt <: type-c-void then ()
59+
if kt.is-t(interned-tag-nil,0) or kt.is-t(interned-tag-never,0) or kt <: type-c-void then ()
6060
else if can-unify(type-c-typedef, tt) or can-unify(type-array-c-typedef, tt) {
6161
assemble-header-typedef-section = assemble-header-typedef-section + text;
6262
} else {
6363
assemble-gdecl-section = assemble-gdecl-section + text;
6464
}
6565
);
6666
App{left:Lit{key:c":"}, right:App{t=left, right:AType{tt=tt}}} => (
67-
if not(tt.is-t(c"C-FFI",0)) and not(tt.is-t(c"C-Fragment",0)) {
67+
if not(tt.is-t(interned-tag-cffi,0)) and not(tt.is-t(interned-tag-cfragment,0)) {
6868
let clean-tt = kt.weaken.without-phi;
6969
k = mangle-identifier(k, clean-tt);
7070
};
7171
let gend = false;
72-
if tt.is-t(c"C-Fragment",0) {
72+
if tt.is-t(interned-tag-cfragment,0) {
7373
match t {
7474
Lit{key=key} => (
75-
if kt.is-t(c"Nil",0) or kt.is-t(c"Never",0) or kt <: type-c-void then ()
75+
if kt.is-t(interned-tag-nil,0) or kt.is-t(interned-tag-never,0) or kt <: type-c-void then ()
7676
else assemble-gdecl-section = assemble-gdecl-section + SAtom(key);
7777
gend = true;
7878
);
7979
_ => ();
8080
}
8181
};
82-
if not(gend) and (kt.is-t(c"Nil",0) or kt.is-t(c"Never",0) or kt <: type-c-void) {
82+
if not(gend) and (kt.is-t(interned-tag-nil,0) or kt.is-t(interned-tag-never,0) or kt <: type-c-void) {
8383
let inner-expr = std-c-compile-expr( ctx, t, false );
8484
let text = inner-expr.get(c"expression") + SAtom(c";\n");
8585
assemble-global-initializer-section = assemble-global-initializer-section + text;
@@ -93,7 +93,7 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
9393
text = text + SAtom(c";\n");
9494

9595
let inner-expr = std-c-compile-expr( ctx, t, false );
96-
if kt.is-t(c"Nil",0) or kt.is-t(c"Never",0) or kt <: type-c-void then {
96+
if kt.is-t(interned-tag-nil,0) or kt.is-t(interned-tag-never,0) or kt <: type-c-void then {
9797
text = SNil;
9898
text = SAtom(k) + SAtom(c" = ") + inner-expr.get(c"expression") + SAtom(c";\n");
9999
} else if can-unify(type-c-typedef, tt) or can-unify(type-array-c-typedef, tt) {
@@ -106,13 +106,13 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
106106
}
107107
);
108108
Abs{lhs=lhs,rhs=rhs,tt=tt} => (
109-
if k!=c"main" and not(kt.is-t(c"C-FFI_s",0)) {
109+
if k!=c"main" and not(kt.is-t(interned-tag-cffi,0)) {
110110
k = mangle-identifier-function(k, kt.without-phi);
111111
};
112112
ctx = std-c-compile-destructure-args( ctx, lhs, false );
113113
let loc = term.location;
114114
let initialized = match rhs {
115-
App{ left:Lit{key:c":"}, right:App{ left:ASTNil{}, right:AType{asc-tt=tt} } } => asc-tt.is-t(c"Nil",0);
115+
App{ left:Lit{key:c":"}, right:App{ left:ASTNil{}, right:AType{asc-tt=tt} } } => asc-tt.is-t(interned-tag-nil,0);
116116
_ => true;
117117
};
118118
if initialized or can-unify(type-c-typedef, tt) {
@@ -166,7 +166,7 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
166166
);
167167
t => (
168168
let tt = kt;
169-
if not(kt.is-t(c"C-FFI",0)) and not(tt.is-t(c"C-Fragment",0)) {
169+
if not(kt.is-t(interned-tag-cffi,0)) and not(tt.is-t(interned-tag-cfragment,0)) {
170170
k = mangle-identifier(k, tt.without-phi);
171171
};
172172

@@ -177,11 +177,11 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
177177
text = text + SAtom(k);
178178
text = text + post-decl;
179179
text = text + SAtom(c";\n");
180-
if kt.is-t(c"Nil",0) or kt.is-t(c"Never",0) or kt <: type-c-void then ()
180+
if kt.is-t(interned-tag-nil,0) or kt.is-t(interned-tag-never,0) or kt <: type-c-void then ()
181181
else assemble-gdecl-section = assemble-gdecl-section + text;
182182

183183
let inner-expr = std-c-compile-expr( ctx, t, false );
184-
if kt.is-t(c"Nil",0) or kt.is-t(c"Never",0) or kt <: type-c-void {
184+
if kt.is-t(interned-tag-nil,0) or kt.is-t(interned-tag-never,0) or kt <: type-c-void {
185185
text = inner-expr.get(c"expression") + SAtom(c";\n");
186186
assemble-global-initializer-section = assemble-global-initializer-section + text;
187187
} else {

0 commit comments

Comments
 (0)