[Lldb-commits] [lldb] 23c1939 - [lldb][NFC] Remove unused method RichManglingContext::IsFunction

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 23 11:46:03 PDT 2021


Author: Alex Langford
Date: 2021-08-23T11:45:55-07:00
New Revision: 23c19395c085306cf229341523b6a8909b3b70a9

URL: https://github.com/llvm/llvm-project/commit/23c19395c085306cf229341523b6a8909b3b70a9
DIFF: https://github.com/llvm/llvm-project/commit/23c19395c085306cf229341523b6a8909b3b70a9.diff

LOG: [lldb][NFC] Remove unused method RichManglingContext::IsFunction

Added: 
    

Modified: 
    lldb/include/lldb/Core/RichManglingContext.h
    lldb/source/Core/RichManglingContext.cpp
    lldb/unittests/Core/RichManglingContextTest.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/RichManglingContext.h b/lldb/include/lldb/Core/RichManglingContext.h
index 48102ec0b1cf8..a6b7af8d8d7ec 100644
--- a/lldb/include/lldb/Core/RichManglingContext.h
+++ b/lldb/include/lldb/Core/RichManglingContext.h
@@ -42,9 +42,6 @@ class RichManglingContext {
   /// If this symbol describes a constructor or destructor.
   bool IsCtorOrDtor() const;
 
-  /// If this symbol describes a function.
-  bool IsFunction() const;
-
   /// Get the base name of a function. This doesn't include trailing template
   /// arguments, ie "a::b<int>" gives "b". The result will overwrite the
   /// internal buffer. It can be obtained via GetBufferRef().

diff  --git a/lldb/source/Core/RichManglingContext.cpp b/lldb/source/Core/RichManglingContext.cpp
index 2dcb1407e6c74..63170feb6231c 100644
--- a/lldb/source/Core/RichManglingContext.cpp
+++ b/lldb/source/Core/RichManglingContext.cpp
@@ -83,19 +83,6 @@ bool RichManglingContext::IsCtorOrDtor() const {
   llvm_unreachable("Fully covered switch above!");
 }
 
-bool RichManglingContext::IsFunction() const {
-  assert(m_provider != None && "Initialize a provider first");
-  switch (m_provider) {
-  case ItaniumPartialDemangler:
-    return m_ipd.isFunction();
-  case PluginCxxLanguage:
-    return get<CPlusPlusLanguage::MethodName>(m_cxx_method_parser)->IsValid();
-  case None:
-    return false;
-  }
-  llvm_unreachable("Fully covered switch above!");
-}
-
 void RichManglingContext::processIPDStrResult(char *ipd_res, size_t res_size) {
   // Error case: Clear the buffer.
   if (LLVM_UNLIKELY(ipd_res == nullptr)) {

diff  --git a/lldb/unittests/Core/RichManglingContextTest.cpp b/lldb/unittests/Core/RichManglingContextTest.cpp
index f8a0bbf9102b5..89e9ef03650f9 100644
--- a/lldb/unittests/Core/RichManglingContextTest.cpp
+++ b/lldb/unittests/Core/RichManglingContextTest.cpp
@@ -20,7 +20,6 @@ TEST(RichManglingContextTest, Basic) {
   ConstString mangled("_ZN3foo3barEv");
   EXPECT_TRUE(RMC.FromItaniumName(mangled));
 
-  EXPECT_TRUE(RMC.IsFunction());
   EXPECT_FALSE(RMC.IsCtorOrDtor());
 
   RMC.ParseFunctionDeclContextName();
@@ -42,7 +41,6 @@ TEST(RichManglingContextTest, FromCxxMethodName) {
   ConstString demangled("foo::bar()");
   EXPECT_TRUE(CxxMethodRMC.FromCxxMethodName(demangled));
 
-  EXPECT_TRUE(ItaniumRMC.IsFunction() == CxxMethodRMC.IsFunction());
   EXPECT_TRUE(ItaniumRMC.IsCtorOrDtor() == CxxMethodRMC.IsCtorOrDtor());
 
   ItaniumRMC.ParseFunctionDeclContextName();
@@ -61,9 +59,6 @@ TEST(RichManglingContextTest, FromCxxMethodName) {
   {
     RichManglingContext CxxMethodRMC;
     EXPECT_TRUE(CxxMethodRMC.FromCxxMethodName(ConstString("X")));
-
-    // We expect it is not a function.
-    EXPECT_FALSE(CxxMethodRMC.IsFunction());
   }
 
   // Construct with a function without a context.
@@ -72,9 +67,6 @@ TEST(RichManglingContextTest, FromCxxMethodName) {
     EXPECT_TRUE(CxxMethodRMC.FromCxxMethodName(
         ConstString("void * operator new(unsigned __int64)")));
 
-    // We expect it is a function.
-    EXPECT_TRUE(CxxMethodRMC.IsFunction());
-
     // We expect its context is empty.
     CxxMethodRMC.ParseFunctionDeclContextName();
     EXPECT_TRUE(CxxMethodRMC.GetBufferRef().empty());


        


More information about the lldb-commits mailing list