Skip to content

QBE: finish arrays #53

@YerinAlexey

Description

@YerinAlexey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions