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

QBE: finish arrays #53

Open
YerinAlexey opened this issue Jul 1, 2021 · 0 comments
Open

QBE: finish arrays #53

YerinAlexey opened this issue Jul 1, 2021 · 0 comments
Labels
backend:qbe feature New feature or request

Comments

@YerinAlexey
Copy link
Collaborator

QBE backend already implements array initialization but can't do anything with created arrays. Array access and assignment need to be implemented.

Big issue with those is that there's no way to get array's type, which is needed to calculate offsets to elements.


A solution may be to store types together with temporaries, this way they are easy to retrieve and will help with type mismatches because now one can't use incorrect type in assign_instr.

enum QbeValue {
    Temporary(QbeType, String),
    // ...
}

Then it can be Display'd as %name but other functions will be able to access the type (for example as a key into array map). Such an array map can be a mapping of temporary -> element type and length.

@YerinAlexey YerinAlexey added feature New feature or request backend:qbe labels Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:qbe feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant