This feature requires support of __opencl_c_images, so diagnostics for that is provided as well
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
10114–10115 | Suggesting a slight rewording: | |
clang/lib/Basic/Targets.cpp | ||
746 | Maybe we should change this comment to something like: // Validate the feature dependencies for OpenCL C 3.0. Since it is not exactly about the macros. | |
752 | Maybe we should comment that the first element of the pair is the feature that depends on the feature in the second element? | |
757 | I guess we don't need the compound assignment here? |
Addressed latest review comments, also refactored the patch by putting diagnostics into OpenCLOptions
Fixed naming of new methods, fixed comments, removed redundant comments from source file
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
7412 | Are the parens right here? You probably want `!S.getLangOpts().OpenCLCPlusPlus && (Ver < 200 || (Ver == 300 && isSupported))` for the first term, but you have `!S.getLangOpts().OpenCLCPlusPlus && (Ver < 200) || (Ver == 300 && isSupported)` Which means the OpenCLCPlusPlus only matters for (Ver < 200) and the (Ver == 300 && ...) term makes things true independent of the OpenCLCPlusPlus check. If what you currently have is what you want: Remove the parens around (S.getLangOpts().OpenCLVersion < 200) and do instead parenthesize like so: (!S.getLangOpts().OpenCLCPlusPlus && Ver < 200). |
clang/lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
7412 | Thanks. I've submitted the patch: https://reviews.llvm.org/D105892. Please approve. |
Suggesting a slight rewording:
prior to OpenCL C version 2.0 or in version 3.0 without __opencl_c_read_write_images