diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/AST/OpenMPClause.h | 11 | ||||
| -rw-r--r-- | clang/lib/Basic/OpenMPKinds.cpp | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index 5f05b449deb..666a9980368 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -61,7 +61,7 @@ public: ConstStmtRange children() const { return const_cast<OMPClause *>(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<OMPFlushClause> { @@ -1600,3 +1604,4 @@ public: } // end namespace clang #endif + diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp index 7b277b477d5..65f29598db3 100644 --- a/clang/lib/Basic/OpenMPKinds.cpp +++ b/clang/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<OpenMPClauseKind>(Str) |

