23 struct Builder : RecursiveASTVisitor<Builder> {
24 ASTImporterLookupTable &
LT;
25 Builder(ASTImporterLookupTable <) : LT(LT) {}
26 bool VisitNamedDecl(NamedDecl *D) {
30 bool VisitFriendDecl(FriendDecl *D) {
31 if (D->getFriendType()) {
32 QualType Ty = D->getFriendType()->getType();
34 QualType NamedTy = cast<ElaboratedType>(Ty)->getNamedType();
35 if (!NamedTy->isDependentType()) {
36 if (
const auto *RTy = dyn_cast<RecordType>(NamedTy))
37 LT.add(RTy->getAsCXXRecordDecl());
38 else if (
const auto *SpecTy =
39 dyn_cast<TemplateSpecializationType>(NamedTy)) {
40 LT.add(SpecTy->getAsCXXRecordDecl());
48 bool shouldVisitTemplateInstantiations()
const {
return true; }
49 bool shouldVisitImplicitCode()
const {
return true; }
67 bool EraseResult = Decls.remove(ND);
69 assert(EraseResult ==
true &&
"Trying to remove not contained Decl");
81 void ASTImporterLookupTable::remove(
NamedDecl *ND) {
93 if (DCI == LookupTable.end())
96 const auto &FoundNameMap = DCI->second;
97 auto NamesI = FoundNameMap.find(Name);
98 if (NamesI == FoundNameMap.end())
101 return NamesI->second;
106 if (DCI == LookupTable.end())
107 llvm::errs() <<
"empty\n";
108 const auto &FoundNameMap = DCI->second;
109 for (
const auto &Entry : FoundNameMap) {
111 llvm::errs() <<
"==== Name: ";
113 const DeclList& List = Entry.second;
121 for (
const auto &Entry : LookupTable) {
124 llvm::errs() <<
"== DC:" << cast<Decl>(DC) << Primary <<
"\n";
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
LookupResult lookup(DeclContext *DC, DeclarationName Name) const
DeclContext * getDeclContext()
ASTImporterLookupTable(TranslationUnitDecl &TU)
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
The name of a declaration.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
ASTImporterLookupTable & LT
The top declaration context.
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
This represents a decl that may have a name.