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

Add mapping data structures #1118

Closed
1 task done
Tracked by #1376
kevaundray opened this issue Apr 7, 2023 · 2 comments
Closed
1 task done
Tracked by #1376

Add mapping data structures #1118

kevaundray opened this issue Apr 7, 2023 · 2 comments
Labels
enhancement New feature or request refactor ssa

Comments

@kevaundray
Copy link
Contributor

Problem

A common strategy that wil be present in our SSA module is:

pub struct Data;

pub struct DataId

Where data gets stored in some Arena/Map and the DataId is the reference to get the Data from the Arena/Map.

Proposed solution

Implement a common data structure to abstract away this information. Cranelift uses PrimaryMap and SecondaryMap.

Alternatives considered

No response

Additional context

No response

Submission Checklist

  • Once I hit submit, I will assign this issue to the Project Board with the appropriate tags.
@kevaundray kevaundray added enhancement New feature or request refactor ssa labels Apr 7, 2023
@kevaundray
Copy link
Contributor Author

kevaundray commented Apr 7, 2023

One can look at the Cranelift datastructures to figure out what the API should look like. An alternative is to use petgraph (or atleast we can use it initially)

@guipublic
Copy link
Contributor

For the record this is exactly the strategy we already have in the SSA module where data is stored in an Arena and referenced by its id being the index of the arena.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor ssa
Projects
Archived in project
Development

No branches or pull requests

2 participants