aparapi
aparapi copied to clipboard
Fix inline local declarations in assignment expressions
Fixes #97. Fixes #99.
This teaches the OpenCL writer to hoist local declarations that appear inside inline assignment expressions to the start of the current block. The original inline assignment expression is then emitted as a normal assignment, avoiding invalid OpenCL such as result = int assignMe = value and avoiding the previous CodeGenException for declarations in argument expressions.
The scan deliberately skips for-header and arbitrary-scope composites so existing scoped declarations keep their current output shape.
Validation:
mvn -q -Dstyle.color=never -Dtest=AssignAndPassAsParameterSimpleTest,FirstAssignInExpression2Test,AssignAndPassAsParameterTest,FirstAssignInExpressionTest testmvn -q -Dstyle.color=never -Dtest=com.aparapi.codegen.test.*Test testmvn -q -Dstyle.color=never -DskipTests test-compilegit diff --check