-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional getters and setters for operation and builder (#263)
Added additional getters and setters for `Operation` such that you can get operands, results and attributes, and modify attributes. Most of these new functions are not strictly necessary, but they can be more convenient than the existing functions. I'm using the `AttributeLike` trait such that any attribute-like type can be used. I wonder if we should also use this as generic return type for `Operation::attribute`? I also created a `OperationOperand` type, but currently it is simply and alias for `Value`. Should `OperationOperand` be a more complex type like `OperationResult`, or should I remove `OperationOperand` and replace all its occurences with `Value`? If I'm not mistaken, operands, results, successors and attributes can be borrowed by the builder, while ownership of regions is moved to MLIR (hence the call to `forget`). And one last thing: should I use `&str` instead of `impl AsRef<str>`, or is it fine like this? Please let me know if there's anything else I should change.
- Loading branch information
Showing
3 changed files
with
234 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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