r203114 - [OPENMP] Updated comments and _OPENMP macro value for OpenMP 4.0 (for 'omp simd' support)
Alexey Bataev
a.bataev at hotmail.com
Thu Mar 6 04:27:56 PST 2014
Author: abataev
Date: Thu Mar 6 06:27:56 2014
New Revision: 203114
URL: http://llvm.org/viewvc/llvm-project?rev=203114&view=rev
Log:
[OPENMP] Updated comments and _OPENMP macro value for OpenMP 4.0 (for 'omp simd' support)
Modified:
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
cfe/trunk/lib/Sema/SemaOpenMP.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/test/OpenMP/predefined_macro.c
Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=203114&r1=203113&r2=203114&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Thu Mar 6 06:27:56 2014
@@ -720,12 +720,12 @@ static void InitializePredefinedMacros(c
// 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.
Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=203114&r1=203113&r2=203114&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Thu Mar 6 06:27:56 2014
@@ -1286,9 +1286,10 @@ OMPClause *Sema::ActOnOpenMPSharedClause
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)
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=203114&r1=203113&r2=203114&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Thu Mar 6 06:27:56 2014
@@ -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,
Modified: cfe/trunk/test/OpenMP/predefined_macro.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/predefined_macro.c?rev=203114&r1=203113&r2=203114&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/predefined_macro.c (original)
+++ cfe/trunk/test/OpenMP/predefined_macro.c Thu Mar 6 06:27:56 2014
@@ -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
More information about the cfe-commits
mailing list