Skip to content
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

Problems with JSON output #28

Open
dkcumming opened this issue Jan 17, 2025 · 1 comment
Open

Problems with JSON output #28

dkcumming opened this issue Jan 17, 2025 · 1 comment
Assignees

Comments

@dkcumming
Copy link
Collaborator

On commit 0a14cc9 of smir_pretty there are two problems we need to resolve with the output:

  1. ty as id with entry for that id anywhere. We need to find what "16" connects to by looking at the code in printer.rs and the serialisation code that is upstreamed into rust (it is all just #[derive(serde)]):
                            "locals": [
                                {
                                    "mutability": "Mut",
                                    "span": 26,
                                    "ty": 16
                                },
  1. Functions in the "functions" array that share the same name have a different id that in "items", should they be the same?

See

sum-to-n.smir.json

@gtrepta
Copy link

gtrepta commented Jan 23, 2025

In a dbg! dump of the visited_tys in emit_smir_internal reveals lots of information. Some looks relevant to the type ids:

Ty {
    id: 16,
    kind: RigidTy(
        Int(
            I32,
        ),
    ),
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants