You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PLUGINS/BACKEND/C/std-c-compile-call.lsts
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ let std-c-compile-call(ctx: FContext, fname: CString, args: AST): Fragment = std
4
4
let std-c-compile-call(ctx: FContext, fname: CString, return-hint-if-constructor: Type, args: AST): Fragment = (
5
5
let fterm = Some(mk-tctx()).maybe-find-callable(fname, typeof-term(args), args, return-hint-if-constructor)
6
6
.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) {
8
8
if typeof-term(fterm).is-open and fname!=c"open" and fname!=c"mov" then {
9
9
for tr in Some(mk-tctx()).lookups(fname) {
10
10
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
20
20
);
21
21
_ => fail("Unexpected fterm in std-c-compile-call: \{fname}\n\{fterm}\n");
22
22
}; 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)
24
24
} else {
25
25
if typeof-term(fterm).is-open then {
26
26
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
29
29
exit-error("STD C compile call is open \{fname} (\{typeof-term(args)})\n\{typeof-term(fterm)}\nArgs \{args}\n", args);
30
30
};
31
31
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)
33
33
then fname else mangle-identifier-function(fname, typeof-term(fterm));
34
34
let ictx = mk-fragment().set(c"function-id", SAtom(function-id));
35
35
let inner-ctx = mk-fctx().bind(c"ictx", t0(c"ImplicitContext"), ictx)
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());
93
93
let v = mk-fragment().set(c"expression",vid);
94
94
let f = mk-fragment();
95
95
std-c-fragment-context = std-c-fragment-context.bind( lhs, v );
96
96
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 {
98
98
} else if lt <: type-c-label {
99
99
f = f.set(c"expression", v.get(c"expression") + SAtom(c":"));
100
100
} else {
@@ -110,7 +110,7 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
110
110
_ => (
111
111
let rf = std-c-compile-expr(ctx, rhs, false);
112
112
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 {
114
114
f = f.set(c"expression", SAtom(c"({") + rf.get(c"expression") + SAtom(c";({});})"));
115
115
} else {
116
116
f = f.set(c"expression", SAtom(c"({")
@@ -129,13 +129,13 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
0 commit comments