Skip to content

Commit 2ee84ed

Browse files
committed
only index if enabled
1 parent f3db0cd commit 2ee84ed

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

LM23COMMON/profile-count-ast.lsts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11

2+
let config-profile-ast = false;
3+
24
let profile-count-ast-unique-index = mk-hashtable-is(type(AST), type(U64));
35
let profile-count-ast-equal-index = mk-hashtable(type(AST), type(U64));
46

57
let profile-visit-ast-unique(t: AST): Nil = (
6-
profile-count-ast-unique-index = profile-count-ast-unique-index.bind(
7-
t,
8-
profile-count-ast-unique-index.lookup(t, 0_u64) + 1
9-
);
8+
if config-profile-ast then {
9+
profile-count-ast-unique-index = profile-count-ast-unique-index.bind(
10+
t,
11+
profile-count-ast-unique-index.lookup(t, 0_u64) + 1
12+
);
13+
}
1014
);
1115

1216
let profile-visit-ast-equal(t: AST): Nil = (
13-
profile-count-ast-equal-index = profile-count-ast-equal-index.bind(
14-
t,
15-
profile-count-ast-equal-index.lookup(t, 0_u64) + 1
16-
);
17+
if config-profile-ast then {
18+
profile-count-ast-equal-index = profile-count-ast-equal-index.bind(
19+
t,
20+
profile-count-ast-equal-index.lookup(t, 0_u64) + 1
21+
);
22+
}
1723
);
1824

1925
let profile-print-ast(): Nil = (

SRC/main.lsts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ let print-toks-json(fp: CString): Nil = (
2727
);
2828

2929
let show-alloc-count = false;
30-
let config-profile-ast = false;
3130

3231
let main(argc: C_int, argv: CString[]): Nil = (
3332
let argi = 1_u64;

0 commit comments

Comments
 (0)