Skip to content
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

Define helpers to inline IR objects from one component to another #371

Open
rachitnigam opened this issue Oct 18, 2023 · 0 comments
Open
Assignees
Labels
C: Internals Component: Compiler internals S: available This is available to be worked on

Comments

@rachitnigam
Copy link
Member

This is a problem that showed up when attempting #264 in #345: We need the ability to take a bunch of IR objects like expressions from one component and define the same ASTs into another component. The problem is that the leaf of these components are parameters which need to renamed to something that the new component understands.

This is something ir::Subst can almost do but it only allows you to do it in the same component. We need to define some methods on it to allow Subst and rewrite into another component. The approach is simple: copy the code from ir::Subst and define from_comp and to_comp to rewrite values from one component into another. Use the provided ir::Bind to remap the leaves.

@rachitnigam rachitnigam added C: Internals Component: Compiler internals S: available This is available to be worked on labels Oct 18, 2023
@UnsignedByte UnsignedByte self-assigned this Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Internals Component: Compiler internals S: available This is available to be worked on
Projects
None yet
Development

No branches or pull requests

2 participants