[PATCH] D74387: [SYCL] Defer __float128 type usage diagnostics
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 27 12:36:12 PDT 2020
rjmccall added inline comments.
================
Comment at: clang/include/clang/Sema/Sema.h:12248
+ /// SYCLDiagIfDeviceCode(Loc, diag::err_type_unsupported) << "__float128";
+ DeviceDiagBuilder SYCLDiagIfDeviceCode(SourceLocation Loc, unsigned DiagID);
+
----------------
Will this collect notes associated with the diagnostic correctly?
================
Comment at: clang/lib/Sema/SemaAvailability.cpp:479
+ case UnavailableAttr::IR_SYCLForbiddenType:
+ diag_available_here = diag::err_type_unsupported;
+ break;
----------------
All of the other cases are setting this to a note, not an error, so I suspect this will read wrong.
================
Comment at: clang/lib/Sema/SemaAvailability.cpp:534
+ if (S.getLangOpts().SYCLIsDevice)
+ S.SYCLDiagIfDeviceCode(Loc, diag) << ReferringDecl;
+ else
----------------
Are you sure you want to be applying this to all of the possible diagnostics here, rather than just for SYCLForbiddenType unavailable attributes?
================
Comment at: clang/lib/Sema/SemaDecl.cpp:18030
+ if (LangOpts.SYCLIsDevice && FD->hasAttr<SYCLKernelAttr>())
+ return FunctionEmissionStatus::Emitted;
+
----------------
So you want to emit it for the definition in addition to emitting it for specific specializations?
================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:7771
+ return true;
+ }
+
----------------
I wonder if it's reasonable to treat all forbidden types the same here or if we want different functions for the ARC and SYCL use cases.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74387/new/
https://reviews.llvm.org/D74387
More information about the cfe-commits
mailing list