Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 deps/stable-mir-json
Submodule stable-mir-json updated 40 files
+49 −0 .github/workflows/master.yml
+51 −0 .github/workflows/test.yml
+47 −0 .github/workflows/update-version.yml
+1 −0 Makefile
+3 −1 README.md
+1 −0 deps/rv-nix-tools
+105 −0 flake.lock
+69 −0 flake.nix
+15 −0 nix/stable-mir-json-source/default.nix
+47 −0 nix/stable-mir-json/default.nix
+39 −0 nix/test/integration.nix
+54 −40 src/printer.rs
+3 −3 tests/integration/normalise-filter.jq
+1,643 −1,643 tests/integration/programs/assert_eq.smir.json.expected
+753 −753 tests/integration/programs/binop.smir.json.expected
+540 −540 tests/integration/programs/char-trivial.smir.json.expected
+1,035 −1,035 tests/integration/programs/closure-args.smir.json.expected
+640 −640 tests/integration/programs/closure-no-args.smir.json.expected
+947 −947 tests/integration/programs/const-arithm-simple.smir.json.expected
+540 −540 tests/integration/programs/div.smir.json.expected
+540 −540 tests/integration/programs/double-ref-deref.smir.json.expected
+574 −574 tests/integration/programs/enum.smir.json.expected
+1,648 −1,648 tests/integration/programs/fibonacci.smir.json.expected
+1,361 −1,361 tests/integration/programs/float.smir.json.expected
+1,406 −1,406 tests/integration/programs/modulo.smir.json.expected
+1,002 −1,002 tests/integration/programs/mutual_recursion.smir.json.expected
+673 −673 tests/integration/programs/option-construction.smir.json.expected
+1,652 −1,652 tests/integration/programs/param_types.smir.json.expected
+540 −540 tests/integration/programs/primitive-type-bounds.smir.json.expected
+954 −954 tests/integration/programs/recursion-simple-match.smir.json.expected
+1,003 −1,003 tests/integration/programs/recursion-simple.smir.json.expected
+1,006 −1,006 tests/integration/programs/ref-deref.smir.json.expected
+2,325 −2,325 tests/integration/programs/shl_min.smir.json.expected
+2,032 −2,032 tests/integration/programs/slice.smir.json.expected
+540 −540 tests/integration/programs/strange-ref-deref.smir.json.expected
+1,176 −1,176 tests/integration/programs/struct.smir.json.expected
+1,690 −1,690 tests/integration/programs/sum-to-n.smir.json.expected
+1,033 −1,033 tests/integration/programs/tuple-eq.smir.json.expected
+540 −540 tests/integration/programs/tuples-simple.smir.json.expected
+2,101 −2,101 tests/integration/programs/weirdRefs.smir.json.expected
2 changes: 1 addition & 1 deletion deps/stable-mir-json_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
89a011e5a590635892fffae9ffd16885106c14e3
9610a3fcb6e8f07fb72622ffa7e5b69122eef89f
4 changes: 2 additions & 2 deletions kmir/src/kmir/kdist/mir-semantics/alloc.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ syntax GlobalAllocKind ::= globalAllocFunction(Instance)
| Memory(Allocation)
[group(mir-enum), symbol(GlobalAllocKind::Memory)]

syntax GlobalAlloc ::= globalAllocEntry(MIRInt, GlobalAllocKind)
[symbol(globalAllocEntry), group(mir)]
syntax GlobalAlloc ::= globalAllocEntry(MIRInt, Ty, GlobalAllocKind)
[symbol(globalAllocEntry), group(mir---alloc-id--ty--global-alloc)]

syntax GlobalAllocs ::= List {GlobalAlloc, ""}
[symbol(GlobalAllocs::append), terminator-symbol(GlobalAllocs::empty), group(mir-list)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"name": "arithmetic_unchecked_runs",
"crate_id": 13794361957699792544,
"allocs": [
[
2,
{
{
"alloc_id": 2,
"ty": 24,
"global_alloc": {
"Memory": {
"bytes": [
117,
Expand Down Expand Up @@ -81,10 +82,11 @@
"mutability": "Not"
}
}
],
[
3,
{
},
{
"alloc_id": 3,
"ty": 24,
"global_alloc": {
"Memory": {
"bytes": [
117,
Expand Down Expand Up @@ -161,7 +163,7 @@
"mutability": "Not"
}
}
]
}
],
"functions": [
[
Expand Down Expand Up @@ -237,7 +239,7 @@
}
],
[
38,
40,
{
"NoOpSym": ""
}
Expand Down Expand Up @@ -3642,7 +3644,7 @@
5,
{
"RefType": {
"pointee_type": 39,
"pointee_type": 38,
"layout": {
"fields": {
"Arbitrary": {
Expand Down Expand Up @@ -3707,7 +3709,7 @@
8,
{
"PtrType": {
"pointee_type": 40,
"pointee_type": 39,
"layout": {
"fields": "Primitive",
"variants": {
Expand Down Expand Up @@ -3749,7 +3751,7 @@
{
"EnumType": {
"name": "std::result::Result<isize, !>",
"adt_def": 22,
"adt_def": 23,
"discriminants": [
0,
1
Expand Down Expand Up @@ -3839,7 +3841,7 @@
{
"StructType": {
"name": "std::sys::pal::unix::process::process_common::ExitCode",
"adt_def": 13,
"adt_def": 14,
"fields": [
9
],
Expand Down Expand Up @@ -4320,7 +4322,7 @@
}
],
[
40,
39,
{
"PtrType": {
"pointee_type": 9,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
<types>
ty ( 1 ) |-> typeInfoTupleType ( .Tys )
ty ( 2 ) |-> typeInfoPrimitiveType ( primTypeInt ( intTyI8 ) )
ty ( 5 ) |-> typeInfoRefType ( ty ( 39 ) )
ty ( 5 ) |-> typeInfoRefType ( ty ( 38 ) )
ty ( 6 ) |-> typeInfoPrimitiveType ( primTypeInt ( intTyIsize ) )
ty ( 8 ) |-> typeInfoPtrType ( ty ( 40 ) )
ty ( 8 ) |-> typeInfoPtrType ( ty ( 39 ) )
ty ( 9 ) |-> typeInfoPrimitiveType ( primTypeUint ( uintTyU8 ) )
ty ( 10 ) |-> typeInfoEnumType ( "std::result::Result<isize, !>" , adtDef ( 22 ) , Discriminant ( 0 ) Discriminant ( 1 ) .Discriminants )
ty ( 10 ) |-> typeInfoEnumType ( "std::result::Result<isize, !>" , adtDef ( 23 ) , Discriminant ( 0 ) Discriminant ( 1 ) .Discriminants )
ty ( 11 ) |-> typeInfoRefType ( ty ( 12 ) )
ty ( 15 ) |-> typeInfoStructType ( "std::sys::pal::unix::process::process_common::ExitCode" , adtDef ( 13 ) , ty ( 9 ) .Tys )
ty ( 15 ) |-> typeInfoStructType ( "std::sys::pal::unix::process::process_common::ExitCode" , adtDef ( 14 ) , ty ( 9 ) .Tys )
ty ( 16 ) |-> typeInfoPrimitiveType ( primTypeInt ( intTyI32 ) )
ty ( 17 ) |-> typeInfoStructType ( "std::process::ExitCode" , adtDef ( 12 ) , ty ( 15 ) .Tys )
ty ( 18 ) |-> typeInfoRefType ( ty ( 15 ) )
Expand All @@ -91,11 +91,11 @@
ty ( 35 ) |-> typeInfoPrimitiveType ( primTypeInt ( intTyI16 ) )
ty ( 36 ) |-> typeInfoTupleType ( ty ( 35 ) ty ( 21 ) .Tys )
ty ( 37 ) |-> typeInfoPrimitiveType ( primTypeStr )
ty ( 40 ) |-> typeInfoPtrType ( ty ( 9 ) )
ty ( 39 ) |-> typeInfoPtrType ( ty ( 9 ) )
</types>
<adt-to-ty>
adtDef ( 12 ) |-> ty ( 17 )
adtDef ( 13 ) |-> ty ( 15 )
adtDef ( 22 ) |-> ty ( 10 )
adtDef ( 14 ) |-> ty ( 15 )
adtDef ( 23 ) |-> ty ( 10 )
</adt-to-ty>
</kmir>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
],
[
30,
33,
{
"NoOpSym": ""
}
Expand Down Expand Up @@ -2757,7 +2757,7 @@
5,
{
"RefType": {
"pointee_type": 31,
"pointee_type": 30,
"layout": {
"fields": {
"Arbitrary": {
Expand Down Expand Up @@ -2822,7 +2822,7 @@
8,
{
"PtrType": {
"pointee_type": 32,
"pointee_type": 31,
"layout": {
"fields": "Primitive",
"variants": {
Expand Down Expand Up @@ -2864,7 +2864,7 @@
{
"EnumType": {
"name": "std::result::Result<isize, !>",
"adt_def": 16,
"adt_def": 13,
"discriminants": [
0,
1
Expand All @@ -2874,7 +2874,7 @@
6
],
[
33
32
]
],
"layout": {
Expand Down Expand Up @@ -2954,7 +2954,7 @@
{
"StructType": {
"name": "std::sys::pal::unix::process::process_common::ExitCode",
"adt_def": 10,
"adt_def": 18,
"fields": [
9
],
Expand Down Expand Up @@ -3010,7 +3010,7 @@
{
"StructType": {
"name": "std::process::ExitCode",
"adt_def": 9,
"adt_def": 16,
"fields": [
15
],
Expand Down Expand Up @@ -3365,7 +3365,7 @@
}
],
[
32,
31,
{
"PtrType": {
"pointee_type": 9,
Expand Down Expand Up @@ -3398,7 +3398,7 @@
}
],
[
33,
32,
"VoidType"
]
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@
<types>
ty ( 1 ) |-> typeInfoTupleType ( .Tys )
ty ( 2 ) |-> typeInfoPrimitiveType ( primTypeInt ( intTyI8 ) )
ty ( 5 ) |-> typeInfoRefType ( ty ( 31 ) )
ty ( 5 ) |-> typeInfoRefType ( ty ( 30 ) )
ty ( 6 ) |-> typeInfoPrimitiveType ( primTypeInt ( intTyIsize ) )
ty ( 8 ) |-> typeInfoPtrType ( ty ( 32 ) )
ty ( 8 ) |-> typeInfoPtrType ( ty ( 31 ) )
ty ( 9 ) |-> typeInfoPrimitiveType ( primTypeUint ( uintTyU8 ) )
ty ( 10 ) |-> typeInfoEnumType ( "std::result::Result<isize, !>" , adtDef ( 16 ) , Discriminant ( 0 ) Discriminant ( 1 ) .Discriminants )
ty ( 10 ) |-> typeInfoEnumType ( "std::result::Result<isize, !>" , adtDef ( 13 ) , Discriminant ( 0 ) Discriminant ( 1 ) .Discriminants )
ty ( 11 ) |-> typeInfoRefType ( ty ( 12 ) )
ty ( 15 ) |-> typeInfoStructType ( "std::sys::pal::unix::process::process_common::ExitCode" , adtDef ( 10 ) , ty ( 9 ) .Tys )
ty ( 15 ) |-> typeInfoStructType ( "std::sys::pal::unix::process::process_common::ExitCode" , adtDef ( 18 ) , ty ( 9 ) .Tys )
ty ( 16 ) |-> typeInfoPrimitiveType ( primTypeInt ( intTyI32 ) )
ty ( 17 ) |-> typeInfoStructType ( "std::process::ExitCode" , adtDef ( 9 ) , ty ( 15 ) .Tys )
ty ( 17 ) |-> typeInfoStructType ( "std::process::ExitCode" , adtDef ( 16 ) , ty ( 15 ) .Tys )
ty ( 18 ) |-> typeInfoRefType ( ty ( 15 ) )
ty ( 22 ) |-> typeInfoPtrType ( ty ( 12 ) )
ty ( 24 ) |-> typeInfoRefType ( ty ( 12 ) )
Expand All @@ -97,12 +97,12 @@
ty ( 27 ) |-> typeInfoTupleType ( ty ( 9 ) ty ( 25 ) .Tys )
ty ( 28 ) |-> typeInfoTupleType ( ty ( 2 ) ty ( 25 ) .Tys )
ty ( 29 ) |-> typeInfoTupleType ( ty ( 26 ) ty ( 25 ) .Tys )
ty ( 32 ) |-> typeInfoPtrType ( ty ( 9 ) )
ty ( 33 ) |-> typeInfoVoidType
ty ( 31 ) |-> typeInfoPtrType ( ty ( 9 ) )
ty ( 32 ) |-> typeInfoVoidType
</types>
<adt-to-ty>
adtDef ( 9 ) |-> ty ( 17 )
adtDef ( 10 ) |-> ty ( 15 )
adtDef ( 16 ) |-> ty ( 10 )
adtDef ( 13 ) |-> ty ( 10 )
adtDef ( 16 ) |-> ty ( 17 )
adtDef ( 18 ) |-> ty ( 15 )
</adt-to-ty>
</kmir>
Original file line number Diff line number Diff line change
Expand Up @@ -2038,7 +2038,7 @@
{
"EnumType": {
"name": "std::result::Result<isize, !>",
"adt_def": 16,
"adt_def": 12,
"discriminants": [
0,
1
Expand Down Expand Up @@ -2128,7 +2128,7 @@
{
"StructType": {
"name": "std::sys::pal::unix::process::process_common::ExitCode",
"adt_def": 10,
"adt_def": 18,
"fields": [
9
],
Expand Down Expand Up @@ -2184,7 +2184,7 @@
{
"StructType": {
"name": "std::process::ExitCode",
"adt_def": 9,
"adt_def": 16,
"fields": [
15
],
Expand Down
12 changes: 6 additions & 6 deletions kmir/src/tests/integration/data/exec-smir/arithmetic/unary.state
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
ty ( 6 ) |-> typeInfoPrimitiveType ( primTypeInt ( intTyIsize ) )
ty ( 8 ) |-> typeInfoPtrType ( ty ( 28 ) )
ty ( 9 ) |-> typeInfoPrimitiveType ( primTypeUint ( uintTyU8 ) )
ty ( 10 ) |-> typeInfoEnumType ( "std::result::Result<isize, !>" , adtDef ( 16 ) , Discriminant ( 0 ) Discriminant ( 1 ) .Discriminants )
ty ( 10 ) |-> typeInfoEnumType ( "std::result::Result<isize, !>" , adtDef ( 12 ) , Discriminant ( 0 ) Discriminant ( 1 ) .Discriminants )
ty ( 11 ) |-> typeInfoRefType ( ty ( 12 ) )
ty ( 15 ) |-> typeInfoStructType ( "std::sys::pal::unix::process::process_common::ExitCode" , adtDef ( 10 ) , ty ( 9 ) .Tys )
ty ( 15 ) |-> typeInfoStructType ( "std::sys::pal::unix::process::process_common::ExitCode" , adtDef ( 18 ) , ty ( 9 ) .Tys )
ty ( 16 ) |-> typeInfoPrimitiveType ( primTypeInt ( intTyI32 ) )
ty ( 17 ) |-> typeInfoStructType ( "std::process::ExitCode" , adtDef ( 9 ) , ty ( 15 ) .Tys )
ty ( 17 ) |-> typeInfoStructType ( "std::process::ExitCode" , adtDef ( 16 ) , ty ( 15 ) .Tys )
ty ( 18 ) |-> typeInfoRefType ( ty ( 15 ) )
ty ( 22 ) |-> typeInfoPtrType ( ty ( 12 ) )
ty ( 24 ) |-> typeInfoRefType ( ty ( 12 ) )
Expand All @@ -72,8 +72,8 @@
ty ( 29 ) |-> typeInfoVoidType
</types>
<adt-to-ty>
adtDef ( 9 ) |-> ty ( 17 )
adtDef ( 10 ) |-> ty ( 15 )
adtDef ( 16 ) |-> ty ( 10 )
adtDef ( 12 ) |-> ty ( 10 )
adtDef ( 16 ) |-> ty ( 17 )
adtDef ( 18 ) |-> ty ( 15 )
</adt-to-ty>
</kmir>
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"name": "array_indexing",
"crate_id": 11673844854779303684,
"allocs": [
[
1,
{
{
"alloc_id": 1,
"ty": 28,
"global_alloc": {
"Memory": {
"bytes": [
97,
Expand Down Expand Up @@ -39,7 +40,7 @@
"mutability": "Not"
}
}
]
}
],
"functions": [
[
Expand Down Expand Up @@ -2221,7 +2222,7 @@
{
"EnumType": {
"name": "std::result::Result<isize, !>",
"adt_def": 17,
"adt_def": 22,
"discriminants": [
0,
1
Expand Down Expand Up @@ -2311,7 +2312,7 @@
{
"StructType": {
"name": "std::sys::pal::unix::process::process_common::ExitCode",
"adt_def": 11,
"adt_def": 9,
"fields": [
9
],
Expand Down Expand Up @@ -2367,7 +2368,7 @@
{
"StructType": {
"name": "std::process::ExitCode",
"adt_def": 10,
"adt_def": 7,
"fields": [
15
],
Expand Down Expand Up @@ -2696,7 +2697,7 @@
{
"StructType": {
"name": "std::panic::Location<'_>",
"adt_def": 8,
"adt_def": 13,
"fields": [
28,
35,
Expand Down
Loading