aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/IdentifierResolver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/IdentifierResolver.cpp')
-rw-r--r--lib/Sema/IdentifierResolver.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp
index 762885e42c..4e9d085a75 100644
--- a/lib/Sema/IdentifierResolver.cpp
+++ b/lib/Sema/IdentifierResolver.cpp
@@ -46,19 +46,10 @@ public:
// 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();