[lldb][NFC] Remove unused method RichManglingContext::IsFunction
authorAlex Langford <apl@fb.com>
Mon, 23 Aug 2021 18:31:36 +0000 (11:31 -0700)
committerAlex Langford <apl@fb.com>
Mon, 23 Aug 2021 18:45:55 +0000 (11:45 -0700)
lldb/include/lldb/Core/RichManglingContext.h
lldb/source/Core/RichManglingContext.cpp
lldb/unittests/Core/RichManglingContextTest.cpp

index 48102ec..a6b7af8 100644 (file)
@@ -42,9 +42,6 @@ public:
   /// 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().
index 2dcb140..63170fe 100644 (file)
@@ -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)) {
index f8a0bbf..89e9ef0 100644 (file)
@@ -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());