Lines Matching defs:DeclContext

9 // This file implements the Decl and DeclContext classes.
94 DeclContext *Parent, std::size_t Extra) {
155 bool DeclContext::hasValidDeclKind() const {
164 const char *DeclContext::getDeclKindName() const {
266 if (auto *AsDC = dyn_cast<DeclContext>(this))
275 if (auto *DC = dyn_cast<DeclContext>(this))
283 // template. In this case, the next step is not the parent DeclContext (or
284 // even a DeclContext at all).
290 const DeclContext *DC =
295 const DeclContext *Decl::getParentFunctionOrMethod(bool LexicalParent) const {
296 for (const DeclContext *DC = LexicalParent ? getLexicalDeclContext()
336 void Decl::setDeclContext(DeclContext *DC) {
340 void Decl::setLexicalDeclContext(DeclContext *DC) {
364 void Decl::setDeclContextsImpl(DeclContext *SemaDC, DeclContext *LexicalDC,
377 const DeclContext *LDC = getLexicalDeclContext();
394 for (const DeclContext *DC = getDeclContext(); DC; DC = DC->getParent()) {
404 const DeclContext *DC = getDeclContext();
409 const auto *DC = dyn_cast<DeclContext>(this);
482 DeclContext::decl_iterator(const_cast<FieldDecl *>(FD)));
490 DeclContext *DC = getDeclContext();
1003 Decl *Decl::castFromDeclContext (const DeclContext *D) {
1009 return static_cast<NAME##Decl *>(const_cast<DeclContext *>(D));
1012 llvm_unreachable("a decl that inherits DeclContext isn't handled");
1016 DeclContext *Decl::castToDeclContext(const Decl *D) {
1025 llvm_unreachable("a decl that inherits DeclContext isn't handled");
1061 // as DeclContext (?).
1075 const DeclContext *DC = getLexicalDeclContext();
1111 static Decl::Kind getKind(const DeclContext *DC) { return DC->getDeclKind(); }
1148 DeclContext *Decl::getNonTransparentDeclContext() {
1153 /// Starting at a given context (a Decl or DeclContext), look for a
1178 Decl *DeclContext::getNonClosureAncestor() {
1183 // DeclContext Implementation
1186 DeclContext::DeclContext(Decl::Kind K) {
1196 bool DeclContext::classof(const Decl *D) {
1208 DeclContext::~DeclContext() = default;
1216 DeclContext *DeclContext::getLookupParent() {
1232 const BlockDecl *DeclContext::getInnermostBlockDecl() const {
1233 const DeclContext *Ctx = this;
1244 bool DeclContext::isInlineNamespace() const {
1249 bool DeclContext::isStdNamespace() const {
1265 bool DeclContext::isDependentContext() const {
1293 // DeclContext. A context within it (such as a lambda-expression)
1299 bool DeclContext::isTransparentContext() const {
1306 static bool isLinkageSpecContext(const DeclContext *DC,
1316 bool DeclContext::isExternCContext() const {
1320 const LinkageSpecDecl *DeclContext::getExternCContext() const {
1321 const DeclContext *DC = this;
1331 bool DeclContext::isExternCXXContext() const {
1335 bool DeclContext::Encloses(const DeclContext *DC) const {
1346 DeclContext *DeclContext::getNonTransparentContext() {
1347 DeclContext *DC = this;
1355 DeclContext *DeclContext::getPrimaryContext() {
1365 // There is only one DeclContext for these entities.
1428 "Unknown DeclContext kind");
1434 void collectAllContextsImpl(T *Self, SmallVectorImpl<DeclContext *> &Contexts) {
1441 void DeclContext::collectAllContexts(SmallVectorImpl<DeclContext *> &Contexts) {
1455 DeclContext::BuildDeclChain(ArrayRef<Decl *> Decls,
1478 void DeclContext::reconcileExternalVisibleStorage() const {
1490 DeclContext::LoadLexicalDeclsFromExternalStorage() const {
1494 // Notify that we have a DeclContext that is initializing.
1523 DeclContext::lookup_result
1524 ExternalASTSource::SetNoExternalVisibleDeclsForName(const DeclContext *DC,
1535 return DeclContext::lookup_result();
1538 DeclContext::lookup_result
1539 ExternalASTSource::SetExternalVisibleDeclsForName(const DeclContext *DC,
1554 DeclContext::decl_iterator DeclContext::decls_begin() const {
1560 bool DeclContext::decls_empty() const {
1567 bool DeclContext::containsDecl(Decl *D) const {
1572 bool DeclContext::containsDeclAndLoad(Decl *D) const {
1617 void DeclContext::removeDecl(Decl *D) {
1672 void DeclContext::addHiddenDecl(Decl *D) {
1676 "Decl already inserted into a DeclContext");
1698 void DeclContext::addDecl(Decl *D) {
1706 void DeclContext::addDeclInternal(Decl *D) {
1715 /// declarations in this DeclContext (and any other contexts linked
1721 StoredDeclsMap *DeclContext::buildLookup() {
1728 SmallVector<DeclContext *, 2> Contexts;
1755 /// DeclContext, a DeclContext linked to it, or a transparent context
1757 void DeclContext::buildLookupImpl(DeclContext *DCtx, bool Internal) {
1777 if (auto *InnerCtx = dyn_cast<DeclContext>(D))
1783 DeclContext::lookup_result
1784 DeclContext::lookup(DeclarationName Name) const {
1785 // For transparent DeclContext, we should lookup in their enclosing context.
1789 const DeclContext *PrimaryContext = getPrimaryContext();
1811 Map = const_cast<DeclContext*>(this)->buildLookup();
1836 Map = const_cast<DeclContext*>(this)->buildLookup();
1848 DeclContext::lookup_result
1849 DeclContext::noload_lookup(DeclarationName Name) {
1854 DeclContext *PrimaryContext = getPrimaryContext();
1871 void DeclContext::loadLazyLocalLexicalLookups() {
1873 SmallVector<DeclContext *, 2> Contexts;
1881 void DeclContext::localUncachedLookup(DeclarationName Name,
1920 DeclContext *DeclContext::getRedeclContext() {
1921 DeclContext *Ctx = this;
1938 DeclContext *DeclContext::getEnclosingNamespaceContext() {
1939 DeclContext *Ctx = this;
1946 RecordDecl *DeclContext::getOuterLexicalRecordContext() {
1949 DeclContext *DC = this;
1957 bool DeclContext::InEnclosingNamespaceSetOf(const DeclContext *O) const {
1975 void DeclContext::makeDeclVisibleInContext(NamedDecl *D) {
1976 DeclContext *PrimaryDC = this->getPrimaryContext();
1977 DeclContext *DeclDC = D->getDeclContext()->getPrimaryContext();
1983 void DeclContext::makeDeclVisibleInContextWithFlags(NamedDecl *D, bool Internal,
2032 void DeclContext::makeDeclVisibleInContextImpl(NamedDecl *D, bool Internal) {
2066 UsingDirectiveDecl *DeclContext::udir_iterator::operator*() const {
2072 DeclContext::udir_range DeclContext::using_directives() const {
2083 StoredDeclsMap *DeclContext::CreateStoredDeclsMap(ASTContext &C) const {
2124 DeclContext *Parent,