From d90e02095a818df94493f019f33c335e30bd5027 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 29 Jul 2014 09:17:39 +0000 Subject: [PATCH] [OPENMP] Additional comments for implicit 'flush' clause + removed unused parameter from method classof(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214172 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/OpenMPClause.h | 11 ++++++++--- lib/Basic/OpenMPKinds.cpp | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/clang/AST/OpenMPClause.h b/include/clang/AST/OpenMPClause.h index 5f05b449de..666a998036 100644 --- a/include/clang/AST/OpenMPClause.h +++ b/include/clang/AST/OpenMPClause.h @@ -61,7 +61,7 @@ public: ConstStmtRange children() const { return const_cast(this)->children(); } - static bool classof(const OMPClause *T) { return true; } + static bool classof(const OMPClause *) { return true; } }; /// \brief This represents clauses with the list of variables like 'private', @@ -1537,13 +1537,17 @@ public: } }; -/// \brief This represents pseudo clause 'flush' for the '#pragma omp flush' +/// \brief This represents implicit clause 'flush' for the '#pragma omp flush' /// directive. +/// This clause does not exist by itself, it can be only as a part of 'omp +/// flush' directive. This clause is introduced to keep the original structure +/// of \a OMPExecutableDirective class and its derivatives and to use the +/// existing infrastructure of clauses with the list of variables. /// /// \code /// #pragma omp flush(a,b) /// \endcode -/// In this example directive '#pragma omp flush' has pseudo clause 'flush' +/// In this example directive '#pragma omp flush' has implicit clause 'flush' /// with the variables 'a' and 'b'. /// class OMPFlushClause : public OMPVarListClause { @@ -1600,3 +1604,4 @@ public: } // end namespace clang #endif + diff --git a/lib/Basic/OpenMPKinds.cpp b/lib/Basic/OpenMPKinds.cpp index 7b277b477d..65f29598db 100644 --- a/lib/Basic/OpenMPKinds.cpp +++ b/lib/Basic/OpenMPKinds.cpp @@ -46,6 +46,10 @@ const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) { } OpenMPClauseKind clang::getOpenMPClauseKind(StringRef Str) { + // 'flush' clause cannot be specified explicitly, because this is an implicit + // clause for 'flush' directive. If the 'flush' clause is explicitly specified + // the Parser should generate a warning about extra tokens at the end of the + // directive. if (Str == "flush") return OMPC_unknown; return llvm::StringSwitch(Str) -- 2.40.0