[PATCH] D70973: [OPENMP50]Treat context selectors as expressions, not just strings.

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 12:43:28 PST 2019


ABataev marked an inline comment as done.
ABataev 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'">;
 
----------------
jdoerfert wrote:
> 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.
The main problem here is the conversion and expression evaluation. We convert the data from the expression to strings at the codegen phase. I don't want to do the same thing for the second time in Sema just for diagnostic.


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