From 417e87cb96cae7713f84d96c7dd2cfafb7364f23 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 27 Oct 2010 19:49:05 +0000 Subject: Lazily load the "next" namespace in the chain of NamespaceDecls, to eliminate some excessive recursion and deserialization. llvm-svn: 117476 --- clang/lib/AST/Decl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/AST/Decl.cpp') diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 5cc745d40de..9c7654b9cbe 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1911,6 +1911,11 @@ NamespaceDecl *NamespaceDecl::Create(ASTContext &C, DeclContext *DC, return new (C) NamespaceDecl(DC, L, Id); } +NamespaceDecl *NamespaceDecl::getNextNamespace() { + return dyn_cast_or_null( + NextNamespace.get(getASTContext().getExternalSource())); +} + ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T) { return new (C) ImplicitParamDecl(ImplicitParam, DC, L, Id, T); -- cgit v1.2.3