diff options
Diffstat (limited to 'clang/lib/AST/DeclOpenMP.cpp')
| -rw-r--r-- | clang/lib/AST/DeclOpenMP.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclOpenMP.cpp b/clang/lib/AST/DeclOpenMP.cpp index 2c474106e89..5b06ce0778a 100644 --- a/clang/lib/AST/DeclOpenMP.cpp +++ b/clang/lib/AST/DeclOpenMP.cpp @@ -54,6 +54,36 @@ void OMPThreadPrivateDecl::setVars(ArrayRef<Expr *> VL) { } //===----------------------------------------------------------------------===// +// OMPDeclareReductionDecl Implementation. +//===----------------------------------------------------------------------===// + +void OMPDeclareReductionDecl::anchor() {} + +OMPDeclareReductionDecl *OMPDeclareReductionDecl::Create( + ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, + QualType T, OMPDeclareReductionDecl *PrevDeclInScope) { + return new (C, DC) OMPDeclareReductionDecl(OMPDeclareReduction, DC, L, Name, + T, PrevDeclInScope); +} + +OMPDeclareReductionDecl * +OMPDeclareReductionDecl::CreateDeserialized(ASTContext &C, unsigned ID) { + return new (C, ID) OMPDeclareReductionDecl( + OMPDeclareReduction, /*DC=*/nullptr, SourceLocation(), DeclarationName(), + QualType(), /*PrevDeclInScope=*/nullptr); +} + +OMPDeclareReductionDecl *OMPDeclareReductionDecl::getPrevDeclInScope() { + return cast_or_null<OMPDeclareReductionDecl>( + PrevDeclInScope.get(getASTContext().getExternalSource())); +} +const OMPDeclareReductionDecl * +OMPDeclareReductionDecl::getPrevDeclInScope() const { + return cast_or_null<OMPDeclareReductionDecl>( + PrevDeclInScope.get(getASTContext().getExternalSource())); +} + +//===----------------------------------------------------------------------===// // OMPCapturedExprDecl Implementation. //===----------------------------------------------------------------------===// |

