Skip to content

Commit

Permalink
Adapt LLDB to clang API change in ObjCMethodDecl::create().
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-prantl committed Nov 8, 2019
1 parent 15bc4dc commit 454acae
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ class ObjCRuntimeMethodType {

const bool isInstance = instance;
const bool isVariadic = false;
const bool isSynthesized = false;
const bool isPropertyAccessor = false;
const bool isSynthesizedAccessorStub = false;
const bool isImplicitlyDeclared = true;
const bool isDefined = false;
const clang::ObjCMethodDecl::ImplementationControl impControl =
Expand Down Expand Up @@ -377,8 +378,8 @@ class ObjCRuntimeMethodType {
clang::ObjCMethodDecl *ret = clang::ObjCMethodDecl::Create(
ast_ctx, clang::SourceLocation(), clang::SourceLocation(), sel,
ret_type, nullptr, interface_decl, isInstance, isVariadic,
isSynthesized, isImplicitlyDeclared, isDefined, impControl,
HasRelatedResultType);
isPropertyAccessor, isSynthesizedAccessorStub, isImplicitlyDeclared,
isDefined, impControl, HasRelatedResultType);

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

Expand Down
32 changes: 20 additions & 12 deletions lldb/source/Symbol/ClangASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8489,7 +8489,8 @@ bool ClangASTContext::AddObjCClassProperty(
? class_interface_decl->lookupInstanceMethod(getter_sel)
: class_interface_decl->lookupClassMethod(getter_sel))) {
const bool isVariadic = false;
const bool isSynthesized = false;
const bool isPropertyAccessor = false;
const bool isSynthesizedAccessorStub = false;
const bool isImplicitlyDeclared = true;
const bool isDefined = false;
const clang::ObjCMethodDecl::ImplementationControl impControl =
Expand All @@ -8500,7 +8501,8 @@ bool ClangASTContext::AddObjCClassProperty(
*clang_ast, clang::SourceLocation(), clang::SourceLocation(),
getter_sel, ClangUtil::GetQualType(property_clang_type_to_access),
nullptr, class_interface_decl, isInstance, isVariadic,
isSynthesized, isImplicitlyDeclared, isDefined, impControl,
isPropertyAccessor, isSynthesizedAccessorStub,
isImplicitlyDeclared, isDefined, impControl,
HasRelatedResultType);

if (getter && metadata)
Expand All @@ -8521,7 +8523,8 @@ bool ClangASTContext::AddObjCClassProperty(
: class_interface_decl->lookupClassMethod(setter_sel))) {
clang::QualType result_type = clang_ast->VoidTy;
const bool isVariadic = false;
const bool isSynthesized = false;
const bool isPropertyAccessor = true;
const bool isSynthesizedAccessorStub = false;
const bool isImplicitlyDeclared = true;
const bool isDefined = false;
const clang::ObjCMethodDecl::ImplementationControl impControl =
Expand All @@ -8531,8 +8534,9 @@ bool ClangASTContext::AddObjCClassProperty(
clang::ObjCMethodDecl *setter = clang::ObjCMethodDecl::Create(
*clang_ast, clang::SourceLocation(), clang::SourceLocation(),
setter_sel, result_type, nullptr, class_interface_decl,
isInstance, isVariadic, isSynthesized, isImplicitlyDeclared,
isDefined, impControl, HasRelatedResultType);
isInstance, isVariadic, isPropertyAccessor,
isSynthesizedAccessorStub, isImplicitlyDeclared, isDefined,
impControl, HasRelatedResultType);

if (setter && metadata)
ClangASTContext::SetMetadata(clang_ast, setter, *metadata);
Expand Down Expand Up @@ -8634,10 +8638,16 @@ clang::ObjCMethodDecl *ClangASTContext::AddMethodToObjCObjectType(
if (!method_function_prototype)
return nullptr;

bool is_synthesized = false;
bool is_defined = false;
clang::ObjCMethodDecl::ImplementationControl imp_control =
const bool isInstance = (name[0] == '-');
const bool isVariadic = false;
const bool isPropertyAccessor = false;
const bool isSynthesizedAccessorStub = false;
/// Force this to true because we don't have source locations.
const bool isImplicitlyDeclared = true;
const bool isDefined = false;
const clang::ObjCMethodDecl::ImplementationControl impControl =
clang::ObjCMethodDecl::None;
const bool HasRelatedResultType = false;

const unsigned num_args = method_function_prototype->getNumParams();

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

if (objc_method_decl == nullptr)
return nullptr;
Expand Down

0 comments on commit 454acae

Please sign in to comment.