8000 [OM] Add Python support for Objects in Fields. by mikeurbach · Pull Request #5276 · llvm/circt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[OM] Add Python support for Objects in Fields. #5276

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

Merged
merged 2 commits into from
May 30, 2023

Conversation

mikeurbach
Copy link
Contributor

This adds support for Objects in the Fields of other Objects. This is handled in the pure Python layer of the Evaluator API, which is enhanced to support recursively instantiating Objects. The functionality for creating a dataclass instance from an instantiated Object is factored out into a new helper. In the case an Object field is itself an Object, the new helper is called recursively with the child dataclass and the child Object.

A simple integration test for this behavior is added.

This uncovered undefined behavior in the previous use of shared pointers, so this patch depends on PR #5275.

@mikeurbach mikeurbach requested review from prithayan and uenoku May 26, 2023 04:47
This adds support for Objects in the Fields of other Objects. This is
handled in the pure Python layer of the Evaluator API, which is
enhanced to support recursively instantiating Objects. The
functionality for creating a dataclass instance from an instantiated
Object is factored out into a new helper. In the case an Object field
is itself an Object, the new helper is called recursively with the
child dataclass and the child Object.

A simple integration test for this behavior is added.

This uncovered undefined behavior in the previous use of shared
pointers, so this patch depends on PR #5275.
@mikeurbach mikeurbach force-pushed the mikeurbach/om-dialect-python-object-field branch from 4445484 to d4c0ce7 Compare May 26, 2023 04:51
Copy link
Member
@uenoku uenoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mikeurbach mikeurbach merged commit 39e5a07 into main May 30, 2023
@mikeurbach mikeurbach deleted the mikeurbach/om-dialect-python-object-field branch May 30, 2023 17:11
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

Successfully merging this pull request may close these issues.

2 participants
0