|
| 1 | +From 9780cc0e044c73dcd549c67a1278a4ff7daf3b01 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Marcin Naczk < [email protected]> |
| 3 | +Date: Fri, 4 Nov 2022 15:41:16 +0100 |
| 4 | +Subject: [PATCH] Remove wrong check of __opencl_c_images feature macro |
| 5 | + |
| 6 | +Deleted mechanism that wrongly assumes that |
| 7 | +all functions that use image types must be under |
| 8 | +__opencl_c_images feature macro |
| 9 | +Mechanism added by https://reviews.llvm.org/D103911 |
| 10 | +More info on github issue: |
| 11 | +https://github.com/llvm/llvm-project/issues/58017 |
| 12 | +--- |
| 13 | + clang/lib/Sema/SemaType.cpp | 8 +------- |
| 14 | + 1 file changed, 1 insertion(+), 7 deletions(-) |
| 15 | + |
| 16 | +diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp |
| 17 | +index ab47e9f03eaf..f72c2fb57ddd 100644 |
| 18 | +--- a/clang/lib/Sema/SemaType.cpp |
| 19 | ++++ b/clang/lib/Sema/SemaType.cpp |
| 20 | +@@ -1741,13 +1741,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { |
| 21 | + // __opencl_c_3d_image_writes feature. OpenCL C v3.0 API s4.2 - For devices |
| 22 | + // that support OpenCL 3.0, cl_khr_3d_image_writes must be returned when and |
| 23 | + // only when the optional feature is supported |
| 24 | +- if ((Result->isImageType() || Result->isSamplerT()) && |
| 25 | +- (IsOpenCLC30Compatible && |
| 26 | +- !OpenCLOptions.isSupported("__opencl_c_images", S.getLangOpts()))) { |
| 27 | +- S.Diag(DS.getTypeSpecTypeLoc(), diag::err_opencl_requires_extension) |
| 28 | +- << 0 << Result << "__opencl_c_images"; |
| 29 | +- declarator.setInvalidType(); |
| 30 | +- } else if (Result->isOCLImage3dWOType() && |
| 31 | ++ if (Result->isOCLImage3dWOType() && |
| 32 | + !OpenCLOptions.isSupported("cl_khr_3d_image_writes", |
| 33 | + S.getLangOpts())) { |
| 34 | + S.Diag(DS.getTypeSpecTypeLoc(), diag::err_opencl_requires_extension) |
| 35 | +-- |
| 36 | +2.33.0.windows.1 |
| 37 | + |
0 commit comments