Skip to content

fix(codegen): hoist inline local declarations#231

Closed
kabbersokhi-boop wants to merge 1 commit into
Syncleus:masterfrom
kabbersokhi-boop:fix/inline-local-declarations
Closed

fix(codegen): hoist inline local declarations#231
kabbersokhi-boop wants to merge 1 commit into
Syncleus:masterfrom
kabbersokhi-boop:fix/inline-local-declarations

Conversation

@kabbersokhi-boop

@kabbersokhi-boop kabbersokhi-boop commented Jun 24, 2026

Copy link
Copy Markdown

Summary

  • Hoist declarations for inline local assignments before the containing statement.
  • Allow method-call arguments like actuallyDoIt(z = 1) to generate valid OpenCL instead of throwing CodeGenException.
  • Update regressions for issue [Bounty $20] Inline declarations throw exception. #97 and a related first-assignment-in-expression case.

Tests

  • mvn -q -Dmaven.repo.local=/tmp/aparapi-tools/m2 -Dtest=AssignAndPassAsParameterSimpleTest test
  • mvn -q -Dmaven.repo.local=/tmp/aparapi-tools/m2 -Dtest=AssignAndPassAsParameterSimpleTest,FirstAssignInExpressionTest,AssignAndPassAsParameterTest,ConstantAssignInExpressionTest,MultipleAssignTest,MultipleAssignExprTest test

A broader com.aparapi.codegen.test.*Test run produced passing reports for executed codegen tests, but the local container eventually failed to start additional 2 GB Surefire forks. No assertion failures were observed.

ISSUES CLOSED: #97

Emit local variable declarations before statements when inline assignment expressions introduce a new local, allowing cases like methodCall(z = 1) to generate valid OpenCL.

ISSUES CLOSED: Syncleus#97
@kabbersokhi-boop

Copy link
Copy Markdown
Author

Closing this because I found earlier open PRs (#183, #211, #224) already covering issue #97. I do not want to add another duplicate review burden. Thanks.

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] Inline declarations throw exception.

1 participant