[PATCH] D104040: [OpenCL] Add TableGen emitter for OpenCL builtin header

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 10 09:02:11 PDT 2021


svenvh created this revision.
svenvh added reviewers: azabaznov, Anastasia.
svenvh added a project: clang.
Herald added subscribers: ldrumm, yaxunl.
svenvh requested review of this revision.
Herald added a subscriber: cfe-commits.

Add an emitter to produce something similar to `opencl-c.h` from the
OpenCL builtin descriptions in `OpenCLBuiltins.td`

Factor out functionality that can be shared between the test emitter
and the header emitter into a new base class.

This only adds the emitter, without any use of it currently.

Example output excerpt (the full output is about 16k lines):

  ...
  __ovld __cnfn size_t get_global_id(uint);
  __ovld __cnfn size_t get_local_size(uint);
  __ovld __cnfn size_t get_local_id(uint);
  __ovld __cnfn size_t get_num_groups(uint);
  __ovld __cnfn size_t get_group_id(uint);
  __ovld __cnfn size_t get_global_offset(uint);
  #if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
  __ovld size_t get_enqueued_local_size(uint);
  #endif // MinVersion
  ...


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104040

Files:
  clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
  clang/utils/TableGen/TableGen.cpp
  clang/utils/TableGen/TableGenBackends.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104040.351190.patch
Type: text/x-patch
Size: 12445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210610/e00e8e93/attachment.bin>


More information about the cfe-commits mailing list