aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/CXXInheritance.cpp
diff options
context:
space:
mode:
authorNathan Ridge <zeratul976@hotmail.com>2025-02-24 15:05:14 -0500
committerGitHub <noreply@github.com>2025-02-24 15:05:14 -0500
commit8ce17c15577d223e14b62f9198d4b2ae9856b9fb (patch)
tree22c3f05f15908f8b60436e0a163c53dbcae1f15f /clang/lib/AST/CXXInheritance.cpp
parente55f1a7ef8d3e698144b013c8715a18c88912d81 (diff)
downloadllvm-8ce17c15577d223e14b62f9198d4b2ae9856b9fb.zip
llvm-8ce17c15577d223e14b62f9198d4b2ae9856b9fb.tar.gz
llvm-8ce17c15577d223e14b62f9198d4b2ae9856b9fb.tar.bz2
[clang][NFC] Remove CXXRecordDecl::lookupDependentName() and its helpers (#128392)
This function has been superseded by HeuristicResolver::lookupDependentName(), which implements the same heuristics and more. Porting note for any out-of-tree callers: ``` RD->lookupDependentName(Name, Filter); ``` can be replaced with: ``` HeuristicResolver(RD->getASTContext())->lookupDependentName(Name, Filter); ```
Diffstat (limited to 'clang/lib/AST/CXXInheritance.cpp')
-rw-r--r--clang/lib/AST/CXXInheritance.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/clang/lib/AST/CXXInheritance.cpp b/clang/lib/AST/CXXInheritance.cpp
index ee57758..ab862d5 100644
--- a/clang/lib/AST/CXXInheritance.cpp
+++ b/clang/lib/AST/CXXInheritance.cpp
@@ -411,59 +411,6 @@ bool CXXRecordDecl::hasMemberName(DeclarationName Name) const {
Paths);
}
-static bool
-findOrdinaryMemberInDependentClasses(const CXXBaseSpecifier *Specifier,
- CXXBasePath &Path, DeclarationName Name) {
- const TemplateSpecializationType *TST =
- Specifier->getType()->getAs<TemplateSpecializationType>();
- if (!TST) {
- auto *RT = Specifier->getType()->getAs<RecordType>();
- if (!RT)
- return false;
- return findOrdinaryMember(cast<CXXRecordDecl>(RT->getDecl()), Path, Name);
- }
- TemplateName TN = TST->getTemplateName();
- const auto *TD = dyn_cast_or_null<ClassTemplateDecl>(TN.getAsTemplateDecl());
- if (!TD)
- return false;
- CXXRecordDecl *RD = TD->getTemplatedDecl();
- if (!RD)
- return false;
- return findOrdinaryMember(RD, Path, Name);
-}
-
-std::vector<const NamedDecl *> CXXRecordDecl::lookupDependentName(
- DeclarationName Name,
- llvm::function_ref<bool(const NamedDecl *ND)> Filter) {
- std::vector<const NamedDecl *> Results;
- // Lookup in the class.
- bool AnyOrdinaryMembers = false;
- for (const NamedDecl *ND : lookup(Name)) {
- if (isOrdinaryMember(ND))
- AnyOrdinaryMembers = true;
- if (Filter(ND))
- Results.push_back(ND);
- }
- if (AnyOrdinaryMembers)
- return Results;
-
- // Perform lookup into our base classes.
- CXXBasePaths Paths;
- Paths.setOrigin(this);
- if (!lookupInBases(
- [&](const CXXBaseSpecifier *Specifier, CXXBasePath &Path) {
- return findOrdinaryMemberInDependentClasses(Specifier, Path, Name);
- },
- Paths, /*LookupInDependent=*/true))
- return Results;
- for (DeclContext::lookup_iterator I = Paths.front().Decls, E = I.end();
- I != E; ++I) {
- if (isOrdinaryMember(*I) && Filter(*I))
- Results.push_back(*I);
- }
- return Results;
-}
-
void OverridingMethods::add(unsigned OverriddenSubobject,
UniqueVirtualMethod Overriding) {
SmallVectorImpl<UniqueVirtualMethod> &SubobjectOverrides