Skip to content

Commit 952413c

Browse files
committed
Adapt LLDB to clang API change in ObjCMethodDecl::create().
(cherry picked from commit 454acae)
1 parent 47a4186 commit 952413c

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
@@ -8528,7 +8528,8 @@ bool ClangASTContext::AddObjCClassProperty(
85288528
? class_interface_decl->lookupInstanceMethod(getter_sel)
85298529
: class_interface_decl->lookupClassMethod(getter_sel))) {
85308530
const bool isVariadic = false;
8531-
const bool isSynthesized = false;
8531+
const bool isPropertyAccessor = false;
8532+
const bool isSynthesizedAccessorStub = false;
85328533
const bool isImplicitlyDeclared = true;
85338534
const bool isDefined = false;
85348535
const clang::ObjCMethodDecl::ImplementationControl impControl =
@@ -8539,7 +8540,8 @@ bool ClangASTContext::AddObjCClassProperty(
85398540
*clang_ast, clang::SourceLocation(), clang::SourceLocation(),
85408541
getter_sel, ClangUtil::GetQualType(property_clang_type_to_access),
85418542
nullptr, class_interface_decl, isInstance, isVariadic,
8542-
isSynthesized, isImplicitlyDeclared, isDefined, impControl,
8543+
isPropertyAccessor, isSynthesizedAccessorStub,
8544+
isImplicitlyDeclared, isDefined, impControl,
85438545
HasRelatedResultType);
85448546

85458547
if (getter && metadata)
@@ -8560,7 +8562,8 @@ bool ClangASTContext::AddObjCClassProperty(
85608562
: class_interface_decl->lookupClassMethod(setter_sel))) {
85618563
clang::QualType result_type = clang_ast->VoidTy;
85628564
const bool isVariadic = false;
8563-
const bool isSynthesized = false;
8565+
const bool isPropertyAccessor = true;
8566+
const bool isSynthesizedAccessorStub = false;
85648567
const bool isImplicitlyDeclared = true;
85658568
const bool isDefined = false;
85668569
const clang::ObjCMethodDecl::ImplementationControl impControl =
@@ -8570,8 +8573,9 @@ bool ClangASTContext::AddObjCClassProperty(
85708573
clang::ObjCMethodDecl *setter = clang::ObjCMethodDecl::Create(
85718574
*clang_ast, clang::SourceLocation(), clang::SourceLocation(),
85728575
setter_sel, result_type, nullptr, class_interface_decl,
8573-
isInstance, isVariadic, isSynthesized, isImplicitlyDeclared,
8574-
isDefined, impControl, HasRelatedResultType);
8576+
isInstance, isVariadic, isPropertyAccessor,
8577+
isSynthesizedAccessorStub, isImplicitlyDeclared, isDefined,
8578+
impControl, HasRelatedResultType);
85758579

85768580
if (setter && metadata)
85778581
ClangASTContext::SetMetadata(clang_ast, setter, *metadata);
@@ -8673,10 +8677,16 @@ clang::ObjCMethodDecl *ClangASTContext::AddMethodToObjCObjectType(
86738677
if (!method_function_prototype)
86748678
return nullptr;
86758679

8676-
bool is_synthesized = false;
8677-
bool is_defined = false;
8678-
clang::ObjCMethodDecl::ImplementationControl imp_control =
8680+
const bool isInstance = (name[0] == '-');
8681+
const bool isVariadic = false;
8682+
const bool isPropertyAccessor = false;
8683+
const bool isSynthesizedAccessorStub = false;
8684+
/// Force this to true because we don't have source locations.
8685+
const bool isImplicitlyDeclared = true;
8686+
const bool isDefined = false;
8687+
const clang::ObjCMethodDecl::ImplementationControl impControl =
86798688
clang::ObjCMethodDecl::None;
8689+
const bool HasRelatedResultType = false;
86808690

86818691
const unsigned num_args = method_function_prototype->getNumParams();
86828692

@@ -8692,10 +8702,8 @@ clang::ObjCMethodDecl *ClangASTContext::AddMethodToObjCObjectType(
86928702
nullptr, // TypeSourceInfo *ResultTInfo,
86938703
ClangASTContext::GetASTContext(ast)->GetDeclContextForType(
86948704
ClangUtil::GetQualType(type)),
8695-
name[0] == '-', is_variadic, is_synthesized,
8696-
true, // is_implicitly_declared; we force this to true because we don't
8697-
// have source locations
8698-
is_defined, imp_control, false /*has_related_result_type*/);
8705+
isInstance, isVariadic, isPropertyAccessor, isSynthesizedAccessorStub,
8706+
isImplicitlyDeclared, isDefined, impControl, HasRelatedResultType);
86998707

87008708
if (objc_method_decl == nullptr)
87018709
return nullptr;

0 commit comments

Comments
 (0)