OpenCL keywords 'pipe' and 'generic' are unconditionally
supported for OpenCL C 2.0 or in OpenCL C++ mode. In OpenCL C 3.0
these keywords are available if corresponding optional core
feature is supported.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM, but perhaps you can add a test that has each keyword disabled?
FYI we currently already test that pipe and generic are valid for OpenCL 2.0 and invalid for OpenCL < 2.0. Or do you mean different kind of tests? In OpenCL 3.0 we will have to set the new LangOpts fields based on the values of OpenCLOptions but my guess is that is going to be added in the subsequent patches...
clang/include/clang/Basic/LangOptions.def | ||
---|---|---|
218 | Normally we use just a name of the feature, so perhaps: OpenCLGenericKeyword -> OpenCLGenericAddressSpace |
Yes, I believe there are tests already for earlier versions. Should I mark this change as NFC?
clang/include/clang/Basic/LangOptions.def | ||
---|---|---|
218 | Ok, will change. |
Actually the existing tests should cover this indeed. I was thinking of tests for the OpenCL 3 case, but that is probably something for a future patch.
I am not sure since we are adding a new LangOpts entries it's not entirely NFC. I would just live as is.
Normally we use just a name of the feature, so perhaps:
OpenCLGenericKeyword -> OpenCLGenericAddressSpace
OpenCLPipeKeyword -> OpenCLPipe