]> granicus.if.org Git - clang/commitdiff
[clang][OpenMP] OMPFlushClause is synthetic, no such clause exists
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 28 Jan 2019 17:04:11 +0000 (17:04 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 28 Jan 2019 17:04:11 +0000 (17:04 +0000)
Summary:
As discussed in https://reviews.llvm.org/D57112#inline-506781,
'flush' clause does not exist in the OpenMP spec, it can not be
specified, and `OMPFlushClause` class is just a helper class.

Therefore `OPENMP_CLAUSE()` in `clang/Basic/OpenMPKinds.def`
should not contain 'flush' "clause".

I have simply removed the `OPENMP_CLAUSE(flush, OMPFlushClause)`
from `clang/Basic/OpenMPKinds.def`, grepped for `OPENMP_CLAUSE`
and added `OPENMP_CLAUSE(flush, OMPFlushClause)` back to the **every**
place where `OPENMP_CLAUSE` is defined and `clang/Basic/OpenMPKinds.def`
is then included.

So as-is, this patch is a NFC. Possibly, some of these
`OPENMP_CLAUSE(flush, OMPFlushClause)` should be dropped,
i don't really know.

Test plan: `ninja check-clang`

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: guansong, arphaman, cfe-commits

Tags: #openmp

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352390 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/OpenMPClause.h
include/clang/AST/RecursiveASTVisitor.h
include/clang/Basic/OpenMPKinds.def
include/clang/Basic/OpenMPKinds.h
include/clang/Serialization/ASTReader.h
include/clang/Serialization/ASTWriter.h
lib/AST/OpenMPClause.cpp
lib/AST/StmtProfile.cpp
lib/Basic/OpenMPKinds.cpp
lib/Sema/TreeTransform.h
tools/libclang/CIndex.cpp

index 9099a86dcdebaaa4c2ec92229f8f2ed673191b88..becb2a17066b2b2884b04c5b3a3104eced2387da 100644 (file)
@@ -5318,6 +5318,7 @@ public:
 
 #define OPENMP_CLAUSE(Name, Class)                              \
   RetTy Visit ## Class (PTR(Class) S) { DISPATCH(Class); }
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
 
   RetTy Visit(PTR(OMPClause) S) {
@@ -5326,6 +5327,7 @@ public:
     default: llvm_unreachable("Unknown clause kind!");
 #define OPENMP_CLAUSE(Name, Class)                              \
     case OMPC_ ## Name : return Visit ## Class(static_cast<PTR(Class)>(S));
+    OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
     }
   }
@@ -5357,6 +5359,7 @@ public:
       : OS(OS), Policy(Policy) {}
 
 #define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *S);
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
 };
 
index 41892a0d7fd7440f796015cccbefc49058cd4621..51050e80af2ac3828d25af22d74c1176a3466232 100644 (file)
@@ -529,6 +529,7 @@ private:
   bool TraverseOMPLoopDirective(OMPLoopDirective *S);
   bool TraverseOMPClause(OMPClause *C);
 #define OPENMP_CLAUSE(Name, Class) bool Visit##Class(Class *C);
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
   /// Process clauses with list of variables.
   template <typename T> bool VisitOMPClauseList(T *Node);
@@ -2788,6 +2789,7 @@ bool RecursiveASTVisitor<Derived>::TraverseOMPClause(OMPClause *C) {
   case OMPC_##Name:                                                            \
     TRY_TO(Visit##Class(static_cast<Class *>(C)));                             \
     break;
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
   case OMPC_threadprivate:
   case OMPC_uniform:
index 9411c2971fc9bb4ca01fca08894dbe5875b0f3e6..7fd28f0c4565b16405b841006b8bc5a7d84aa05f 100644 (file)
@@ -258,7 +258,6 @@ OPENMP_CLAUSE(ordered, OMPOrderedClause)
 OPENMP_CLAUSE(nowait, OMPNowaitClause)
 OPENMP_CLAUSE(untied, OMPUntiedClause)
 OPENMP_CLAUSE(mergeable, OMPMergeableClause)
-OPENMP_CLAUSE(flush, OMPFlushClause)
 OPENMP_CLAUSE(read, OMPReadClause)
 OPENMP_CLAUSE(write, OMPWriteClause)
 OPENMP_CLAUSE(update, OMPUpdateClause)
index 7f572e599a76e228e4da6b361f2c9cac9197ebbb..17e66a5314f042135b13cec0df6092aa1cc88236 100644 (file)
@@ -33,6 +33,7 @@ enum OpenMPClauseKind {
 #define OPENMP_CLAUSE(Name, Class) \
   OMPC_##Name,
 #include "clang/Basic/OpenMPKinds.def"
+  OMPC_flush,
   OMPC_threadprivate,
   OMPC_uniform,
   OMPC_unknown
index 5b92b13722435745c373572fb13fe6dbcf5e51ea..798adeeadecce1bc7717c825da9a74d3d4500311 100644 (file)
@@ -2686,6 +2686,7 @@ public:
       : Record(Record), Context(Record.getContext()) {}
 
 #define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *C);
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
   OMPClause *readClause();
   void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C);
index 32c02bddb5358382b3ce9dc93e6863b74ad94a71..2d12f6ae1743ec24fd513640ca79b7278180623f 100644 (file)
@@ -999,6 +999,7 @@ class OMPClauseWriter : public OMPClauseVisitor<OMPClauseWriter> {
 public:
   OMPClauseWriter(ASTRecordWriter &Record) : Record(Record) {}
 #define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *S);
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
   void writeClause(OMPClause *C);
   void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C);
index e87ae3e158c7a4512b1d7c7a4ae9688586ed3a59..1640995cea028e1f0ce302c559de0c56ca9c16e7 100644 (file)
@@ -30,6 +30,7 @@ OMPClause::child_range OMPClause::children() {
 #define OPENMP_CLAUSE(Name, Class)                                             \
   case OMPC_##Name:                                                            \
     return static_cast<Class *>(this)->children();
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
   }
   llvm_unreachable("unknown OMPClause");
index c064ea90a260b382941badb3d13a7d206ea42b3b..e302b05882192db56602e1fb3274dc656d4d515d 100644 (file)
@@ -412,6 +412,7 @@ public:
   OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { }
 #define OPENMP_CLAUSE(Name, Class)                                             \
   void Visit##Class(const Class *C);
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
   void VistOMPClauseWithPreInit(const OMPClauseWithPreInit *C);
   void VistOMPClauseWithPostUpdate(const OMPClauseWithPostUpdate *C);
index c89c96f82d1b4abde12f7578e4b48419299786aa..c42151700634ea378acdc504af5cd014b6bc0984 100644 (file)
@@ -67,6 +67,8 @@ const char *clang::getOpenMPClauseName(OpenMPClauseKind Kind) {
   case OMPC_##Name:                                                            \
     return #Name;
 #include "clang/Basic/OpenMPKinds.def"
+  case OMPC_flush:
+    return "flush";
   case OMPC_uniform:
     return "uniform";
   case OMPC_threadprivate:
index 2e434a3c0e38bbc4c878264991117e09cefbc233..e411a2ad47c916d1c9d3800c2705c3a401ba762b 100644 (file)
@@ -681,6 +681,7 @@ public:
 #define OPENMP_CLAUSE(Name, Class)                        \
   LLVM_ATTRIBUTE_NOINLINE \
   OMPClause *Transform ## Class(Class *S);
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
 
   /// Build a new qualified type given its unqualified type and type location.
@@ -3311,6 +3312,7 @@ OMPClause *TreeTransform<Derived>::TransformOMPClause(OMPClause *S) {
 #define OPENMP_CLAUSE(Name, Class)                                             \
   case OMPC_ ## Name :                                                         \
     return getDerived().Transform ## Class(cast<Class>(S));
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
   }
 
index f4782c2774a53c7c24b3fd5aac89c2a1ac63d2ef..08aa6ed1eeb483ed7733b430858cea1992a07d7d 100644 (file)
@@ -2130,6 +2130,7 @@ public:
   OMPClauseEnqueue(EnqueueVisitor *Visitor) : Visitor(Visitor) { }
 #define OPENMP_CLAUSE(Name, Class)                                             \
   void Visit##Class(const Class *C);
+  OPENMP_CLAUSE(flush, OMPFlushClause)
 #include "clang/Basic/OpenMPKinds.def"
   void VisitOMPClauseWithPreInit(const OMPClauseWithPreInit *C);
   void VisitOMPClauseWithPostUpdate(const OMPClauseWithPostUpdate *C);