[lldb] Remove unused portion of GetFunctionMethodInfo signature (NFC)
authorDave Lee <davelee.com@gmail.com>
Sun, 5 Mar 2023 01:14:50 +0000 (17:14 -0800)
committerDave Lee <davelee.com@gmail.com>
Sun, 5 Mar 2023 03:35:57 +0000 (19:35 -0800)
This applies to IsClassMethod as well.

lldb/include/lldb/Symbol/CompilerDeclContext.h
lldb/include/lldb/Symbol/SymbolContext.h
lldb/include/lldb/Symbol/TypeSystem.h
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
lldb/source/Symbol/CompilerDeclContext.cpp
lldb/source/Symbol/SymbolContext.cpp
lldb/source/Target/StackFrame.cpp

index 87d4ca3..ca404a6 100644 (file)
@@ -61,16 +61,6 @@ public:
 
   /// Checks if this decl context represents a method of a class.
   ///
-  /// \param[out] language_ptr
-  ///     If non NULL and \b true is returned from this function,
-  ///     this will indicate if the language that respresents the method.
-  ///
-  /// \param[out] is_instance_method_ptr
-  ///     If non NULL and \b true is returned from this function,
-  ///     this will indicate if the method is an instance function (true)
-  ///     or a class method (false indicating the function is static, or
-  ///     doesn't require an instance of the class to be called).
-  ///
   /// \param[out] language_object_name_ptr
   ///     If non NULL and \b true is returned from this function,
   ///     this will indicate if implicit object name for the language
@@ -79,9 +69,7 @@ public:
   /// \return
   ///     Returns true if this is a decl context that represents a method
   ///     in a struct, union or class.
-  bool IsClassMethod(lldb::LanguageType *language_ptr,
-                     bool *is_instance_method_ptr,
-                     ConstString *language_object_name_ptr);
+  bool IsClassMethod(ConstString *language_object_name_ptr = nullptr);
 
   /// Check if the given other decl context is contained in the lookup
   /// of this decl context (for example because the other context is a nested
index cac951b..bb9e031 100644 (file)
@@ -248,13 +248,6 @@ public:
   /// If this symbol context represents a function that is a method, return
   /// true and provide information about the method.
   ///
-  /// \param[out] language
-  ///     If \b true is returned, the language for the method.
-  ///
-  /// \param[out] is_instance_method
-  ///     If \b true is returned, \b true if this is a instance method,
-  ///     \b false if this is a static/class function.
-  ///
   /// \param[out] language_object_name
   ///     If \b true is returned, the name of the artificial variable
   ///     for the language ("this" for C++, "self" for ObjC).
@@ -262,9 +255,7 @@ public:
   /// \return
   ///     \b True if this symbol context represents a function that
   ///     is a method of a class, \b false otherwise.
-  bool GetFunctionMethodInfo(lldb::LanguageType &language,
-                             bool &is_instance_method,
-                             ConstString &language_object_name);
+  bool GetFunctionMethodInfo(ConstString &language_object_name);
 
   /// Sorts the types in TypeMap according to SymbolContext to TypeList
   ///
index 9c27fd9..7681a70 100644 (file)
@@ -127,9 +127,9 @@ public:
   virtual ConstString
   DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) = 0;
 
-  virtual bool DeclContextIsClassMethod(
-      void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
-      bool *is_instance_method_ptr, ConstString *language_object_name_ptr) = 0;
+  virtual bool
+  DeclContextIsClassMethod(void *opaque_decl_ctx,
+                           ConstString *language_object_name_ptr) = 0;
 
   virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
                                               void *other_opaque_decl_ctx) = 0;
index c573b8b..d478b08 100644 (file)
@@ -1172,8 +1172,7 @@ SymbolContextList ClangExpressionDeclMap::SearchFunctionsInSymbolContexts(
     // class/instance methods, since they'll be skipped in the code that
     // follows anyway.
     CompilerDeclContext func_decl_context = function->GetDeclContext();
-    if (!func_decl_context ||
-        func_decl_context.IsClassMethod(nullptr, nullptr, nullptr))
+    if (!func_decl_context || func_decl_context.IsClassMethod())
       continue;
     // We can only prune functions for which we can copy the type.
     CompilerType func_clang_type = function->GetType()->GetFullCompilerType();
@@ -1307,7 +1306,7 @@ void ClangExpressionDeclMap::LookupFunction(
           continue;
 
         // Filter out class/instance methods.
-        if (decl_ctx.IsClassMethod(nullptr, nullptr, nullptr))
+        if (decl_ctx.IsClassMethod())
           continue;
 
         AddOneFunction(context, sym_ctx.function, nullptr);
index aefc67b..f26147e 100644 (file)
@@ -9751,36 +9751,25 @@ TypeSystemClang::DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) {
 }
 
 bool TypeSystemClang::DeclContextIsClassMethod(
-    void *opaque_decl_ctx, lldb::LanguageType *language_ptr,
-    bool *is_instance_method_ptr, ConstString *language_object_name_ptr) {
+    void *opaque_decl_ctx, ConstString *language_object_name_ptr) {
   if (opaque_decl_ctx) {
     clang::DeclContext *decl_ctx = (clang::DeclContext *)opaque_decl_ctx;
     if (ObjCMethodDecl *objc_method =
             llvm::dyn_cast<clang::ObjCMethodDecl>(decl_ctx)) {
-      if (is_instance_method_ptr)
-        *is_instance_method_ptr = objc_method->isInstanceMethod();
-      if (language_ptr)
-        *language_ptr = eLanguageTypeObjC;
-      if (language_object_name_ptr)
-        language_object_name_ptr->SetCString("self");
+      if (objc_method->isInstanceMethod())
+        if (language_object_name_ptr)
+          language_object_name_ptr->SetCString("self");
       return true;
     } else if (CXXMethodDecl *cxx_method =
                    llvm::dyn_cast<clang::CXXMethodDecl>(decl_ctx)) {
-      if (is_instance_method_ptr)
-        *is_instance_method_ptr = cxx_method->isInstance();
-      if (language_ptr)
-        *language_ptr = eLanguageTypeC_plus_plus;
-      if (language_object_name_ptr)
-        language_object_name_ptr->SetCString("this");
+      if (cxx_method->isInstance())
+        if (language_object_name_ptr)
+          language_object_name_ptr->SetCString("this");
       return true;
     } else if (clang::FunctionDecl *function_decl =
                    llvm::dyn_cast<clang::FunctionDecl>(decl_ctx)) {
       ClangASTMetadata *metadata = GetMetadata(function_decl);
       if (metadata && metadata->HasObjectPtr()) {
-        if (is_instance_method_ptr)
-          *is_instance_method_ptr = true;
-        if (language_ptr)
-          *language_ptr = eLanguageTypeObjC;
         if (language_object_name_ptr)
           language_object_name_ptr->SetCString(metadata->GetObjectPtrName());
         return true;
index d6c09cf..99021f9 100644 (file)
@@ -580,8 +580,6 @@ public:
   ConstString DeclContextGetScopeQualifiedName(void *opaque_decl_ctx) override;
 
   bool DeclContextIsClassMethod(void *opaque_decl_ctx,
-                                lldb::LanguageType *language_ptr,
-                                bool *is_instance_method_ptr,
                                 ConstString *language_object_name_ptr) override;
 
   bool DeclContextIsContainedInLookup(void *opaque_decl_ctx,
index a3af568..5b3049f 100644 (file)
@@ -34,13 +34,10 @@ ConstString CompilerDeclContext::GetScopeQualifiedName() const {
   return ConstString();
 }
 
-bool CompilerDeclContext::IsClassMethod(lldb::LanguageType *language_ptr,
-                                        bool *is_instance_method_ptr,
-                                        ConstString *language_object_name_ptr) {
+bool CompilerDeclContext::IsClassMethod(ConstString *language_object_name_ptr) {
   if (IsValid())
-    return m_type_system->DeclContextIsClassMethod(
-        m_opaque_decl_ctx, language_ptr, is_instance_method_ptr,
-        language_object_name_ptr);
+    return m_type_system->DeclContextIsClassMethod(m_opaque_decl_ctx,
+                                                   language_object_name_ptr);
   return false;
 }
 
index 2ccc248..8453c1f 100644 (file)
@@ -539,17 +539,12 @@ Block *SymbolContext::GetFunctionBlock() {
   return nullptr;
 }
 
-bool SymbolContext::GetFunctionMethodInfo(lldb::LanguageType &language,
-                                          bool &is_instance_method,
-                                          ConstString &language_object_name)
-
-{
+bool SymbolContext::GetFunctionMethodInfo(ConstString &language_object_name) {
   Block *function_block = GetFunctionBlock();
   if (function_block) {
     CompilerDeclContext decl_ctx = function_block->GetDeclContext();
     if (decl_ctx)
-      return decl_ctx.IsClassMethod(&language, &is_instance_method,
-                                    &language_object_name);
+      return decl_ctx.IsClassMethod(&language_object_name);
   }
   return false;
 }
index c04b58e..fa74b5d 100644 (file)
@@ -567,12 +567,9 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
     // Check for direct ivars access which helps us with implicit access to
     // ivars using "this" or "self".
     GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock);
-    lldb::LanguageType method_language = eLanguageTypeUnknown;
-    bool is_instance_method = false;
     ConstString method_object_name;
-    if (m_sc.GetFunctionMethodInfo(method_language, is_instance_method,
-                                   method_object_name)) {
-      if (is_instance_method && method_object_name) {
+    if (m_sc.GetFunctionMethodInfo(method_object_name)) {
+      if (method_object_name) {
         var_sp = variable_list->FindVariable(method_object_name);
         if (var_sp) {
           separator_idx = 0;