diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2019-01-28 17:04:11 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2019-01-28 17:04:11 +0000 |
commit | d58879f85687fa30cafb3d377bbf05a6929a8032 (patch) | |
tree | 4c55c7d08b2a88fae8da29dacc360518a94166d3 /include | |
parent | b43033c532d2cea761b9766ed4b47d7b7840693b (diff) | |
download | clang-d58879f85687fa30cafb3d377bbf05a6929a8032.tar.gz |
[clang][OpenMP] OMPFlushClause is synthetic, no such clause exists
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
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/OpenMPClause.h | 3 | ||||
-rw-r--r-- | include/clang/AST/RecursiveASTVisitor.h | 2 | ||||
-rw-r--r-- | include/clang/Basic/OpenMPKinds.def | 1 | ||||
-rw-r--r-- | include/clang/Basic/OpenMPKinds.h | 1 | ||||
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 1 | ||||
-rw-r--r-- | include/clang/Serialization/ASTWriter.h | 1 |
6 files changed, 8 insertions, 1 deletions
diff --git a/include/clang/AST/OpenMPClause.h b/include/clang/AST/OpenMPClause.h index 9099a86dcd..becb2a1706 100644 --- a/include/clang/AST/OpenMPClause.h +++ b/include/clang/AST/OpenMPClause.h @@ -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" }; diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 41892a0d7f..51050e80af 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -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: diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def index 9411c2971f..7fd28f0c45 100644 --- a/include/clang/Basic/OpenMPKinds.def +++ b/include/clang/Basic/OpenMPKinds.def @@ -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) diff --git a/include/clang/Basic/OpenMPKinds.h b/include/clang/Basic/OpenMPKinds.h index 7f572e599a..17e66a5314 100644 --- a/include/clang/Basic/OpenMPKinds.h +++ b/include/clang/Basic/OpenMPKinds.h @@ -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 diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 5b92b13722..798adeeade 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -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); diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index 32c02bddb5..2d12f6ae17 100644 --- a/include/clang/Serialization/ASTWriter.h +++ b/include/clang/Serialization/ASTWriter.h @@ -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); |