[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 15:39:37 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:
> > 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.
We have to convert it during sema already, actually during parsing. I'm working on declare variant begin/end support right now (part of TR8) which needs the information during parsing.


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