Skip to content

[lldb][DWARFASTParserClang][NFC] Remove redundant parameter to AddMethodToObjCObjectType #73832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Michael137
Copy link
Member

This parameter isn't used (neither in upstream LLVM nor in the Apple fork). This patch removes it.

This parameter seems to have been unused since its introduction in 0fffff581665b768d100eece196e59b00eb16e7e.

This gets us a step closer to making ParsedDWARFTypeAttributes a const, which will make this function easier to refactor in upcoming patches.

…hodToObjCObjectType

This parameter isn't used (neither in upstream LLVM
nor in the Apple fork). This patch removes it.

This parameter seems to have been unused since its
introduction in `0fffff581665b768d100eece196e59b00eb16e7e`.

This gets us a step closer to making `ParsedDWARFTypeAttributes`
a `const`, which will make this function easier to refactor
in upcoming patches.
@llvmbot
Copy link
Member

llvmbot commented Nov 29, 2023

@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)

Changes

This parameter isn't used (neither in upstream LLVM nor in the Apple fork). This patch removes it.

This parameter seems to have been unused since its introduction in 0fffff581665b768d100eece196e59b00eb16e7e.

This gets us a step closer to making ParsedDWARFTypeAttributes a const, which will make this function easier to refactor in upcoming patches.


Full diff: https://github.com/llvm/llvm-project/pull/73832.diff

4 Files Affected:

  • (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (+1-7)
  • (modified) lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp (+2-2)
  • (modified) lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h (+2-2)
  • (modified) lldb/unittests/Symbol/TestTypeSystemClang.cpp (+1-2)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 4d7d27b64e4c7f2..3d722033c824db4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -1090,16 +1090,10 @@ TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
         }
 
         if (class_opaque_type) {
-          // If accessibility isn't set to anything valid, assume public
-          // for now...
-          if (attrs.accessibility == eAccessNone)
-            attrs.accessibility = eAccessPublic;
-
           clang::ObjCMethodDecl *objc_method_decl =
               m_ast.AddMethodToObjCObjectType(
                   class_opaque_type, attrs.name.GetCString(), clang_type,
-                  attrs.accessibility, attrs.is_artificial, is_variadic,
-                  attrs.is_objc_direct_call);
+                  attrs.is_artificial, is_variadic, attrs.is_objc_direct_call);
           type_handled = objc_method_decl != nullptr;
           if (type_handled) {
             LinkDeclContextToDIE(objc_method_decl, die);
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 6f65587c4acedd1..7c28935f5741c54 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -8110,8 +8110,8 @@ clang::ObjCMethodDecl *TypeSystemClang::AddMethodToObjCObjectType(
     const char *name, // the full symbol name as seen in the symbol table
                       // (lldb::opaque_compiler_type_t type, "-[NString
                       // stringWithCString:]")
-    const CompilerType &method_clang_type, lldb::AccessType access,
-    bool is_artificial, bool is_variadic, bool is_objc_direct_call) {
+    const CompilerType &method_clang_type, bool is_artificial, bool is_variadic,
+    bool is_objc_direct_call) {
   if (!type || !method_clang_type.IsValid())
     return nullptr;
 
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index 0ec2d026e996105..19f267396e0f0e5 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -985,8 +985,8 @@ class TypeSystemClang : public TypeSystem {
       const char *name, // the full symbol name as seen in the symbol table
                         // (lldb::opaque_compiler_type_t type, "-[NString
                         // stringWithCString:]")
-      const CompilerType &method_compiler_type, lldb::AccessType access,
-      bool is_artificial, bool is_variadic, bool is_objc_direct_call);
+      const CompilerType &method_compiler_type, bool is_artificial,
+      bool is_variadic, bool is_objc_direct_call);
 
   static bool SetHasExternalStorage(lldb::opaque_compiler_type_t type,
                                     bool has_extern);
diff --git a/lldb/unittests/Symbol/TestTypeSystemClang.cpp b/lldb/unittests/Symbol/TestTypeSystemClang.cpp
index c83e6ed1d418922..30d20b9587f9130 100644
--- a/lldb/unittests/Symbol/TestTypeSystemClang.cpp
+++ b/lldb/unittests/Symbol/TestTypeSystemClang.cpp
@@ -941,8 +941,7 @@ TEST_F(TestTypeSystemClang, AddMethodToObjCObjectType) {
   bool artificial = false;
   bool objc_direct = false;
   clang::ObjCMethodDecl *method = TypeSystemClang::AddMethodToObjCObjectType(
-      c, "-[A foo]", func_type, lldb::eAccessPublic, artificial, variadic,
-      objc_direct);
+      c, "-[A foo]", func_type, artificial, variadic, objc_direct);
   ASSERT_NE(method, nullptr);
 
   // The interface decl should still have external lexical storage.

@Michael137 Michael137 merged commit bcb621f into llvm:main Nov 30, 2023
@Michael137 Michael137 deleted the lldb/nfc/parse-subroutine-cleanup/remove-redundant-param branch November 30, 2023 05:16
Michael137 added a commit to Michael137/llvm-project that referenced this pull request Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants