diff options
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index a21d5db11a3..faaa1045ded 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -567,6 +567,13 @@ DeclContext::lookup(ASTContext &Context, DeclarationName Name) const { return const_cast<DeclContext*>(this)->lookup(Context, Name); } +DeclContext *DeclContext::getLookupContext() { + DeclContext *Ctx = this; + while (Ctx->isTransparentContext()) + Ctx = Ctx->getParent(); + return Ctx; +} + void DeclContext::insert(ASTContext &Context, ScopedDecl *D) { DeclContext *PrimaryContext = getPrimaryContext(Context); if (PrimaryContext != this) { |