[PATCH] D70973: [OPENMP50]Treat context selectors as expressions, not just strings.
Johannes Doerfert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 6 12:34:02 PST 2019
jdoerfert added inline comments.
================
Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1230
- "unknown '%0' device kind trait in the 'device' context selector set, expected"
- " one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'">;
----------------
ABataev wrote:
> jdoerfert wrote:
> > I would have expected this error to be still accurate, maybe with the addition ", or quoted versions thereof".
> Currently, we could emit it only in codegen phase to avoid double converting from expression to string. Will emit it there.
Why can't we emit this error if the user writes `device={kind(gggggpu)}` anymore? Even `device={kind("gggggpu")}` should be diagnosable early.
================
Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:424
+ if (ER.isUsable())
+ Values.push_back(ER);
}
----------------
ABataev wrote:
> jdoerfert wrote:
> > When would ER not be usable here? Is there a valid use case or should we assert it is?
> If the instantiation is failed, the error message is emitted and `ER` is set to `ExprError`, which is not usable.
Thx.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70973/new/
https://reviews.llvm.org/D70973
More information about the cfe-commits
mailing list