diff --git a/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp b/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp index 2442e8ec25f12..4611d09785a31 100644 --- a/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp +++ b/interpreter/llvm/src/tools/clang/lib/AST/ASTImporter.cpp @@ -144,6 +144,7 @@ namespace clang { Decl *VisitCXXConversionDecl(CXXConversionDecl *D); Decl *VisitFieldDecl(FieldDecl *D); Decl *VisitIndirectFieldDecl(IndirectFieldDecl *D); + Decl *VisitAccessSpecDecl(AccessSpecDecl *D); Decl *VisitObjCIvarDecl(ObjCIvarDecl *D); Decl *VisitVarDecl(VarDecl *D); Decl *VisitImplicitParamDecl(ImplicitParamDecl *D); @@ -2850,6 +2851,31 @@ static unsigned getFieldIndex(Decl *F) { return Index; } +Decl *ASTNodeImporter::VisitAccessSpecDecl(AccessSpecDecl *D) { + + SourceLocation Loc = Importer.Import(D->getLocation()); + SourceLocation ColonLoc = Importer.Import(D->getColonLoc()); + + // Import the context of this declaration. + DeclContext *DC = Importer.ImportContext(D->getDeclContext()); + if (!DC) + return nullptr; + + AccessSpecDecl *accessSpecDecl + = AccessSpecDecl::Create(Importer.getToContext(), D->getAccess(), + DC, Loc, ColonLoc); + + if (!accessSpecDecl) + return nullptr; + + // Lexical DeclContext and Semantic DeclContext + // is always the same for the accessSpec. + accessSpecDecl->setLexicalDeclContext(DC); + DC->addDeclInternal(accessSpecDecl); + + return accessSpecDecl; +} + Decl *ASTNodeImporter::VisitFieldDecl(FieldDecl *D) { // Import the major distinguishing characteristics of a variable. DeclContext *DC, *LexicalDC;