From 07665a69e88334ced1648b5e4bcc2dbe2b90e366 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 5 Jan 2009 19:45:36 +0000 Subject: Introduce support for "transparent" DeclContexts, which are DeclContexts whose members are visible from enclosing DeclContexts up to (and including) the innermost enclosing non-transparent DeclContexts. Transparent DeclContexts unify the mechanism to be used for various language features, including C enumerations, anonymous unions, C++0x inline namespaces, and C++ linkage specifications. Please refer to the documentation in the Clang internals manual for more information. Only enumerations and linkage specifications currently use transparent DeclContexts. Still to do: use transparent DeclContexts to implement anonymous unions and GCC's anonymous structs extension, and, later, the C++0x features. We also need to tighten up the DeclContext/ScopedDecl link to ensure that every ScopedDecl is in a single DeclContext, which will ensure that we can then enforce ownership and reduce the memory footprint of DeclContext. llvm-svn: 61735 --- clang/lib/Sema/IdentifierResolver.h | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'clang/lib/Sema/IdentifierResolver.h') diff --git a/clang/lib/Sema/IdentifierResolver.h b/clang/lib/Sema/IdentifierResolver.h index 30846dcd174..3dab1b53a75 100644 --- a/clang/lib/Sema/IdentifierResolver.h +++ b/clang/lib/Sema/IdentifierResolver.h @@ -91,22 +91,7 @@ class IdentifierResolver { inline DeclsTy::iterator decls_begin() { return Decls.begin(); } inline DeclsTy::iterator decls_end() { return Decls.end(); } - /// FindContext - Returns an iterator pointing just after the decl that is - /// in the given context or in a parent of it. The search is in reverse - /// order, from end to begin. - DeclsTy::iterator FindDeclVisibleInContext(const LookupContext &Ctx) { - return FindDeclVisibleInContext(Ctx, Decls.end()); - } - - /// FindContext - Returns an iterator pointing just after the decl that is - /// in the given context or in a parent of it. The search is in reverse - /// order, from end to begin. - DeclsTy::iterator FindDeclVisibleInContext(const LookupContext &Ctx, - const DeclsTy::iterator &Start); - - void AddDecl(NamedDecl *D) { - Decls.insert(FindDeclVisibleInContext(LookupContext(D)), D); - } + void AddDecl(NamedDecl *D) { Decls.push_back(D); } /// AddShadowed - Add a decl by putting it directly above the 'Shadow' decl. /// Later lookups will find the 'Shadow' decl first. The 'Shadow' decl must -- cgit v1.2.3