+
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion specification/wasm-2.0/1-syntax.spectec
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ syntax resulttype hint(desc "result type") =
syntax packtype hint(desc "packed type") = I8 | I16
syntax lanetype hint(desc "lane type") = numtype | packtype

syntax Pnn hint(show I#n) = I8 | I16
syntax Pnn hint(show I#n) = packtype
syntax Jnn hint(show I#n) = Inn | Pnn
syntax Lnn hint(show I#n) = Inn | Fnn | Pnn

Expand Down
2 changes: 1 addition & 1 deletion specification/wasm-3.0/1.2-syntax.types.spectec
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ syntax valtype/sem =
| ... | BOT


syntax Inn hint(show I#N) hint(macro "nt%") = I32 | I64
syntax Inn hint(show I#N) hint(macro "nt%") = addrtype
syntax Fnn hint(show F#N) hint(macro "nt%") = F32 | F64
syntax Vnn hint(show V#N) hint(macro "nt%") = V128
syntax Cnn hint(show t) = Inn | Fnn | Vnn
Expand Down
6 changes: 5 additions & 1 deletion spectec/src/exe-spectec/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type pass =
| Totalize
| Unthe
| Sideconditions
| TypeFamilyRemoval

(* This list declares the intended order of passes.

Expand All @@ -27,7 +28,7 @@ passers (--all-passes, some targets), we do _not_ want to use the order of
flags on the command line.
*)
let _skip_passes = [ Sub; Unthe ] (* Not clear how to extend them to indexed types *)
let all_passes = [ Totalize; Sideconditions ]
let all_passes = [ TypeFamilyRemoval; Totalize; Sideconditions; ]

type file_kind =
| Spec
Expand Down Expand Up @@ -73,18 +74,21 @@ let pass_flag = function
| Totalize -> "totalize"
| Unthe -> "the-elimination"
| Sideconditions -> "sideconditions"
| TypeFamilyRemoval -> "typefamily-removal"

let pass_desc = function
| Sub -> "Synthesize explicit subtype coercions"
| Totalize -> "Run function totalization"
| Unthe -> "Eliminate the ! operator in relations"
| Sideconditions -> "Infer side conditions"
| TypeFamilyRemoval -> "Transform Type families into sum types"

let run_pass : pass -> Il.Ast.script -> Il.Ast.script = function
| Sub -> Middlend.Sub.transform
| Totalize -> Middlend.Totalize.transform
| Unthe -> Middlend.Unthe.transform
| Sideconditions -> Middlend.Sideconditions.transform
| TypeFamilyRemoval -> Middlend.Typefamilyremoval.transform


(* Argument parsing *)
Expand Down
1 change: 1 addition & 0 deletions spectec/src/middlend/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
totalize
unthe
sideconditions
typefamilyremoval
)
)
2 changes: 1 addition & 1 deletion spectec/src/middlend/totalize.ml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ let rec t_def' env = function
| ExpP (_, typI) ->
let x = ("x" ^ string_of_int i) $ no_region in
[ExpB (x, typI) $ x.at], ExpA (VarE x $$ no_region % typI) $ no_region
| TypP id -> [], TypA (VarT (id, []) $ no_region) $ no_region
| TypP id -> [TypB id $ no_region], TypA (VarT (id, []) $ no_region) $ no_region
| DefP (id, _, _) -> [], DefA id $ no_region
| GramP (id, _) -> [], GramA (VarG (id, []) $ no_region) $ no_region
) params' |> List.split in
Expand Down
Loading
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载