Skip to content

Commit fee75b5

Browse files
authored
Merge pull request #250 from Teemperor/RevertAppleObjCTypeEncodingParserMaster
[upstreaming] Revert changes to AppleObjCTypeEncodingParser.cpp
2 parents aacefb4 + a90ecae commit fee75b5

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,25 +237,19 @@ clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
237237
if (!decl_vendor)
238238
return clang::QualType();
239239

240-
const bool append = false;
241-
const uint32_t max_matches = 1;
242-
std::vector<CompilerDecl> decls;
243-
244-
uint32_t num_types =
245-
decl_vendor->FindDecls(ConstString(name), append, max_matches, decls);
240+
auto types = decl_vendor->FindTypes(ConstString(name), /*max_matches*/ 1);
246241

247242
// The user can forward-declare something that has no definition. The runtime
248243
// doesn't prohibit this at all. This is a rare and very weird case. We keep
249244
// this assert in debug builds so we catch other weird cases.
250245
#ifdef LLDB_CONFIGURATION_DEBUG
251-
assert(num_types);
246+
assert(!types.empty());
252247
#else
253-
if (!num_types)
248+
if (types.empty())
254249
return ast_ctx.getObjCIdType();
255250
#endif
256-
if (auto *ctx = llvm::dyn_cast<ClangASTContext>(decls[0].GetTypeSystem()))
257-
return ClangUtil::GetQualType(
258-
ctx->GetTypeForDecl(decls[0].GetOpaqueDecl()).GetPointerType());
251+
252+
return ClangUtil::GetQualType(types.front().GetPointerType());
259253
} else {
260254
// We're going to resolve this dynamically anyway, so just smile and wave.
261255
return ast_ctx.getObjCIdType();

0 commit comments

Comments
 (0)