From: Eric Fiselier Date: Fri, 1 Feb 2019 21:19:20 +0000 (+0000) Subject: Don't use ASTContext in DeclOpenMP.h because it's still incomplete. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=804ee17240d15d9e2aea576512affd435f9ba3c9;p=clang Don't use ASTContext in DeclOpenMP.h because it's still incomplete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352919 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclOpenMP.h b/include/clang/AST/DeclOpenMP.h index 5faf6c84c8..12332a2b9b 100644 --- a/include/clang/AST/DeclOpenMP.h +++ b/include/clang/AST/DeclOpenMP.h @@ -289,14 +289,8 @@ public: /// Get reference to previous declare mapper construct in the same /// scope with the same name. - OMPDeclareMapperDecl *getPrevDeclInScope() { - return cast_or_null( - PrevDeclInScope.get(getASTContext().getExternalSource())); - } - const OMPDeclareMapperDecl *getPrevDeclInScope() const { - return cast_or_null( - PrevDeclInScope.get(getASTContext().getExternalSource())); - } + OMPDeclareMapperDecl *getPrevDeclInScope(); + const OMPDeclareMapperDecl *getPrevDeclInScope() const; static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classofKind(Kind K) { return K == OMPDeclareMapper; } diff --git a/lib/AST/DeclOpenMP.cpp b/lib/AST/DeclOpenMP.cpp index 5a1b036313..39cb46705e 100644 --- a/lib/AST/DeclOpenMP.cpp +++ b/lib/AST/DeclOpenMP.cpp @@ -172,6 +172,16 @@ void OMPDeclareMapperDecl::setClauses(ArrayRef CL) { std::uninitialized_copy(CL.begin(), CL.end(), Clauses.data()); } +OMPDeclareMapperDecl *OMPDeclareMapperDecl::getPrevDeclInScope() { + return cast_or_null( + PrevDeclInScope.get(getASTContext().getExternalSource())); +} + +const OMPDeclareMapperDecl *OMPDeclareMapperDecl::getPrevDeclInScope() const { + return cast_or_null( + PrevDeclInScope.get(getASTContext().getExternalSource())); +} + //===----------------------------------------------------------------------===// // OMPCapturedExprDecl Implementation. //===----------------------------------------------------------------------===//