make the IL Call grammar more regular - #159
Draft
zerbina wants to merge 5 commits into
Draft
Conversation
There's now no longer a distinction made between static and dynamic calls at the grammar level: both start with a type reference. The `ProcVal` vs. `Proc` distinction no longer provides any value, so `ProcVal` is removed, with `Proc` taking over its meaning.
Transformations and processing relying on the old shapes, or using `ProcVal`, are updated.
The hand-written code is not adjusted just yet.
* `ProcVal` usage is replaced with `Proc` * call translation is changed to always emit the callee type operand * `compilerProc` is replaced with `emitCompilerProcCallee`, which emits both the type and proc value
All static calls are changed to include the type node -- nothing else is changed. For the VM tests, local variables are now required for testing indirect calls.
Collaborator
Author
|
The hand-written I'm waiting with the update, until the |
Collaborator
Author
|
I'm leaving this PR open for now, but it's effectively dead. As part of the transition to using a proper nanopass framework (#179), the IL(s) will become a lot more regular in general (as that makes the passes easier to implement), and there's not really a point in refactoring code that is obsolete and (most likely) won't see much further usage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Always have a type operand before the callee for every call syntax, no
longer making a grammatical distinction between static and dynamic
calls.
ProcValis removed.Details
Call,CheckedCall, andCheckedCallAsgnnow always have a calleetype operand now, with the motivation being that:
for static calls (not just for dynamic calls)
Since the proc reference (
Proc) vs. procedure value (ProcVal)distinction is not useful anymore, the latter syntax is removed, with
Proctaking over its meaning.The passes,
skully, andsource2ilare adjusted to the aforementionedchanges. Tests using static calls (and their expected output) are
also updated to adhere to the new grammar.
For the VM code generator, tests for indirect calls now have to use
local variables as the callee, as using the
Procdirectly now alwaysyields a static call.
To-Do
L30code insource2ilNotes For Reviewers
ProcDeffirst