[OPENMP 4.0] Initial support for 'omp declare reduction' construct.
authorAlexey Bataev <a.bataev@hotmail.com>
Thu, 3 Mar 2016 05:21:39 +0000 (05:21 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Thu, 3 Mar 2016 05:21:39 +0000 (05:21 +0000)
commit94a4f0cb5f8a44e1228f1fd06c8d970125084c71
tree5e5bfcc492ec4e95123b4a51523a59da17ebebf5
parent2a4985c929e93e623a2899f485f6f5f014bf4c83
[OPENMP 4.0] Initial support for 'omp declare reduction' construct.

Add parsing, sema analysis and serialization/deserialization for 'declare reduction' construct.
User-defined reductions are defined as

#pragma omp declare reduction( reduction-identifier : typename-list : combiner ) [initializer ( initializer-expr )]
These custom reductions may be used in 'reduction' clauses of OpenMP constructs. The combiner specifies how partial results can be combined into a single value. The
combiner can use the special variable identifiers omp_in and omp_out that are of the type of the variables being reduced with this reduction-identifier. Each of them will
denote one of the values to be combined before executing the combiner. It is assumed that the special omp_out identifier will refer to the storage that holds the resulting
combined value after executing the combiner.
As the initializer-expr value of a user-defined reduction is not known a priori the initializer-clause can be used to specify one. Then the contents of the initializer-clause
will be used as the initializer for private copies of reduction list items where the omp_priv identifier will refer to the storage to be initialized. The special identifier
omp_orig can also appear in the initializer-clause and it will refer to the storage of the original variable to be reduced.
Differential Revision: http://reviews.llvm.org/D11182

llvm-svn: 262582
41 files changed:
clang/include/clang/AST/DeclBase.h
clang/include/clang/AST/DeclCXX.h
clang/include/clang/AST/DeclOpenMP.h
clang/include/clang/AST/RecursiveASTVisitor.h
clang/include/clang/Basic/DeclNodes.td
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Basic/OpenMPKinds.def
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/ScopeInfo.h
clang/include/clang/Sema/Sema.h
clang/include/clang/Serialization/ASTBitCodes.h
clang/lib/AST/CXXInheritance.cpp
clang/lib/AST/Decl.cpp
clang/lib/AST/DeclBase.cpp
clang/lib/AST/DeclOpenMP.cpp
clang/lib/AST/DeclPrinter.cpp
clang/lib/AST/ItaniumMangle.cpp
clang/lib/AST/MicrosoftMangle.cpp
clang/lib/Basic/OpenMPKinds.cpp
clang/lib/CodeGen/CGDecl.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Parse/ParseOpenMP.cpp
clang/lib/Parse/Parser.cpp
clang/lib/Sema/ScopeInfo.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaLookup.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/lib/Serialization/ASTCommon.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
clang/lib/Serialization/ASTWriterDecl.cpp
clang/test/OpenMP/declare_reduction_ast_print.c [new file with mode: 0644]
clang/test/OpenMP/declare_reduction_ast_print.cpp [new file with mode: 0644]
clang/test/OpenMP/declare_reduction_messages.c [new file with mode: 0644]
clang/test/OpenMP/declare_reduction_messages.cpp [new file with mode: 0644]
clang/tools/libclang/CIndex.cpp