-
Notifications
You must be signed in to change notification settings - Fork 39
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
compiler: introduce an IR for the code generators #551
Commits on Feb 20, 2023
-
Configuration menu - View commit details
-
Copy full SHA for a8279ad - Browse repository at this point
Copy the full SHA a8279adView commit details -
vm: separate argument processing from
opcExpandToAst
The operation now expects its operands to be `NimNode`s already. A new instruction (`opcDataToAst`) is introduced for creating the AST representation of VM data. While also simplifying the VM a bit, the main reason behind the change is to not having to provide the full AST of the template call expression, as doing so is not possible when the code generator no longer operates on `PNode` AST.
Configuration menu - View commit details
-
Copy full SHA for 5394c32 - Browse repository at this point
Copy the full SHA 5394c32View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3059da1 - Browse repository at this point
Copy the full SHA 3059da1View commit details
Commits on Aug 3, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 90a7a08 - Browse repository at this point
Copy the full SHA 90a7a08View commit details -
Configuration menu - View commit details
-
Copy full SHA for 792f2d3 - Browse repository at this point
Copy the full SHA 792f2d3View commit details -
ccgexprs: remove node flag usage
The `nfAllFieldsSet` flag stopped reaching the code generator with the introduction of the MIR, meaning that the condition always evaluates to 'true'.
Configuration menu - View commit details
-
Copy full SHA for 007098d - Browse repository at this point
Copy the full SHA 007098dView commit details -
canonicalize the main procedure's body
The C and JS code-gen orchestrators were passing the AST produced for the main procedure directly to the code generators. This is no longer going to work once the code generators don't work with `PNode` anymore, so `canonicalize` is now used on the AST.
Configuration menu - View commit details
-
Copy full SHA for e35e7f6 - Browse repository at this point
Copy the full SHA e35e7f6View commit details -
vmaux: decouple
findMatchingBranch
fromPNode
Instead of an integer-literal node, the procedure now accepts the value directly.
Configuration menu - View commit details
-
Copy full SHA for 603b51e - Browse repository at this point
Copy the full SHA 603b51eView commit details -
`astgen` is adjusted to produce `CgNode` instead of `PNode`. For this, multiple `PNode` -> `CgNode` translation procedures had to be introduced and `canUseView` + `flattenExpr` duplicated and adjusted for `CgNode`. The general processing logic stays the same. The module's document comment is also adjusted and an outdated mention of "sections" (they are called "regions" in the MIR) fixed. `astgen` as the name doesn't make much sense anymore and is going to be changed to something more fitting.
Configuration menu - View commit details
-
Copy full SHA for 158b76e - Browse repository at this point
Copy the full SHA 158b76eView commit details -
`canonicalize` and `generateAST` now return `CgNode` trees. For debug rendering, a `treeRepr` procedure for `CgNode` is added to the `cgirutils` module.
Configuration menu - View commit details
-
Copy full SHA for eb3099a - Browse repository at this point
Copy the full SHA eb3099aView commit details -
vmgen: decouple the emit procedures from
PNode
The instruction-emission procedure now accept a `TLineInfo` as input directly, instead of, unnecessarily, requiring a `PNode`. Wrappers that still use `PNode` are added for convenience.
Configuration menu - View commit details
-
Copy full SHA for 8e301b2 - Browse repository at this point
Copy the full SHA 8e301b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d36474 - Browse repository at this point
Copy the full SHA 1d36474View commit details -
All three code generators now use the `CgNode` IR. The changes to the modules are kept minimal in order to make review easier. As an additional way to keep the amount of changes smaller, the `compat` module is introduced.
Configuration menu - View commit details
-
Copy full SHA for 7f36d1a - Browse repository at this point
Copy the full SHA 7f36d1aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 756d2ab - Browse repository at this point
Copy the full SHA 756d2abView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8499b48 - Browse repository at this point
Copy the full SHA 8499b48View commit details -
Configuration menu - View commit details
-
Copy full SHA for 941b3f7 - Browse repository at this point
Copy the full SHA 941b3f7View commit details -
In addition, the module is moved to the `backend` directory.
Configuration menu - View commit details
-
Copy full SHA for 4565463 - Browse repository at this point
Copy the full SHA 4565463View commit details
Commits on Aug 4, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 1e950cd - Browse repository at this point
Copy the full SHA 1e950cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b7139e - Browse repository at this point
Copy the full SHA 3b7139eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1092b3f - Browse repository at this point
Copy the full SHA 1092b3fView commit details -
docs: update mentions of
astgen
The module is named `cgirgen` now. `debug.rst` also contained outdated mentions of `PNode` being the IR the code generators -- this is fixed too.
Configuration menu - View commit details
-
Copy full SHA for 6775403 - Browse repository at this point
Copy the full SHA 6775403View commit details