aparapi icon indicating copy to clipboard operation
aparapi copied to clipboard

Mangle OpenCL reserved Java identifiers

Open OnlyYu1996 opened this issue 6 months ago • 0 comments

Fixes #54.

This updates OpenCL code generation so Java identifiers that are legal Java names but reserved in OpenCL are emitted with a deterministic __javaReserved suffix instead of being written verbatim.

Covered paths include:

  • instance fields and generated This struct members
  • kernel arguments and field assignment glue
  • method arguments
  • local variable declarations, loads, increments, and inline/multi assignment references

Validation run locally on Windows with JDK 8 and Maven 3.6.3:

  • mvn -q -Dstyle.color=never -Dtest=OpenCLKeywordIdentifiersTest,AccessIntArrayTest,ByteParamsSimpleTest,AssignAndPassAsParameterTest,ObjectArrayMemberAccessTest test
  • mvn -q -Dstyle.color=never -DskipTests test-compile
  • mvn -q -Dstyle.color=never -Dtest=com.aparapi.codegen.test.*Test test
  • git diff --check

OnlyYu1996 avatar May 16 '26 19:05 OnlyYu1996