r214172 - [OPENMP] Additional comments for implicit 'flush' clause + removed unused parameter from method classof().

Alexey Bataev a.bataev at hotmail.com
Tue Jul 29 02:17:39 PDT 2014


Author: abataev
Date: Tue Jul 29 04:17:39 2014
New Revision: 214172

URL: http://llvm.org/viewvc/llvm-project?rev=214172&view=rev
Log:
[OPENMP] Additional comments for implicit 'flush' clause + removed unused parameter from method classof().

Modified:
    cfe/trunk/include/clang/AST/OpenMPClause.h
    cfe/trunk/lib/Basic/OpenMPKinds.cpp

Modified: cfe/trunk/include/clang/AST/OpenMPClause.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/OpenMPClause.h?rev=214172&r1=214171&r2=214172&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/OpenMPClause.h (original)
+++ cfe/trunk/include/clang/AST/OpenMPClause.h Tue Jul 29 04:17:39 2014
@@ -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
+

Modified: cfe/trunk/lib/Basic/OpenMPKinds.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/OpenMPKinds.cpp?rev=214172&r1=214171&r2=214172&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/OpenMPKinds.cpp (original)
+++ cfe/trunk/lib/Basic/OpenMPKinds.cpp Tue Jul 29 04:17:39 2014
@@ -46,6 +46,10 @@ const char *clang::getOpenMPDirectiveNam
 }
 
 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)





More information about the cfe-commits mailing list