[PATCH] D109315: [clang] Check unsupported types in expressions
Mariya Podchishchaeva via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 6 06:39:28 PDT 2021
Fznamznon added a comment.
No objections, just a couple of minors.
================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10687
def err_device_unsupported_type
- : Error<"%0 requires %select{|%2 bit size}1 %3 type support, but device "
- "'%4' does not support it">;
+ : Error<"%select{|%1 bit size}0 %2 type is not supported for target '%3'">;
def err_omp_lambda_capture_in_declare_target_not_to : Error<
----------------
Maybe it is just me, but the old version was a bit more clear since it pointed to the wrong declaration. Now looking at the tests I see that clang ends up emitting several identical diagnostics at the same line, but they point to the different declarations/expressions used on this line. Should we still mention which concrete declaration/expression the diagnostic is about?
================
Comment at: clang/include/clang/Sema/Sema.h:12154
- /// Check if the expression is allowed to be used in expressions for the
- /// offloading devices.
- void checkDeviceDecl(ValueDecl *D, SourceLocation Loc);
+ /// Check if the type is allowed to be used for this target.
+ void checkTypeSupport(QualType Ty, SourceLocation Loc,
----------------
Having that in single source offloading programming models usually two targets are used, "current target" sounds a bit more clear.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109315/new/
https://reviews.llvm.org/D109315
More information about the cfe-commits
mailing list