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

Separate notions of expression constness and side-effectfulness #5

Open
SaladDais opened this issue Apr 5, 2022 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@SaladDais
Copy link
Owner

Right now a node returning a null ->get_constant_value() can mean that either a constant value for the node can't be determined, or that something in the expression might have side-effects.

Basically, we should be able to tell that a if ((non_const = 3) + 1) branch will always be taken because the expression will always result in 4, but that the expression can't be folded due to the side-effects of the assignment.

We should also be able to prune a declaration like string foo = non_const + "bar"; because even though we can't determine a constant value for the expression, we know that it doesn't have any side-effects.

@SaladDais SaladDais added the enhancement New feature or request label Apr 5, 2022
@SaladDais SaladDais self-assigned this Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant