Skip to content

Fix local declarations in chained assignments#222

Open
junn-dev wants to merge 1 commit into
Syncleus:masterfrom
junn-dev:codex/hoist-expression-local-declarations
Open

Fix local declarations in chained assignments#222
junn-dev wants to merge 1 commit into
Syncleus:masterfrom
junn-dev:codex/hoist-expression-local-declarations

Conversation

@junn-dev
Copy link
Copy Markdown

Fixes #99.

This hoists local variables that are first declared inside inline or chained assignment expressions before emitting the expression. That prevents invalid generated OpenCL such as declaring a local in the middle of result = assignMe = value, and avoids redeclaring the same local in nested branches after the hoist.

Verification:

  • mvn -Dstyle.color=never -Dtest=com.aparapi.codegen.test.FirstAssignInExpression2Test test with JDK 8 and MAVEN_OPTS='-Djline.terminal=jline.UnsupportedTerminal -Dscala.color=false -Dscala.usejavacp=true'

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.

[Bounty $20] Two inline assignments in the same statement produce incorrect opencl code.

1 participant