From f343a494807eaba4cdc0470ad40719699dc752f3 Mon Sep 17 00:00:00 2001
From: Alexey Bataev <a.bataev@hotmail.com>
Date: Thu, 6 Mar 2014 12:27:56 +0000
Subject: [PATCH] [OPENMP] Updated comments and _OPENMP macro value for OpenMP
 4.0 (for 'omp simd' support)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203114 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Frontend/InitPreprocessor.cpp | 4 ++--
 lib/Sema/SemaOpenMP.cpp           | 7 ++++---
 lib/Sema/TreeTransform.h          | 4 ++++
 test/OpenMP/predefined_macro.c    | 4 ++--
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
index 1112b55d86b..ca51297bb28 100644
--- a/lib/Frontend/InitPreprocessor.cpp
+++ b/lib/Frontend/InitPreprocessor.cpp
@@ -720,12 +720,12 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
 
   // OpenMP definition
   if (LangOpts.OpenMP) {
-    // OpenMP 2.2: 
+    // OpenMP 2.2:
     //   In implementations that support a preprocessor, the _OPENMP
     //   macro name is defined to have the decimal value yyyymm where
     //   yyyy and mm are the year and the month designations of the
     //   version of the OpenMP API that the implementation support.
-    Builder.defineMacro("_OPENMP", "201107");
+    Builder.defineMacro("_OPENMP", "201307");
   }
 
   // Get other target #defines.
diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp
index a377815ffaf..b99b639ac27 100644
--- a/lib/Sema/SemaOpenMP.cpp
+++ b/lib/Sema/SemaOpenMP.cpp
@@ -1286,9 +1286,10 @@ OMPClause *Sema::ActOnOpenMPSharedClause(ArrayRef<Expr *> VarList,
     SourceLocation ELoc = (*I)->getExprLoc();
     // OpenMP [2.1, C/C++]
     //  A list item is a variable name.
-    // OpenMP  [2.9.3.4, Restrictions, p.1]
-    //  A variable that is part of another variable (as an array or
-    //  structure element) cannot appear in a private clause.
+    // OpenMP  [2.14.3.2, Restrictions, p.1]
+    //  A variable that is part of another variable (as an array or structure
+    //  element) cannot appear in a shared unless it is a static data member
+    //  of a C++ class.
     DeclRefExpr *DE = dyn_cast<DeclRefExpr>(*I);
     if (!DE || !isa<VarDecl>(DE->getDecl())) {
       Diag(ELoc, diag::err_omp_expected_var_name)
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index ac5a678eeb1..272bf2deff0 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -1361,6 +1361,10 @@ public:
                                                    EndLoc);
   }
 
+  /// \brief Build a new OpenMP 'shared' clause.
+  ///
+  /// By default, performs semantic analysis to build the new statement.
+  /// Subclasses may override this routine to provide different behavior.
   OMPClause *RebuildOMPSharedClause(ArrayRef<Expr *> VarList,
                                     SourceLocation StartLoc,
                                     SourceLocation LParenLoc,
diff --git a/test/OpenMP/predefined_macro.c b/test/OpenMP/predefined_macro.c
index 06f98793fb9..c9829ce4572 100644
--- a/test/OpenMP/predefined_macro.c
+++ b/test/OpenMP/predefined_macro.c
@@ -5,7 +5,7 @@
 // -fopenmp=libiomp5 option is specified
 #ifndef _OPENMP
 #error "No _OPENMP macro is defined with -fopenmp option"
-#elsif _OPENMP != 201107
+#elsif _OPENMP != 201307
 #error "_OPENMP has incorrect value"
 #endif //_OPENMP
 #else
@@ -22,7 +22,7 @@
 // -fopenmp=libiomp5 option is specified
 #ifndef _OPENMP
 #error "No _OPENMP macro is defined with -fopenmp option"
-#elsif _OPENMP != 201107
+#elsif _OPENMP != 201307
 #error "_OPENMP has incorrect value"
 #endif // _OPENMP
 #else
-- 
GitLab