[PATCH] D93576: [openacc] Use TableGen enum for default clause value

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 07:10:14 PST 2020


kiranchandramohan added inline comments.


================
Comment at: llvm/include/llvm/Frontend/OpenACC/ACC.td:84
+def ACC_Default_none : ClauseVal<"none", 1, 0> { let isDefault = 1; }
+def ACC_Default_present : ClauseVal<"present", 0, 0> {}
+
----------------
clementval wrote:
> sameeranjoshi wrote:
> > Trying to understand - 
> > `class ClauseVal<string n, int v, bit uv>` mentions second parameter (`i.e v`)as value of clause.
> > 
> > Is there are reason to start the numbering from `0`?
> > In `OMP.td` as well I see they always start with index `2`, any defined pattern used here?
> > 
> The enum in `OMP.td` starts at 2 to follow the one already defined for Clang here: `llvm/include/llvm/Frontend/OpenMP/OMPKinds.def` In the long term the `OMPKinds.def` file is supposed to go away gradually. 
> 
> This is my guess but @kiranchandramohan can confirm since he introduced those change for OpenMP. 
What @clementval says and also The standard sometimes defines values for the clauses which are constants. For e.g. for proc_bind.
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93576/new/

https://reviews.llvm.org/D93576



More information about the llvm-commits mailing list