-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
60 lines (45 loc) · 1.7 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Language-specific commands
@obril-build:
odin build obril
@obril *args="":
just obril-build && ./obril.bin {{args}} | just clean-nulls
@obril-raw *args="":
just obril-build && ./obril.bin {{args}}
@obril-file bril-file *args="":
cat {{bril-file}} | bril2json | just obril {{args}}
@zbril-build:
cd zbril && zig build
@zbril *args="":
just zbril-build && ./zbril/zig-out/bin/zbril {{args}}
@zbril-file bril-file *args="":
cat {{bril-file}} | bril2json | just zbril {{args}}
# None-language-specific commands
# -e for envs name
# --save
# --diff
@test *args="":
just zbril-build && just obril-build && turnt {{args}} test/**/*.bril
# use zbril or obril
@graphviz exe bril-file:
just {{exe}}-file {{bril-file}} --graphviz | dot -Tpdf -o scratch/cfg.pdf && evince scratch/cfg.pdf
# round trip to test conversion of bril.Program to basic blocks and back.
# jq sorts keys with `-S`
# Can be used like `find bril bril/test/interp/core --exec just roundtrip`
# Be careful with obril, as odin compiles from scratch every time, so need to set
# threads to 1 by `find -j=1`
# TODO put this into test suite
@roundtrip exe bril-file:
diff <(just {{exe}}-file {{bril-file}} --unoptimized | jq -S) <(cat {{bril-file}} | bril2json)
# try with bril/examples/test/tdce/simple.bril
# shows before and after.
@dce exe bril-file:
just {{exe}}-file {{bril-file}} --unoptimized | bril2txt
just {{exe}}-file {{bril-file}} --dead-code-elimination | bril2txt
@brili *args="":
deno run bril/brili.ts {{args}}
# Utils
# Used for obril, as there doesn't appear to be a way
# to print json w/out nulls.
@clean-nulls *args="":
#jq {{args}} 'del(..|nulls)'
picogron | rg -v null | picogron -u