[llvm-branch-commits] [lldb] ce5e218 - [lldb] Fix build after found_decls was removed by 1f40d60a3b7f310ff3f77bb8643a27d979a703cb
Fangrui Song via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Dec 1 19:18:53 PST 2020
Author: Fangrui Song
Date: 2020-12-01T19:14:35-08:00
New Revision: ce5e21868c22479df62ebd8884adc1bd7c964433
URL: https://github.com/llvm/llvm-project/commit/ce5e21868c22479df62ebd8884adc1bd7c964433
DIFF: https://github.com/llvm/llvm-project/commit/ce5e21868c22479df62ebd8884adc1bd7c964433.diff
LOG: [lldb] Fix build after found_decls was removed by 1f40d60a3b7f310ff3f77bb8643a27d979a703cb
Added:
Modified:
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index bab50a3b068c..ca109ef9c2fc 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -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));
}
More information about the llvm-branch-commits
mailing list