Skip to content

Fix OpenCL keyword identifier escaping#207

Open
alexgduarte wants to merge 3 commits into
Syncleus:masterfrom
alexgduarte:fix-opencl-keyword-identifiers
Open

Fix OpenCL keyword identifier escaping#207
alexgduarte wants to merge 3 commits into
Syncleus:masterfrom
alexgduarte:fix-opencl-keyword-identifiers

Conversation

@alexgduarte
Copy link
Copy Markdown

Fixes #54

Summary

  • mangle Java identifiers that collide with OpenCL reserved words before emitting OpenCL
  • apply the same escaping to fields, locals, method parameters, and generated array helper names
  • add a regression test covering field, parameter, and local identifiers named after OpenCL keywords

Testing

  • Compiled main sources with javac 25 using -source 8 -target 8 against Maven-fetched dependencies
  • Ran org.junit.runner.JUnitCore com.aparapi.codegen.test.OpenCLKeywordIdentifierTest
  • Ran org.junit.runner.JUnitCore com.aparapi.codegen.test.PostIncLocalTest

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 $25] OpenCL keywords are not escaped during code generation

1 participant