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

[refactor] Let build_xxx in ASTTransformer return node.ptr instead of node #3695

Merged
merged 8 commits into from
Dec 8, 2021

Conversation

lin-hitonami
Copy link
Contributor

@lin-hitonami lin-hitonami commented Dec 3, 2021

Related issue = #3694
This is a necessary refactoring to resolve #3694.
Since we do not modify the AST anymore after the refactoring, we do not need to assign the new node back to the old node in the AST. So, we can simplify the programming by returning node.ptr in build_xxx of expression nodes and None for build_xxx of statement nodes. In this way, many codes like a = build_stmt(ctx, b).ptr can be simplified to a = build_stmt(ctx, b).

ASTTransformerCheck will be removed in the near future, the modification to it is just a workaround to pass the tests of real functions with multiple returns.

@netlify
Copy link

netlify bot commented Dec 3, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: 0098bf4

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/61af133deabf9e00072f4c69

Copy link
Contributor

@strongoier strongoier left a comment

Choose a reason for hiding this comment

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

Would you merge with master branch? I think there must be something to resolve as #3709 is in now.

Copy link
Contributor

@strongoier strongoier left a comment

Choose a reason for hiding this comment

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

LGTM!

@strongoier strongoier merged commit 8ee315f into taichi-dev:master Dec 8, 2021
@lin-hitonami lin-hitonami deleted the build_ptr branch January 7, 2022 04:47
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.

Random value is returned when kernel return type is specified but no return statement is executed
2 participants