Allow null syntax nodes in fully-bound MLIR.Semantics classes to support synthetic semantic nodes#17
Merged
jonathanvdc merged 6 commits intomainfrom Mar 31, 2026
Conversation
…alue Agent-Logs-Url: https://github.com/jonathanvdc/MLIR.NET/sessions/1834ea25-3ce4-42c5-923b-4feca90152ad Co-authored-by: jonathanvdc <9839946+jonathanvdc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update MLIR.Semantics classes for null wrapped nodes
Allow null syntax nodes in fully-bound MLIR.Semantics classes to support synthetic semantic nodes
Mar 31, 2026
jonathanvdc
requested changes
Mar 31, 2026
Owner
jonathanvdc
left a comment
There was a problem hiding this comment.
Moving in the right direction. Some changes I'd like you to make:
- Replace the RawSyntaxText Syntax in AttributeValue with an AttributeValueSyntax.
- Split Block up into one constructor that grabs the label from the BlockSyntax and another constructor (for synthetic nodes) with a string label argument. Make BlockSyntax's Label property hold the data from either of those sources.
- Synthesize RegionSyntax/BlockSyntax in AssemblySyntaxBuilder if the Region/Block Syntax property is null.
…structors, remove null label fallback Agent-Logs-Url: https://github.com/jonathanvdc/MLIR.NET/sessions/1a5fa164-7732-4774-8ff6-f3625f3f0a17 Co-authored-by: jonathanvdc <9839946+jonathanvdc@users.noreply.github.com>
Contributor
Author
Done in 48bdd53:
|
jonathanvdc
requested changes
Mar 31, 2026
Owner
jonathanvdc
left a comment
There was a problem hiding this comment.
Making good progress. See comments. Also, can you make the token in BlockReference and ValueReference nullable while making their string Name properties non-nullable and data-holding? If these tokens are null, synthesize them in AssemblySyntaxBuilder.
src/MLIR/Semantics/Block.cs
Outdated
| /// <param name="label">The block label, including the leading <c>^</c>.</param> | ||
| /// <param name="arguments">The semantic block arguments.</param> | ||
| /// <param name="operations">The operations contained in the block.</param> | ||
| public Block(string label, IReadOnlyList<BlockArgument> arguments, IReadOnlyList<Operation> operations) |
Owner
There was a problem hiding this comment.
Can you take a BlockReference here instead of a string, make Label a computed property from LabelReference, and make LabelReference non-nullable?
src/MLIR/Semantics/Operation.cs
Outdated
| @@ -148,19 +148,28 @@ public NamedAttribute GetAttribute(string name) | |||
| /// </summary> | |||
| public GenericOperationBodySyntax GetGenericBody() | |||
Owner
There was a problem hiding this comment.
Can you move this to AssemblySyntaxBuilder?
Agent-Logs-Url: https://github.com/jonathanvdc/MLIR.NET/sessions/b8741ebf-34a1-45a3-b6cf-be3beee8e913 Co-authored-by: jonathanvdc <9839946+jonathanvdc@users.noreply.github.com>
Copilot stopped work on behalf of
jonathanvdc due to an error
March 31, 2026 01:08
…tax; enhance attribute building logic in AssemblySyntaxBuilder
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.
Uh oh!
There was an error while loading. Please reload this page.