summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-06 23:51:29 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-06 23:51:29 +0000
commit6ad0ef50918ed9cefff5fefb37d4f6dc2fac2343 (patch)
tree56e7cd61b0d1d20a40f4edb5097519c9e3af9537 /clang/lib/AST/DeclBase.cpp
parent44a3da6c4dc98e9303c07836257ced0bc4a12cbb (diff)
downloadbcm5719-llvm-6ad0ef50918ed9cefff5fefb37d4f6dc2fac2343.tar.gz
bcm5719-llvm-6ad0ef50918ed9cefff5fefb37d4f6dc2fac2343.zip
Allow Objective-C entities to be declared within a transparent context
nested in the translation unit. This fixes <rdar://problem/6476070>. llvm-svn: 61832
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp7
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) {
OpenPOWER on IntegriCloud