[Lldb-commits] [lldb] 454acae - Adapt LLDB to clang API change in ObjCMethodDecl::create().

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 8 08:59:29 PST 2019


Author: Adrian Prantl
Date: 2019-11-08T08:59:22-08:00
New Revision: 454acae97ca4ad25cac582afe66c616ad46e4dd1

URL: https://github.com/llvm/llvm-project/commit/454acae97ca4ad25cac582afe66c616ad46e4dd1
DIFF: https://github.com/llvm/llvm-project/commit/454acae97ca4ad25cac582afe66c616ad46e4dd1.diff

LOG: Adapt LLDB to clang API change in ObjCMethodDecl::create().

Added: 
    

Modified: 
    lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
    lldb/source/Symbol/ClangASTContext.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
index 1f27a4f0b3ed..e13b0d1b0cd2 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
@@ -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 =
@@ -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;
 

diff  --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 31b62ebb615e..5c7000ac2f36 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -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 =
@@ -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)
@@ -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 =
@@ -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);
@@ -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();
 
@@ -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;


        


More information about the lldb-commits mailing list