Skip to content

Remove FunType from TypeInfo metadata #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 2 additions & 3 deletions src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,6 @@ pub enum TypeMetadata {
TupleType {
types: Vec<stable_mir::ty::Ty>,
},
FunType(String),
}

fn mk_type_metadata(
Expand Down Expand Up @@ -1032,8 +1031,8 @@ fn mk_type_metadata(
T(Ref(_, ty, _)) => Some((k, RefType(ty))),
// for tuples the element types are provided
T(Tuple(tys)) => Some((k, TupleType { types: tys })),
// opaque function types (fun ptrs, closures, FnDef) are only provided to avoid dangling ty references
T(FnDef(_, _)) | T(FnPtr(_)) | T(Closure(_, _)) => Some((k, FunType(format!("{}", k)))),
// opaque function types (fun ptrs, closures, FnDef) are not provided at the moment
T(FnDef(_, _)) | T(FnPtr(_)) | T(Closure(_, _)) => None,
// other types are not provided either
T(Foreign(_))
| T(Pat(_, _))
Expand Down
4 changes: 1 addition & 3 deletions tests/integration/normalise-filter.jq
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
( .types | map(select(.[0].TupleType) | .[0].TupleType.types = "elided") ),
# replace unstable Ty IDs for references by zero
( .types | map(select(.[0].PtrType) | .[0].PtrType = "elided") ),
( .types | map(select(.[0].RefType) | .[0].RefType = "elided") ),
# keep function type strings
( .types | map(select(.[0].FunType) | .[0].FunType = "elided") )
( .types | map(select(.[0].RefType) | .[0].RefType = "elided") )
] | flatten(1) )
}
80 changes: 0 additions & 80 deletions tests/integration/programs/assert_eq.smir.json.expected
Original file line number Diff line number Diff line change
Expand Up @@ -3348,86 +3348,6 @@
{
"RefType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
]
]
}
60 changes: 0 additions & 60 deletions tests/integration/programs/binop.smir.json.expected
Original file line number Diff line number Diff line change
Expand Up @@ -9860,66 +9860,6 @@
{
"RefType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
]
]
}
55 changes: 0 additions & 55 deletions tests/integration/programs/char-trivial.smir.json.expected
Original file line number Diff line number Diff line change
Expand Up @@ -1750,61 +1750,6 @@
{
"RefType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
]
]
}
70 changes: 0 additions & 70 deletions tests/integration/programs/closure-args.smir.json.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2060,76 +2060,6 @@
{
"RefType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
]
]
}
70 changes: 0 additions & 70 deletions tests/integration/programs/closure-no-args.smir.json.expected
Original file line number Diff line number Diff line change
Expand Up @@ -1868,76 +1868,6 @@
{
"RefType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
],
[
{
"FunType": "elided"
}
]
]
}
Loading