[flang][openmp] Fix bug in `OmpClause::Hint` clause which was missing to generate...
authorsameeran joshi <sameeranjayant.joshi@amd.com>
Sat, 21 Nov 2020 10:21:29 +0000 (15:51 +0530)
committerSameeran joshi <joshisameeran17@gmail.com>
Sat, 21 Nov 2020 13:32:34 +0000 (19:02 +0530)
Before this patch "Hint" isn't found inside the generated file.
./bin/llvm-tblgen --gen-directive-gen ../llvm-project/llvm/include/llvm/Frontend/OpenMP/OMP.td -I ../llvm-project/llvm/include/ > OMP.cpp.in

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D91909

flang/lib/Parser/openmp-parsers.cpp
llvm/include/llvm/Frontend/OpenMP/OMP.td

index 5a7fd3d..8ad13df 100644 (file)
@@ -184,7 +184,8 @@ TYPE_PARSER(
                   parenthesized(Parser<OmpObjectList>{}))) ||
     "GRAINSIZE" >> construct<OmpClause>(construct<OmpClause::Grainsize>(
                        parenthesized(scalarIntExpr))) ||
-    "HINT" >> construct<OmpClause>(parenthesized(constantExpr)) ||
+    "HINT" >> construct<OmpClause>(
+                  construct<OmpClause::Hint>(parenthesized(constantExpr))) ||
     "IF" >> construct<OmpClause>(parenthesized(Parser<OmpIfClause>{})) ||
     "INBRANCH" >> construct<OmpClause>(construct<OmpClause::Inbranch>()) ||
     "IS_DEVICE_PTR" >> construct<OmpClause>(construct<OmpClause::IsDevicePtr>(
index 1ecf075..e735176 100644 (file)
@@ -200,7 +200,7 @@ def OMPC_NumTasks : Clause<"num_tasks"> {
 }
 def OMPC_Hint : Clause<"hint"> {
   let clangClass = "OMPHintClause";
-  let flangClass = "ConstantExpr";
+  let flangClassValue = "ConstantExpr";
 }
 def OMPC_DistSchedule : Clause<"dist_schedule"> {
   let clangClass = "OMPDistScheduleClause";