Skip to content

Commit 11bbc08

Browse files
committed
restore print
1 parent a2985ab commit 11bbc08

File tree

7 files changed

+0
-65
lines changed

7 files changed

+0
-65
lines changed

PLUGINS/BACKEND/C/compile-c.lsts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11

22
let plugins-backend-c-compile(): Nil = (
3-
print("Compile Backend 1\n");
4-
print("Allocated blocks \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
53
for vector program-term in ast-parsed-program.unroll-seq { match program-term {
64
Glb{ key=key, rhs=val } => (
7-
print("Compile Backend \{program-term}\n");
85
if key.key==c"main" then assemble-argv-referenced = true;
96
let fragment = mk-fragment();
107
let kt = typeof-term(rhs);
@@ -31,23 +28,14 @@ let plugins-backend-c-compile(): Nil = (
3128
);
3229
_ => ();
3330
}};
34-
print("Compile Backend 2\n");
35-
print("Allocated blocks \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
3631
for vector program-term in ast-parsed-program.unroll-seq { match program-term {
3732
Typedef{} => std-c-compile-type-typedef(program-term);
3833
_ => ();
3934
}};
40-
print("Compile Backend 3\n");
41-
print("Allocated blocks \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
4235
try-continue-compile-c-typedefs();
43-
print("Compile Backend 4\n");
44-
print("Allocated blocks \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
4536
compile-program-ordered(global-ctx, ast-parsed-program);
46-
print("Compile Backend 5\n");
4737
std-c-compile-finish();
48-
print("Compile Backend 6\n");
4938
std-c-compile-write();
50-
print("Compile Backend 7\n");
5139
);
5240

5341
register-backend(c"--c", &plugins-backend-c-compile);

PLUGINS/BACKEND/C/compile-program-ordered.lsts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ let compile-program-ordered(global-ctx: FContext, program: AST): Nil = (
33
for vector g in program.unroll-seq { match g {
44
Glb{ key=key, val=val } => (
55
config-hot-path = key.key == c"std-bind-term";
6-
print("Compile glb \{g}\n");
76
if not(typeof-term(def-to-sym(g)).is-open)
87
or not(typeof-term(val).is-open) then {
98
std-c-compile-global(global-ctx, key.key, val);
@@ -14,14 +13,10 @@ let compile-program-ordered(global-ctx: FContext, program: AST): Nil = (
1413
AType{} => ();
1514
Meta{} => ();
1615
t => (
17-
print("Compile glb \{g}\n");
1816
let e = std-c-compile-expr(global-ctx, t, false);
1917
let text = e.get(c"frame") + e.get(c"expression") + SAtom(c";\n");
2018
assemble-global-initializer-section = assemble-global-initializer-section + text;
2119
);
2220
}};
23-
print(c"Compiled All Terms\n");
24-
print("Compile glb \{compile-global-c-main-term}\n");
2521
if non-zero(compile-global-c-main-term) then std-c-compile-global(global-ctx, c"main", compile-global-c-main-term);
26-
print("Compiled ordered\n");
2722
);

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,15 @@ let .rewrite-if-reserved(s: CString): CString = (
6666
);
6767

6868
let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
69-
if config-hot-path then print("Compile Expression \{t}\n");
7069
let f = match t {
7170
Var{ key=key } => (
72-
if config-hot-path then print("Compile Var 1\n");
7371
if typeof-term(t) <: t1(c"C",t0(c"void")) {
74-
if config-hot-path then print("Compile Var 2\n");
7572
mk-fragment().set(c"expression",SAtom(c"({})"));
7673
} else if typeof-term(t).is-t(c"C-FFI",0) {
77-
if config-hot-path then print("Compile Var 3\n");
7874
mk-fragment().set(c"expression",SAtom(key.replace(c"-",c"_").rewrite-if-reserved));
7975
} else {
80-
if config-hot-path then print("Compile Var 4\n");
8176
let def = var-to-def(t);
82-
if config-hot-path then print("Compile Var 5\n");
8377
let e = std-c-fragment-context.lookup(def, mk-fragment());
84-
if config-hot-path then print("Compile Var 6\n");
8578
if not(non-zero(e)) {
8679
exit-error("Unable to Find Variable Fragment in Context: \{key}", t );
8780
}; e
@@ -314,13 +307,9 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
314307
mk-fragment();
315308
);
316309
};
317-
if config-hot-path then print("Compile Expression End 10\n");
318310
if is-stmt and non-zero(f.get(c"expression")) then f = f.set(c"expression", f.get(c"expression") + SAtom(c";"));
319-
if config-hot-path then print("Compile Expression End 11\n");
320311
f.context = close(ctx);
321-
if config-hot-path then print("Compile Expression End 12\n");
322312
f.type = typeof-term(t);
323-
if config-hot-path then print("Compile Expression End 13\n");
324313
f
325314
);
326315

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ let std-c-finish-forced-imports(): S = (
1717
let compile-global-c-main-term = mk-eof();
1818

1919
let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
20-
print("Compile Global \{k} = \{term}\n");
21-
print("Allocated blocks \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
2220
let kt = typeof-term(term);
2321
std-c-force-import-clib(c"string.h");
2422
if k==c"" then ()
@@ -108,19 +106,15 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
108106
}
109107
);
110108
Abs{lhs=lhs,rhs=rhs,tt=tt} => (
111-
print("Compile Global 3.1\n");
112109
if k!=c"main" and not(kt.is-t(c"C-FFI_s",0)) {
113110
k = mangle-identifier-function(k, kt.without-phi);
114111
};
115-
print("Compile Global 3.2\n");
116112
ctx = std-c-compile-destructure-args( ctx, lhs, false );
117-
print("Compile Global 3.3\n");
118113
let loc = term.location;
119114
let initialized = match rhs {
120115
App{ left:Lit{key:c":"}, right:App{ left:ASTNil{}, right:AType{asc-tt=tt} } } => asc-tt.is-t(c"Nil",0);
121116
_ => true;
122117
};
123-
print("Compile Global 3.4\n");
124118
if initialized or can-unify(t1(c"C",t0(c"typedef")), tt) {
125119
let text = SNil();
126120
if not(config-strip-debug) and loc.filename != c"Unknown" {
@@ -143,10 +137,8 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
143137
assemble-gdecl-section = assemble-gdecl-section + text;
144138
}
145139
};
146-
print("Compile Global 3.5\n");
147140

148141
if initialized {
149-
print("Compile Global 3.5.1\n");
150142
let text = SNil();
151143
if not(config-strip-debug) and loc.filename != c"Unknown" {
152144
text = text + SAtom(c"\n#line ");
@@ -155,39 +147,29 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
155147
text = text + SAtom(loc.filename);
156148
text = text + SAtom(c"\"\n");
157149
};
158-
print("Compile Global 3.5.2\n");
159150
if k==c"main" then text = text + SAtom(c"int")
160151
else text = text + std-c-mangle-type(typeof-term(rhs), term);
161-
print("Compile Global 3.5.3\n");
162152
text = text + SAtom(c" ");
163153
text = text + SAtom(k);
164154
text = text + SAtom(c"(");
165155
text = text + std-c-compile-function-args(ctx, lhs);
166156
text = text + SAtom(c")");
167-
print("Compile Global 3.5.4\n");
168157

169158
let e = std-c-compile-call(ctx, c"cdecl::return", rhs);
170-
print("Compile Global 3.5.5\n");
171159
text = text + SAtom(c"{");
172160
if k==c"main" then text = text + assemble-string-initializer-section + assemble-global-initializer-section;
173161
text = text + e.get(c"frame") + e.get(c"expression") + SAtom(c"}");
174-
print("Compile Global 3.5.6\n");
175162

176163
assemble-text-section = assemble-text-section + text + SAtom(c"\n");
177-
print("Compile Global 3.5.7\n");
178164
};
179-
print("Compile Global 3.6\n");
180165
);
181166
t => (
182-
print("Compile Global 4.1\n");
183167
let tt = kt;
184168
if not(kt.is-t(c"C-FFI",0)) and not(tt.is-t(c"C-Fragment",0)) {
185169
k = mangle-identifier(k, tt.without-phi);
186170
};
187-
print("Compile Global 4.2\n");
188171

189172
(let pre-decl, let post-decl) = std-c-mangle-declaration(tt, term);
190-
print("Compile Global 4.3\n");
191173
let text = SNil();
192174
text = text + pre-decl;
193175
text = text + SAtom(c" ");
@@ -196,18 +178,15 @@ let std-c-compile-global(ctx: FContext, k: CString, term: AST): Nil = (
196178
text = text + SAtom(c";\n");
197179
if kt.is-t(c"Nil",0) or kt.is-t(c"Never",0) or kt <: t1(c"C",t0(c"void")) then ()
198180
else assemble-gdecl-section = assemble-gdecl-section + text;
199-
print("Compile Global 4.4\n");
200181

201182
let inner-expr = std-c-compile-expr( ctx, t, false );
202-
print("Compile Global 4.5\n");
203183
if kt.is-t(c"Nil",0) or kt.is-t(c"Never",0) or kt <: t1(c"C",t0(c"void")) {
204184
text = inner-expr.get(c"expression") + SAtom(c";\n");
205185
assemble-global-initializer-section = assemble-global-initializer-section + text;
206186
} else {
207187
text = SAtom(k) + SAtom(c" = ") + inner-expr.get(c"expression") + SAtom(c";\n");
208188
assemble-global-initializer-section = assemble-global-initializer-section + text;
209189
};
210-
print("Compile Global 4.6\n");
211190
);
212191
}
213192
);

SRC/typecheck-infer-expr.lsts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
193193
}};
194194
);
195195
Glb{key1=key, val=val} => (
196-
print("Typecheck Glb \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()} \{term}\n");
197196
let prev-count-history = safe-alloc-block-count-monotonic-history;
198197
let rough-tt = typeof-term(term);
199198
if rough-tt.is-arrow and not(rough-tt.is-open) and not(rough-tt.is-t(c"TypedMacro",0)) {

SRC/typecheck-typecheck.lsts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11

22
let typecheck(): Nil = (
3-
print("Typecheck 1 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
43
infer-global-context-prim(ast-parsed-program);
5-
print("Typecheck 2 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
64
infer-global-context-td(ast-parsed-program);
7-
print("Typecheck 3 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
85
infer-global-context(ast-parsed-program);
9-
print("Typecheck 4 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
106
assert-no-infinite-types();
11-
print("Typecheck 5 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
127
(global-flow-tctx, ast-parsed-program) = infer-global-terms(global-flow-tctx, ast-parsed-program);
13-
print("Typecheck 6 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
148
tctx-currently-processing-globals = false;
159
(global-flow-tctx, ast-parsed-program) = std-infer-expr(global-flow-tctx, ast-parsed-program, false, Used, ta);
16-
print("Typecheck 7 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
1710
# TODO: release globals for graceful exit
1811
while non-zero(stack-to-specialize) { match stack-to-specialize.pop {
1912
# this can't be a normal for-loop because it gets extended during iteration
2013
StackToSpecialize{ key=key, ctx=ctx, result-type=result-type, term=term } => (
2114
specialize(key, ctx, result-type, term);
2215
);
2316
}};
24-
print("Typecheck 8 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
2517
validate-interfaces();
26-
print("Typecheck 9 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
2718
assert-well-typed(ast-parsed-program);
28-
print("Typecheck 10 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
2919
decorate-var-to-def();
30-
print("Typecheck 11 \{safe-alloc-block-count-monotonic}, total memory = \{current_allocated_memory()}\n");
3120
);

SRC/typecheck-var-to-def-index.lsts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@ let config-hot-path = false;
44
let var-to-def-index = mk-hashtable-is(type(AST), type(AST));
55

66
let var-to-def(k: AST): AST = (
7-
if config-hot-path then print("Var to Def 1 \{k}\n");
87
let def = var-to-def-index.lookup(k, mk-eof());
9-
if config-hot-path then print("Var to Def 2 \{k}\n");
108
if not(non-zero(def)) {
119
exit-error( "Unable to Find Symlink in Context: \{k}".into(type(CString)), k );
1210
};
1311
def-to-sym(def)
1412
);
1513

1614
let def-to-sym(k: AST): AST = (
17-
if config-hot-path then print("Def to Sym 1 \{k}\n");
1815
let sym = var-to-def-index.lookup(k, mk-eof());
19-
if config-hot-path then print("Def to Sym 2 \{k}\n");
2016
if non-zero(sym) then sym else k
2117
);
2218

0 commit comments

Comments
 (0)