DeclContext *DeclContext::getEnclosingNamespaceContext() { DeclContext *Ctx = this; // Skip through non-namespace, non-translation-unit contexts. while (!Ctx->isFileContext() || Ctx->isTransparentContext()) Ctx = Ctx->getParent(); return Ctx->getPrimaryContext(); }
DeclContext *DeclContext::getLookupContext() { DeclContext *Ctx = this; // Skip through transparent contexts. while (Ctx->isTransparentContext()) Ctx = Ctx->getParent(); return Ctx; }