forked from OSchip/llvm-project
[lldb] Fix build after found_decls was removed by 1f40d60a3b
This commit is contained in:
parent
e181a6aedd
commit
ce5e21868c
|
@ -148,10 +148,11 @@ void addOverridesForMethod(clang::CXXMethodDecl *decl) {
|
|||
return;
|
||||
|
||||
clang::CXXBasePaths paths;
|
||||
llvm::SmallVector<clang::NamedDecl *, 4> decls;
|
||||
|
||||
auto find_overridden_methods =
|
||||
[decl](const clang::CXXBaseSpecifier *specifier,
|
||||
clang::CXXBasePath &path) {
|
||||
[&decls, decl](const clang::CXXBaseSpecifier *specifier,
|
||||
clang::CXXBasePath &path) {
|
||||
if (auto *base_record = llvm::dyn_cast<clang::CXXRecordDecl>(
|
||||
specifier->getType()->getAs<clang::RecordType>()->getDecl())) {
|
||||
|
||||
|
@ -163,6 +164,7 @@ void addOverridesForMethod(clang::CXXMethodDecl *decl) {
|
|||
if (auto *baseDtorDecl = base_record->getDestructor()) {
|
||||
if (baseDtorDecl->isVirtual()) {
|
||||
path.Decls = baseDtorDecl;
|
||||
decls.push_back(baseDtorDecl);
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
|
@ -175,6 +177,7 @@ void addOverridesForMethod(clang::CXXMethodDecl *decl) {
|
|||
llvm::dyn_cast<clang::CXXMethodDecl>(path.Decls.front()))
|
||||
if (method_decl->isVirtual() && !isOverload(decl, method_decl)) {
|
||||
path.Decls = method_decl;
|
||||
decls.push_back(method_decl);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +187,7 @@ void addOverridesForMethod(clang::CXXMethodDecl *decl) {
|
|||
};
|
||||
|
||||
if (decl->getParent()->lookupInBases(find_overridden_methods, paths)) {
|
||||
for (auto *overridden_decl : paths.found_decls())
|
||||
for (auto *overridden_decl : decls)
|
||||
decl->addOverriddenMethod(
|
||||
llvm::cast<clang::CXXMethodDecl>(overridden_decl));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue