Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/AST/ASTImporterLookupTable.cpp
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | assert(!contains(OldDC, ND) && | ||||
"Decl should not be found in the old context if already in the new"); | "Decl should not be found in the old context if already in the new"); | ||||
return; | return; | ||||
} | } | ||||
remove(OldDC, ND); | remove(OldDC, ND); | ||||
add(ND); | add(ND); | ||||
} | } | ||||
void ASTImporterLookupTable::updateForced(NamedDecl *ND, DeclContext *OldDC) { | |||||
LookupTable[OldDC][ND->getDeclName()].remove(ND); | |||||
add(ND); | |||||
} | |||||
ASTImporterLookupTable::LookupResult | ASTImporterLookupTable::LookupResult | ||||
ASTImporterLookupTable::lookup(DeclContext *DC, DeclarationName Name) const { | ASTImporterLookupTable::lookup(DeclContext *DC, DeclarationName Name) const { | ||||
auto DCI = LookupTable.find(DC->getPrimaryContext()); | auto DCI = LookupTable.find(DC->getPrimaryContext()); | ||||
if (DCI == LookupTable.end()) | if (DCI == LookupTable.end()) | ||||
return {}; | return {}; | ||||
const auto &FoundNameMap = DCI->second; | const auto &FoundNameMap = DCI->second; | ||||
auto NamesI = FoundNameMap.find(Name); | auto NamesI = FoundNameMap.find(Name); | ||||
Show All 36 Lines |