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

Separating label instructions? #147

Open
mhyee opened this issue Jun 3, 2017 · 0 comments
Open

Separating label instructions? #147

mhyee opened this issue Jun 3, 2017 · 0 comments

Comments

@mhyee
Copy link
Member

mhyee commented Jun 3, 2017

In #144, @gasche suggested separating the label instructions, to get something like

type merge_label = ML of raw_label
type branch_label = BL of raw_label

type instr =
| ...
| Merge_label of merge_label
| Branch_label of branch_label
| Goto of merge_label
| Branch of expr * branch_label * branch_label
| Osr of { label : merge_label; ... }
| ...

@o- notes:

I initially wanted to go this way. The reason I went with this version was that I wanted to keep the 1:1 mapping between our source language instruction and instruction type.

Update: also there are a number of places where you do not care about the kind of label and there it would introduce a lot of noise. I suspect you would need to extend about 20 pattern matches that currently just match | Label _.

Basically either one is fine. If you find two instructions much better I can also still change it.

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

1 participant