aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-20 01:17:11 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-20 01:17:11 +0000
commit4afa39deaa245592977136d367251ee2c173dd8d (patch)
treeb147c76b69b1dc48d42e3cc3080554515db96d94 /lib/Sema/SemaLookup.cpp
parentf4f6f219423a67a969de7b3e0c28bcefdb3c0a10 (diff)
Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 5f8f3f5f6a..7353bc37e4 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -53,8 +53,7 @@ MaybeConstructOverloadSet(ASTContext &Context,
// FIXME: We leak this overload set. Eventually, we want to
// stop building the declarations for these overload sets, so
// there will be nothing to leak.
- Ovl = OverloadedFunctionDecl::Create(Context,
- cast<ScopedDecl>(*I)->getDeclContext(),
+ Ovl = OverloadedFunctionDecl::Create(Context, (*I)->getDeclContext(),
(*I)->getDeclName());
Ovl->addOverload(cast<FunctionDecl>(*I));
}
@@ -491,7 +490,7 @@ Sema::LookupQualifiedName(DeclContext *LookupCtx, DeclarationName Name,
// A static member, a nested type or an enumerator defined in
// a base class T can unambiguously be found even if an object
// has more than one base class subobject of type T.
- ScopedDecl *FirstDecl = *Path->Decls.first;
+ Decl *FirstDecl = *Path->Decls.first;
if (isa<VarDecl>(FirstDecl) ||
isa<TypeDecl>(FirstDecl) ||
isa<EnumConstantDecl>(FirstDecl))
@@ -610,10 +609,10 @@ bool Sema::DiagnoseAmbiguousLookup(LookupResult &Result, DeclarationName Name,
Diag(NameLoc, diag::err_ambiguous_member_multiple_subobject_types)
<< Name << LookupRange;
- std::set<ScopedDecl *> DeclsPrinted;
+ std::set<Decl *> DeclsPrinted;
for (BasePaths::paths_iterator Path = Paths->begin(), PathEnd = Paths->end();
Path != PathEnd; ++Path) {
- ScopedDecl *D = *Path->Decls.first;
+ Decl *D = *Path->Decls.first;
if (DeclsPrinted.insert(D).second)
Diag(D->getLocation(), diag::note_ambiguous_member_found);
}