<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">Hi Aaron,</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
This warning is due to 'omp simd' had no allowed clauses in the first patch.</div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">I hope to fix this soon by adding clauses (I will send first clause for review tomorrow or early next week).</span><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-27 18:44 GMT+04:00 Alexander Musman <span dir="ltr"><<a href="mailto:alexander.musman@gmail.com" target="_blank">alexander.musman@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Aaron,</div><div><br></div><div>This warning is due to 'omp simd' had no allowed clauses in the first patch.</div>
I hope to fix this soon by adding clauses (I will send first clause for review tomorrow or early next week).<div>
<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-27 18:21 GMT+04:00 Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span>:<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Thu, Feb 27, 2014 at 3:29 AM, Alexey Bataev <<a href="mailto:a.bataev@hotmail.com" target="_blank">a.bataev@hotmail.com</a>> wrote:<br>


> Author: abataev<br>
> Date: Thu Feb 27 02:29:12 2014<br>
> New Revision: 202360<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=202360&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=202360&view=rev</a><br>
> Log:<br>
> [OPENMP] First changes for Parsing and Sema for 'omp simd' directive support<br>
><br>
> Added:<br>
>     cfe/trunk/test/OpenMP/simd_ast_print.cpp   (with props)<br>
>     cfe/trunk/test/OpenMP/simd_misc_messages.c   (with props)<br>
> Modified:<br>
>     cfe/trunk/include/clang-c/Index.h<br>
>     cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h<br>
>     cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>
>     cfe/trunk/include/clang/AST/StmtOpenMP.h<br>
>     cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
>     cfe/trunk/include/clang/Basic/OpenMPKinds.def<br>
>     cfe/trunk/include/clang/Basic/StmtNodes.td<br>
>     cfe/trunk/include/clang/Sema/Sema.h<br>
>     cfe/trunk/include/clang/Serialization/ASTBitCodes.h<br>
>     cfe/trunk/lib/AST/Stmt.cpp<br>
>     cfe/trunk/lib/AST/StmtPrinter.cpp<br>
>     cfe/trunk/lib/AST/StmtProfile.cpp<br>
>     cfe/trunk/lib/Basic/OpenMPKinds.cpp<br>
>     cfe/trunk/lib/CodeGen/CGStmt.cpp<br>
>     cfe/trunk/lib/Parse/ParseOpenMP.cpp<br>
>     cfe/trunk/lib/Sema/SemaOpenMP.cpp<br>
>     cfe/trunk/lib/Sema/TreeTransform.h<br>
>     cfe/trunk/lib/Serialization/ASTReaderStmt.cpp<br>
>     cfe/trunk/lib/Serialization/ASTWriterStmt.cpp<br>
>     cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp<br>
>     cfe/trunk/tools/libclang/CIndex.cpp<br>
>     cfe/trunk/tools/libclang/CXCursor.cpp<br>
><br>
> Modified: cfe/trunk/include/clang-c/Index.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang-c/Index.h (original)<br>
> +++ cfe/trunk/include/clang-c/Index.h Thu Feb 27 02:29:12 2014<br>
> @@ -2135,7 +2135,11 @@ enum CXCursorKind {<br>
>     */<br>
>    CXCursor_OMPParallelDirective          = 232,<br>
><br>
> -  CXCursor_LastStmt                      = CXCursor_OMPParallelDirective,<br>
> +  /** \brief OpenMP simd directive.<br>
> +   */<br>
> +  CXCursor_OMPSimdDirective              = 233,<br>
> +<br>
> +  CXCursor_LastStmt                      = CXCursor_OMPSimdDirective,<br>
><br>
>    /**<br>
>     * \brief Cursor that represents the translation unit itself.<br>
><br>
> Modified: cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h (original)<br>
> +++ cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h Thu Feb 27 02:29:12 2014<br>
> @@ -424,6 +424,7 @@ private:<br>
>    bool TraverseFunctionHelper(FunctionDecl *D);<br>
>    bool TraverseVarHelper(VarDecl *D);<br>
>    bool TraverseOMPClause(OMPClause *C);<br>
> +  bool TraverseOMPExecutableDirective(OMPExecutableDirective *S);<br>
>  #define OPENMP_CLAUSE(Name, Class)                                      \<br>
>    bool Visit##Class(Class *C);<br>
>  #include "clang/Basic/OpenMPKinds.def"<br>
> @@ -2331,11 +2332,22 @@ DEF_TRAVERSE_STMT(ObjCDictionaryLiteral,<br>
>  DEF_TRAVERSE_STMT(AsTypeExpr, { })<br>
><br>
>  // OpenMP directives.<br>
> -DEF_TRAVERSE_STMT(OMPParallelDirective, {<br>
> +template<typename Derived><br>
> +bool DataRecursiveASTVisitor<Derived>::TraverseOMPExecutableDirective(<br>
> +                                               OMPExecutableDirective *S) {<br>
>    ArrayRef<OMPClause *> Clauses = S->clauses();<br>
>    for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();<br>
>         I != E; ++I)<br>
>      if (!TraverseOMPClause(*I)) return false;<br>
> +  return true;<br>
> +}<br>
> +<br>
> +DEF_TRAVERSE_STMT(OMPParallelDirective, {<br>
> +  if (!TraverseOMPExecutableDirective(S)) return false;<br>
> +})<br>
> +<br>
> +DEF_TRAVERSE_STMT(OMPSimdDirective, {<br>
> +  if (!TraverseOMPExecutableDirective(S)) return false;<br>
>  })<br>
><br>
>  // OpenMP clauses.<br>
><br>
> Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)<br>
> +++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Thu Feb 27 02:29:12 2014<br>
> @@ -441,6 +441,7 @@ private:<br>
>    bool TraverseFunctionHelper(FunctionDecl *D);<br>
>    bool TraverseVarHelper(VarDecl *D);<br>
>    bool TraverseOMPClause(OMPClause *C);<br>
> +  bool TraverseOMPExecutableDirective(OMPExecutableDirective *S);<br>
>  #define OPENMP_CLAUSE(Name, Class)                                      \<br>
>    bool Visit##Class(Class *C);<br>
>  #include "clang/Basic/OpenMPKinds.def"<br>
> @@ -2355,11 +2356,22 @@ DEF_TRAVERSE_STMT(ObjCDictionaryLiteral,<br>
>  DEF_TRAVERSE_STMT(AsTypeExpr, { })<br>
><br>
>  // OpenMP directives.<br>
> -DEF_TRAVERSE_STMT(OMPParallelDirective, {<br>
> +template<typename Derived><br>
> +bool RecursiveASTVisitor<Derived>::TraverseOMPExecutableDirective(<br>
> +                                           OMPExecutableDirective *S) {<br>
>    ArrayRef<OMPClause *> Clauses = S->clauses();<br>
>    for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();<br>
>         I != E; ++I)<br>
>      if (!TraverseOMPClause(*I)) return false;<br>
> +  return true;<br>
> +}<br>
> +<br>
> +DEF_TRAVERSE_STMT(OMPParallelDirective, {<br>
> +  if (!TraverseOMPExecutableDirective(S)) return false;<br>
> +})<br>
> +<br>
> +DEF_TRAVERSE_STMT(OMPSimdDirective, {<br>
> +  if (!TraverseOMPExecutableDirective(S)) return false;<br>
>  })<br>
><br>
>  // OpenMP clauses.<br>
><br>
> Modified: cfe/trunk/include/clang/AST/StmtOpenMP.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtOpenMP.h?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtOpenMP.h?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang/AST/StmtOpenMP.h (original)<br>
> +++ cfe/trunk/include/clang/AST/StmtOpenMP.h Thu Feb 27 02:29:12 2014<br>
> @@ -140,17 +140,18 @@ class OMPParallelDirective : public OMPE<br>
>    /// \param EndLoc Ending Location of the directive.<br>
>    ///<br>
>    OMPParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc,<br>
> -                       unsigned N)<br>
> +                       unsigned NumClauses)<br>
>        : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,<br>
> -                               StartLoc, EndLoc, N, 1) {}<br>
> +                               StartLoc, EndLoc, NumClauses, 1) {}<br>
><br>
>    /// \brief Build an empty directive.<br>
>    ///<br>
> -  /// \param N Number of clauses.<br>
> +  /// \param NumClauses Number of clauses.<br>
>    ///<br>
> -  explicit OMPParallelDirective(unsigned N)<br>
> +  explicit OMPParallelDirective(unsigned NumClauses)<br>
>        : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,<br>
> -                               SourceLocation(), SourceLocation(), N, 1) {}<br>
> +                               SourceLocation(), SourceLocation(),<br>
> +                               NumClauses, 1) {}<br>
><br>
>  public:<br>
>    /// \brief Creates directive with a list of \a Clauses.<br>
> @@ -168,9 +169,10 @@ public:<br>
>    /// \brief Creates an empty directive with the place for \a N clauses.<br>
>    ///<br>
>    /// \param C AST context.<br>
> -  /// \param N The number of clauses.<br>
> +  /// \param NumClauses Number of clauses.<br>
>    ///<br>
> -  static OMPParallelDirective *CreateEmpty(const ASTContext &C, unsigned N,<br>
> +  static OMPParallelDirective *CreateEmpty(const ASTContext &C,<br>
> +                                           unsigned NumClauses,<br>
>                                             EmptyShell);<br>
><br>
>    static bool classof(const Stmt *T) {<br>
> @@ -178,6 +180,76 @@ public:<br>
>    }<br>
>  };<br>
><br>
> +/// \brief This represents '#pragma omp simd' directive.<br>
> +///<br>
> +/// \code<br>
> +/// #pragma omp simd private(a,b) linear(i,j:s) reduction(+:c,d)<br>
> +/// \endcode<br>
> +/// In this example directive '#pragma omp simd' has clauses 'private'<br>
> +/// with the variables 'a' and 'b', 'linear' with variables 'i', 'j' and<br>
> +/// linear step 's', 'reduction' with operator '+' and variables 'c' and 'd'.<br>
> +///<br>
> +class OMPSimdDirective : public OMPExecutableDirective {<br>
> +  friend class ASTStmtReader;<br>
> +  /// \brief Number of collapsed loops as specified by 'collapse' clause.<br>
> +  unsigned CollapsedNum;<br>
> +  /// \brief Build directive with the given start and end location.<br>
> +  ///<br>
> +  /// \param StartLoc Starting location of the directive kind.<br>
> +  /// \param EndLoc Ending location of the directive.<br>
> +  /// \param CollapsedNum Number of collapsed nested loops.<br>
> +  /// \param NumClauses Number of clauses.<br>
> +  ///<br>
> +  OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,<br>
> +                  unsigned CollapsedNum, unsigned NumClauses)<br>
> +    : OMPExecutableDirective(this, OMPSimdDirectiveClass, OMPD_simd,<br>
> +                             StartLoc, EndLoc, NumClauses, 1),<br>
> +      CollapsedNum(CollapsedNum) { }<br>
> +<br>
> +  /// \brief Build an empty directive.<br>
> +  ///<br>
> +  /// \param CollapsedNum Number of collapsed nested loops.<br>
> +  /// \param NumClauses Number of clauses.<br>
> +  ///<br>
> +  explicit OMPSimdDirective(unsigned CollapsedNum, unsigned NumClauses)<br>
> +    : OMPExecutableDirective(this, OMPSimdDirectiveClass, OMPD_simd,<br>
> +                             SourceLocation(), SourceLocation(),<br>
> +                             NumClauses, 1),<br>
> +                             CollapsedNum(CollapsedNum) { }<br>
> +public:<br>
> +  /// \brief Creates directive with a list of \a Clauses.<br>
> +  ///<br>
> +  /// \param C AST context.<br>
> +  /// \param StartLoc Starting location of the directive kind.<br>
> +  /// \param EndLoc Ending Location of the directive.<br>
> +  /// \param Clauses List of clauses.<br>
> +  /// \param AssociatedStmt Statement, associated with the directive.<br>
> +  ///<br>
> +  static OMPSimdDirective *Create(const ASTContext &C,<br>
> +                                  SourceLocation StartLoc,<br>
> +                                  SourceLocation EndLoc,<br>
> +                                  ArrayRef<OMPClause *> Clauses,<br>
> +                                  Stmt *AssociatedStmt);<br>
> +<br>
> +  /// \brief Creates an empty directive with the place<br>
> +  /// for \a NumClauses clauses.<br>
> +  ///<br>
> +  /// \param C AST context.<br>
> +  /// \param CollapsedNum Number of collapsed nested loops.<br>
> +  /// \param NumClauses Number of clauses.<br>
> +  ///<br>
> +  static OMPSimdDirective *CreateEmpty(const ASTContext &C,<br>
> +                                       unsigned NumClauses,<br>
> +                                       unsigned CollapsedNum,<br>
> +                                       EmptyShell);<br>
> +<br>
> +  unsigned getCollapsedNumber() const { return CollapsedNum; }<br>
> +<br>
> +  static bool classof(const Stmt *T) {<br>
> +    return T->getStmtClass() == OMPSimdDirectiveClass;<br>
> +  }<br>
> +};<br>
> +<br>
>  } // end namespace clang<br>
><br>
>  #endif<br>
><br>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br>
> +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Feb 27 02:29:12 2014<br>
> @@ -6835,24 +6835,26 @@ def err_omp_private_incomplete_type : Er<br>
>    "a private variable with incomplete type %0">;<br>
>  def err_omp_firstprivate_incomplete_type : Error<<br>
>    "a firstprivate variable with incomplete type %0">;<br>
> -def err_omp_unexpected_clause_value : Error <<br>
> +def err_omp_unexpected_clause_value : Error<<br>
>    "expected %0 in OpenMP clause '%1'">;<br>
> -def err_omp_expected_var_name : Error <<br>
> +def err_omp_expected_var_name : Error<<br>
>    "expected variable name">;<br>
> -def err_omp_required_method : Error <<br>
> +def err_omp_required_method : Error<<br>
>    "%0 variable must have an accessible, unambiguous %select{default constructor|copy constructor|copy assignment operator|'%2'|destructor}1">;<br>
>  def err_omp_clause_ref_type_arg : Error<<br>
>    "arguments of OpenMP clause '%0' cannot be of reference type %1">;<br>
>  def err_omp_threadprivate_incomplete_type : Error<<br>
>    "threadprivate variable with incomplete type %0">;<br>
> -def err_omp_no_dsa_for_variable : Error <<br>
> +def err_omp_no_dsa_for_variable : Error<<br>
>    "variable %0 must have explicitly specified data sharing attributes">;<br>
>  def err_omp_wrong_dsa : Error<<br>
>    "%0 variable cannot be %1">;<br>
> -def note_omp_explicit_dsa : Note <<br>
> +def note_omp_explicit_dsa : Note<<br>
>    "defined as %0">;<br>
> -def note_omp_predetermined_dsa : Note <<br>
> +def note_omp_predetermined_dsa : Note<<br>
>    "predetermined as %0">;<br>
> +def err_omp_not_for : Error<<br>
> +  "statement after '#pragma omp %0' must be a for loop">;<br>
>  } // end of OpenMP category<br>
><br>
>  let CategoryName = "Related Result Type Issue" in {<br>
><br>
> Modified: cfe/trunk/include/clang/Basic/OpenMPKinds.def<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.def?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.def?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang/Basic/OpenMPKinds.def (original)<br>
> +++ cfe/trunk/include/clang/Basic/OpenMPKinds.def Thu Feb 27 02:29:12 2014<br>
> @@ -21,6 +21,9 @@<br>
>  #ifndef OPENMP_PARALLEL_CLAUSE<br>
>  #  define OPENMP_PARALLEL_CLAUSE(Name)<br>
>  #endif<br>
> +#ifndef OPENMP_SIMD_CLAUSE<br>
> +#  define OPENMP_SIMD_CLAUSE(Name)<br>
> +#endif<br>
>  #ifndef OPENMP_DEFAULT_KIND<br>
>  #  define OPENMP_DEFAULT_KIND(Name)<br>
>  #endif<br>
> @@ -29,6 +32,7 @@<br>
>  OPENMP_DIRECTIVE(threadprivate)<br>
>  OPENMP_DIRECTIVE(parallel)<br>
>  OPENMP_DIRECTIVE(task)<br>
> +OPENMP_DIRECTIVE(simd)<br>
><br>
>  // OpenMP clauses.<br>
>  OPENMP_CLAUSE(if, OMPIfClause)<br>
> @@ -44,6 +48,8 @@ OPENMP_PARALLEL_CLAUSE(private)<br>
>  OPENMP_PARALLEL_CLAUSE(firstprivate)<br>
>  OPENMP_PARALLEL_CLAUSE(shared)<br>
><br>
> +// FIXME: clauses allowed for directive 'omp simd'.<br>
> +<br>
>  // Static attributes for 'default' clause.<br>
>  OPENMP_DEFAULT_KIND(none)<br>
>  OPENMP_DEFAULT_KIND(shared)<br>
> @@ -52,3 +58,5 @@ OPENMP_DEFAULT_KIND(shared)<br>
>  #undef OPENMP_DIRECTIVE<br>
>  #undef OPENMP_CLAUSE<br>
>  #undef OPENMP_PARALLEL_CLAUSE<br>
> +#undef OPENMP_SIMD_CLAUSE<br>
> +<br>
><br>
> Modified: cfe/trunk/include/clang/Basic/StmtNodes.td<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/StmtNodes.td?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/StmtNodes.td?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang/Basic/StmtNodes.td (original)<br>
> +++ cfe/trunk/include/clang/Basic/StmtNodes.td Thu Feb 27 02:29:12 2014<br>
> @@ -178,3 +178,4 @@ def AsTypeExpr : DStmt<Expr>;<br>
>  // OpenMP Directives.<br>
>  def OMPExecutableDirective : Stmt<1>;<br>
>  def OMPParallelDirective : DStmt<OMPExecutableDirective>;<br>
> +def OMPSimdDirective : DStmt<OMPExecutableDirective>;<br>
><br>
> Modified: cfe/trunk/include/clang/Sema/Sema.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang/Sema/Sema.h (original)<br>
> +++ cfe/trunk/include/clang/Sema/Sema.h Thu Feb 27 02:29:12 2014<br>
> @@ -7111,6 +7111,12 @@ public:<br>
>                                            Stmt *AStmt,<br>
>                                            SourceLocation StartLoc,<br>
>                                            SourceLocation EndLoc);<br>
> +  /// \brief Called on well-formed '\#pragma omp simd' after parsing<br>
> +  /// of the associated statement.<br>
> +  StmtResult ActOnOpenMPSimdDirective(ArrayRef<OMPClause *> Clauses,<br>
> +                                      Stmt *AStmt,<br>
> +                                      SourceLocation StartLoc,<br>
> +                                      SourceLocation EndLoc);<br>
><br>
>    OMPClause *ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind,<br>
>                                           Expr *Expr,<br>
><br>
> Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original)<br>
> +++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Thu Feb 27 02:29:12 2014<br>
> @@ -1333,6 +1333,7 @@ namespace clang {<br>
><br>
>        // OpenMP drectives<br>
>        STMT_OMP_PARALLEL_DIRECTIVE,<br>
> +      STMT_OMP_SIMD_DIRECTIVE,<br>
><br>
>        // ARC<br>
>        EXPR_OBJC_BRIDGED_CAST,     // ObjCBridgedCastExpr<br>
><br>
> Modified: cfe/trunk/lib/AST/Stmt.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/lib/AST/Stmt.cpp (original)<br>
> +++ cfe/trunk/lib/AST/Stmt.cpp Thu Feb 27 02:29:12 2014<br>
> @@ -1217,10 +1217,39 @@ OMPParallelDirective *OMPParallelDirecti<br>
>  }<br>
><br>
>  OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,<br>
> -                                                        unsigned N,<br>
> +                                                        unsigned NumClauses,<br>
>                                                          EmptyShell) {<br>
>    unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPParallelDirective),<br>
>                                             llvm::alignOf<OMPClause *>());<br>
> -  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * N + sizeof(Stmt *));<br>
> -  return new (Mem) OMPParallelDirective(N);<br>
> +  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +<br>
> +                         sizeof(Stmt *));<br>
> +  return new (Mem) OMPParallelDirective(NumClauses);<br>
>  }<br>
> +<br>
> +OMPSimdDirective *OMPSimdDirective::Create(const ASTContext &C,<br>
> +                                           SourceLocation StartLoc,<br>
> +                                           SourceLocation EndLoc,<br>
> +                                           ArrayRef<OMPClause *> Clauses,<br>
> +                                           Stmt *AssociatedStmt) {<br>
> +  unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPSimdDirective),<br>
> +                                           llvm::alignOf<OMPClause *>());<br>
> +  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +<br>
> +                         sizeof(Stmt *));<br>
> +  OMPSimdDirective *Dir = new (Mem) OMPSimdDirective(StartLoc, EndLoc,<br>
> +                                                     1, Clauses.size());<br>
> +  Dir->setClauses(Clauses);<br>
> +  Dir->setAssociatedStmt(AssociatedStmt);<br>
> +  return Dir;<br>
> +}<br>
> +<br>
> +OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C,<br>
> +                                                unsigned NumClauses,<br>
> +                                                unsigned CollapsedNum,<br>
> +                                                EmptyShell) {<br>
> +  unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPSimdDirective),<br>
> +                                           llvm::alignOf<OMPClause *>());<br>
> +  void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +<br>
> +                         sizeof(Stmt *));<br>
> +  return new (Mem) OMPSimdDirective(CollapsedNum, NumClauses);<br>
> +}<br>
> +<br>
><br>
> Modified: cfe/trunk/lib/AST/StmtPrinter.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/lib/AST/StmtPrinter.cpp (original)<br>
> +++ cfe/trunk/lib/AST/StmtPrinter.cpp Thu Feb 27 02:29:12 2014<br>
> @@ -70,6 +70,7 @@ namespace  {<br>
>      void PrintCallArgs(CallExpr *E);<br>
>      void PrintRawSEHExceptHandler(SEHExceptStmt *S);<br>
>      void PrintRawSEHFinallyStmt(SEHFinallyStmt *S);<br>
> +    void PrintOMPExecutableDirective(OMPExecutableDirective *S);<br>
><br>
>      void PrintExpr(Expr *E) {<br>
>        if (E)<br>
> @@ -89,7 +90,7 @@ namespace  {<br>
>            return;<br>
>        else StmtVisitor<StmtPrinter>::Visit(S);<br>
>      }<br>
> -<br>
> +<br>
>      void VisitStmt(Stmt *Node) LLVM_ATTRIBUTE_UNUSED {<br>
>        Indent() << "<<unknown stmt type>>\n";<br>
>      }<br>
> @@ -656,11 +657,9 @@ void OMPClausePrinter::VisitOMPSharedCla<br>
>  //  OpenMP directives printing methods<br>
>  //===----------------------------------------------------------------------===//<br>
><br>
> -void StmtPrinter::VisitOMPParallelDirective(OMPParallelDirective *Node) {<br>
> -  Indent() << "#pragma omp parallel ";<br>
> -<br>
> +void StmtPrinter::PrintOMPExecutableDirective(OMPExecutableDirective *S) {<br>
>    OMPClausePrinter Printer(OS, Policy);<br>
> -  ArrayRef<OMPClause *> Clauses = Node->clauses();<br>
> +  ArrayRef<OMPClause *> Clauses = S->clauses();<br>
>    for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();<br>
>         I != E; ++I)<br>
>      if (*I && !(*I)->isImplicit()) {<br>
> @@ -668,13 +667,24 @@ void StmtPrinter::VisitOMPParallelDirect<br>
>        OS << ' ';<br>
>      }<br>
>    OS << "\n";<br>
> -  if (Node->getAssociatedStmt()) {<br>
> -    assert(isa<CapturedStmt>(Node->getAssociatedStmt()) &&<br>
> +  if (S->getAssociatedStmt()) {<br>
> +    assert(isa<CapturedStmt>(S->getAssociatedStmt()) &&<br>
>             "Expected captured statement!");<br>
> -    Stmt *CS = cast<CapturedStmt>(Node->getAssociatedStmt())->getCapturedStmt();<br>
> +    Stmt *CS = cast<CapturedStmt>(S->getAssociatedStmt())->getCapturedStmt();<br>
>      PrintStmt(CS);<br>
>    }<br>
>  }<br>
> +<br>
> +void StmtPrinter::VisitOMPParallelDirective(OMPParallelDirective *Node) {<br>
> +  Indent() << "#pragma omp parallel ";<br>
> +  PrintOMPExecutableDirective(Node);<br>
> +}<br>
> +<br>
> +void StmtPrinter::VisitOMPSimdDirective(OMPSimdDirective *Node) {<br>
> +  Indent() << "#pragma omp simd ";<br>
> +  PrintOMPExecutableDirective(Node);<br>
> +}<br>
> +<br>
>  //===----------------------------------------------------------------------===//<br>
>  //  Expr printing methods.<br>
>  //===----------------------------------------------------------------------===//<br>
><br>
> Modified: cfe/trunk/lib/AST/StmtProfile.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/lib/AST/StmtProfile.cpp (original)<br>
> +++ cfe/trunk/lib/AST/StmtProfile.cpp Thu Feb 27 02:29:12 2014<br>
> @@ -293,7 +293,7 @@ void OMPClauseProfiler::VisitOMPSharedCl<br>
>  }<br>
><br>
>  void<br>
> -StmtProfiler::VisitOMPParallelDirective(const OMPParallelDirective *S) {<br>
> +StmtProfiler::VisitOMPExecutableDirective(const OMPExecutableDirective *S) {<br>
>    VisitStmt(S);<br>
>    OMPClauseProfiler P(this);<br>
>    ArrayRef<OMPClause *> Clauses = S->clauses();<br>
> @@ -303,6 +303,14 @@ StmtProfiler::VisitOMPParallelDirective(<br>
>        P.Visit(*I);<br>
>  }<br>
><br>
> +void StmtProfiler::VisitOMPParallelDirective(const OMPParallelDirective *S) {<br>
> +  VisitOMPExecutableDirective(S);<br>
> +}<br>
> +<br>
> +void StmtProfiler::VisitOMPSimdDirective(const OMPSimdDirective *S) {<br>
> +  VisitOMPExecutableDirective(S);<br>
> +}<br>
> +<br>
>  void StmtProfiler::VisitExpr(const Expr *S) {<br>
>    VisitStmt(S);<br>
>  }<br>
><br>
> Modified: cfe/trunk/lib/Basic/OpenMPKinds.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/OpenMPKinds.cpp?rev=202360&r1=202359&r2=202360&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/OpenMPKinds.cpp?rev=202360&r1=202359&r2=202360&view=diff</a><br>


> ==============================================================================<br>
> --- cfe/trunk/lib/Basic/OpenMPKinds.cpp (original)<br>
> +++ cfe/trunk/lib/Basic/OpenMPKinds.cpp Thu Feb 27 02:29:12 2014<br>
> @@ -125,6 +125,15 @@ bool clang::isAllowedClauseForDirective(<br>
>        break;<br>
>      }<br>
>      break;<br>
> +  case OMPD_simd:<br>
> +    switch (CKind) {<br>
> +#define OPENMP_SIMD_CLAUSE(Name) \<br>
> +    case OMPC_##Name: return true;<br>
> +#include "clang/Basic/OpenMPKinds.def"<br>
> +    default:<br>
> +      break;<br>
<br>
</div></div>This is causing a warning for me in MSVC:<br>
<br>
Warning 1 warning C4065: switch statement contains 'default' but no<br>
'case' labels E:\llvm\llvm\tools\clang\lib\Basic\OpenMPKinds.cpp 135<br>
<br>
Will this switch statement gain content in the near future, or is this<br>
something we can remove for the time being?<br>
<span><font color="#888888"><br>
~Aaron<br>
</font></span><div><div>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div></div></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Best regards,<br>Alexander Musman<br><a href="tel:%2B79154687051" value="+79154687051" target="_blank">+79154687051</a><br>
skype: alexander.musman<br><div><br></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Best regards,<br>Alexander Musman<br>+79154687051<br>skype: alexander.musman<br><div><br></div>
</div>