Lines Matching +full:dc +full:- +full:dc
1 //===- ASTImporterLookupTable.cpp - ASTImporter specific lookup -----------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
28 QualType Ty = D->getUnderlyingType(); in VisitTypedefNameDecl()
31 LT.add(RTy->getAsRecordDecl()); in VisitTypedefNameDecl()
33 for (auto *it : RTy->getAsRecordDecl()->fields()) { in VisitTypedefNameDecl()
50 if (D->getFriendType()) { in VisitFriendDecl()
51 QualType Ty = D->getFriendType()->getType(); in VisitFriendDecl()
53 Ty = cast<ElaboratedType>(Ty)->getNamedType(); in VisitFriendDecl()
56 // However, there are non-dependent cases which does not have the in VisitFriendDecl()
58 if (!Ty->isDependentType()) { in VisitFriendDecl()
60 LT.add(RTy->getAsCXXRecordDecl()); in VisitFriendDecl()
62 LT.add(SpecTy->getAsCXXRecordDecl()); in VisitFriendDecl()
65 if (SubstTy->getAsCXXRecordDecl()) in VisitFriendDecl()
66 LT.add(SubstTy->getAsCXXRecordDecl()); in VisitFriendDecl()
98 if (auto *Ns = dyn_cast<NamespaceDecl>(D->getDeclContext())) in ASTImporterLookupTable()
100 add(D->getDeclContext(), D); in ASTImporterLookupTable()
104 void ASTImporterLookupTable::add(DeclContext *DC, NamedDecl *ND) { in add() argument
105 DeclList &Decls = LookupTable[DC][ND->getDeclName()]; in add()
110 void ASTImporterLookupTable::remove(DeclContext *DC, NamedDecl *ND) { in remove() argument
111 const DeclarationName Name = ND->getDeclName(); in remove()
112 DeclList &Decls = LookupTable[DC][Name]; in remove()
119 Name.getAsString(), DC->getDeclKindName()) in remove()
128 DeclContext *DC = ND->getDeclContext()->getPrimaryContext(); in add() local
129 add(DC, ND); in add()
130 DeclContext *ReDC = DC->getRedeclContext()->getPrimaryContext(); in add()
131 if (DC != ReDC) in add()
137 DeclContext *DC = ND->getDeclContext()->getPrimaryContext(); in remove() local
138 remove(DC, ND); in remove()
139 DeclContext *ReDC = DC->getRedeclContext()->getPrimaryContext(); in remove()
140 if (DC != ReDC) in remove()
145 assert(OldDC != ND->getDeclContext() && in update()
147 if (contains(ND->getDeclContext(), ND)) { in update()
158 LookupTable[OldDC][ND->getDeclName()].remove(ND); in updateForced()
163 ASTImporterLookupTable::lookup(DeclContext *DC, DeclarationName Name) const { in lookup() argument
164 auto DCI = LookupTable.find(DC->getPrimaryContext()); in lookup()
168 const auto &FoundNameMap = DCI->second; in lookup()
173 return NamesI->second; in lookup()
176 bool ASTImporterLookupTable::contains(DeclContext *DC, NamedDecl *ND) const { in contains() argument
177 return lookup(DC, ND->getDeclName()).contains(ND); in contains()
180 void ASTImporterLookupTable::dump(DeclContext *DC) const { in dump()
181 auto DCI = LookupTable.find(DC->getPrimaryContext()); in dump()
184 const auto &FoundNameMap = DCI->second; in dump()
191 ND->dump(); in dump()
198 DeclContext *DC = Entry.first; in dump() local
199 StringRef Primary = DC->getPrimaryContext() ? " primary" : ""; in dump()
200 llvm::errs() << "== DC:" << cast<Decl>(DC) << Primary << "\n"; in dump()
201 dump(DC); in dump()