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
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp
index 762885e..4e9d085 100644
--- a/lib/Sema/IdentifierResolver.cpp
+++ b/lib/Sema/IdentifierResolver.cpp
@@ -46,19 +46,10 @@
// LookupContext Implementation
//===----------------------------------------------------------------------===//
-/// getContext - Returns translation unit context for non ScopedDecls and
+/// getContext - Returns translation unit context for non Decls and
/// for EnumConstantDecls returns the parent context of their EnumDecl.
DeclContext *IdentifierResolver::LookupContext::getContext(Decl *D) {
- DeclContext *Ctx;
-
- if (EnumConstantDecl *EnumD = dyn_cast<EnumConstantDecl>(D)) {
- Ctx = EnumD->getDeclContext()->getParent();
- } else if (ScopedDecl *SD = dyn_cast<ScopedDecl>(D))
- Ctx = SD->getDeclContext();
- else if (OverloadedFunctionDecl *Ovl = dyn_cast<OverloadedFunctionDecl>(D))
- Ctx = Ovl->getDeclContext();
- else
- return TUCtx();
+ DeclContext *Ctx = D->getDeclContext();
if (!Ctx) // FIXME: HACK! We shouldn't end up with a NULL context here.
return TUCtx();