aboutsummaryrefslogtreecommitdiff
path: root/source/Plugins/LanguageRuntime
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/LanguageRuntime')
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp10
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp14
2 files changed, 8 insertions, 16 deletions
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index c849a5441..38a4f9e40 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -474,12 +474,10 @@ bool AppleObjCRuntimeV2::GetDynamicTypeAndAddress(
class_type_or_name.SetTypeSP(type_sp);
} else {
// try to go for a CompilerType at least
- DeclVendor *vendor = GetDeclVendor();
- if (vendor) {
- std::vector<clang::NamedDecl *> decls;
- if (vendor->FindDecls(class_name, false, 1, decls) && decls.size())
- class_type_or_name.SetCompilerType(
- ClangASTContext::GetTypeForDecl(decls[0]));
+ if (auto *vendor = GetDeclVendor()) {
+ auto types = vendor->FindTypes(class_name, /*max_matches*/ 1);
+ if (!types.empty())
+ class_type_or_name.SetCompilerType(types.front());
}
}
}
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
index e1068e8d4..26654e921 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
@@ -245,25 +245,19 @@ clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
if (!decl_vendor)
return clang::QualType();
- const bool append = false;
- const uint32_t max_matches = 1;
- std::vector<clang::NamedDecl *> decls;
-
- uint32_t num_types =
- decl_vendor->FindDecls(ConstString(name), append, max_matches, decls);
+ auto types = decl_vendor->FindTypes(ConstString(name), /*max_matches*/ 1);
// The user can forward-declare something that has no definition. The runtime
// doesn't prohibit this at all. This is a rare and very weird case. We keep
// this assert in debug builds so we catch other weird cases.
#ifdef LLDB_CONFIGURATION_DEBUG
- assert(num_types);
+ assert(!types.empty());
#else
- if (!num_types)
+ if (types.empty())
return ast_ctx.getObjCIdType();
#endif
- return ClangUtil::GetQualType(
- ClangASTContext::GetTypeForDecl(decls[0]).GetPointerType());
+ return ClangUtil::GetQualType(types.front().GetPointerType());
} else {
// We're going to resolve this dynamically anyway, so just smile and wave.
return ast_ctx.getObjCIdType();