Skip to content

Commit 454acae

Browse files
committed
Adapt LLDB to clang API change in ObjCMethodDecl::create().
1 parent 15bc4dc commit 454acae

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ class ObjCRuntimeMethodType {
330330

331331
const bool isInstance = instance;
332332
const bool isVariadic = false;
333-
const bool isSynthesized = false;
333+
const bool isPropertyAccessor = false;
334+
const bool isSynthesizedAccessorStub = false;
334335
const bool isImplicitlyDeclared = true;
335336
const bool isDefined = false;
336337
const clang::ObjCMethodDecl::ImplementationControl impControl =
@@ -377,8 +378,8 @@ class ObjCRuntimeMethodType {
377378
clang::ObjCMethodDecl *ret = clang::ObjCMethodDecl::Create(
378379
ast_ctx, clang::SourceLocation(), clang::SourceLocation(), sel,
379380
ret_type, nullptr, interface_decl, isInstance, isVariadic,
380-
isSynthesized, isImplicitlyDeclared, isDefined, impControl,
381-
HasRelatedResultType);
381+
isPropertyAccessor, isSynthesizedAccessorStub, isImplicitlyDeclared,
382+
isDefined, impControl, HasRelatedResultType);
382383

383384
std::vector<clang::ParmVarDecl *> parm_vars;
384385

lldb/source/Symbol/ClangASTContext.cpp

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8489,7 +8489,8 @@ bool ClangASTContext::AddObjCClassProperty(
84898489
? class_interface_decl->lookupInstanceMethod(getter_sel)
84908490
: class_interface_decl->lookupClassMethod(getter_sel))) {
84918491
const bool isVariadic = false;
8492-
const bool isSynthesized = false;
8492+
const bool isPropertyAccessor = false;
8493+
const bool isSynthesizedAccessorStub = false;
84938494
const bool isImplicitlyDeclared = true;
84948495
const bool isDefined = false;
84958496
const clang::ObjCMethodDecl::ImplementationControl impControl =
@@ -8500,7 +8501,8 @@ bool ClangASTContext::AddObjCClassProperty(
85008501
*clang_ast, clang::SourceLocation(), clang::SourceLocation(),
85018502
getter_sel, ClangUtil::GetQualType(property_clang_type_to_access),
85028503
nullptr, class_interface_decl, isInstance, isVariadic,
8503-
isSynthesized, isImplicitlyDeclared, isDefined, impControl,
8504+
isPropertyAccessor, isSynthesizedAccessorStub,
8505+
isImplicitlyDeclared, isDefined, impControl,
85048506
HasRelatedResultType);
85058507

85068508
if (getter && metadata)
@@ -8521,7 +8523,8 @@ bool ClangASTContext::AddObjCClassProperty(
85218523
: class_interface_decl->lookupClassMethod(setter_sel))) {
85228524
clang::QualType result_type = clang_ast->VoidTy;
85238525
const bool isVariadic = false;
8524-
const bool isSynthesized = false;
8526+
const bool isPropertyAccessor = true;
8527+
const bool isSynthesizedAccessorStub = false;
85258528
const bool isImplicitlyDeclared = true;
85268529
const bool isDefined = false;
85278530
const clang::ObjCMethodDecl::ImplementationControl impControl =
@@ -8531,8 +8534,9 @@ bool ClangASTContext::AddObjCClassProperty(
85318534
clang::ObjCMethodDecl *setter = clang::ObjCMethodDecl::Create(
85328535
*clang_ast, clang::SourceLocation(), clang::SourceLocation(),
85338536
setter_sel, result_type, nullptr, class_interface_decl,
8534-
isInstance, isVariadic, isSynthesized, isImplicitlyDeclared,
8535-
isDefined, impControl, HasRelatedResultType);
8537+
isInstance, isVariadic, isPropertyAccessor,
8538+
isSynthesizedAccessorStub, isImplicitlyDeclared, isDefined,
8539+
impControl, HasRelatedResultType);
85368540

85378541
if (setter && metadata)
85388542
ClangASTContext::SetMetadata(clang_ast, setter, *metadata);
@@ -8634,10 +8638,16 @@ clang::ObjCMethodDecl *ClangASTContext::AddMethodToObjCObjectType(
86348638
if (!method_function_prototype)
86358639
return nullptr;
86368640

8637-
bool is_synthesized = false;
8638-
bool is_defined = false;
8639-
clang::ObjCMethodDecl::ImplementationControl imp_control =
8641+
const bool isInstance = (name[0] == '-');
8642+
const bool isVariadic = false;
8643+
const bool isPropertyAccessor = false;
8644+
const bool isSynthesizedAccessorStub = false;
8645+
/// Force this to true because we don't have source locations.
8646+
const bool isImplicitlyDeclared = true;
8647+
const bool isDefined = false;
8648+
const clang::ObjCMethodDecl::ImplementationControl impControl =
86408649
clang::ObjCMethodDecl::None;
8650+
const bool HasRelatedResultType = false;
86418651

86428652
const unsigned num_args = method_function_prototype->getNumParams();
86438653

@@ -8653,10 +8663,8 @@ clang::ObjCMethodDecl *ClangASTContext::AddMethodToObjCObjectType(
86538663
nullptr, // TypeSourceInfo *ResultTInfo,
86548664
ClangASTContext::GetASTContext(ast)->GetDeclContextForType(
86558665
ClangUtil::GetQualType(type)),
8656-
name[0] == '-', is_variadic, is_synthesized,
8657-
true, // is_implicitly_declared; we force this to true because we don't
8658-
// have source locations
8659-
is_defined, imp_control, false /*has_related_result_type*/);
8666+
isInstance, isVariadic, isPropertyAccessor, isSynthesizedAccessorStub,
8667+
isImplicitlyDeclared, isDefined, impControl, HasRelatedResultType);
86608668

86618669
if (objc_method_decl == nullptr)
86628670
return nullptr;

0 commit comments

Comments
 (0)