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: > > > > 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. > Hmmm, it is where we need to parse the code only if the context matches the > trait? Ok, will rework to convert it in sema too. Seems to me, we'll need to > match the context in both, codegen and sema. Will try to move the matcher > somewhere to avoid duplication in sema and codege. I put my patch up later tonight or tomorrow. It moves stuff around, we need to coordinate somehow. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70973/new/ https://reviews.llvm.org/D70973 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits