From 23c19395c085306cf229341523b6a8909b3b70a9 Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Mon, 23 Aug 2021 11:31:36 -0700 Subject: [PATCH] [lldb][NFC] Remove unused method RichManglingContext::IsFunction --- lldb/include/lldb/Core/RichManglingContext.h | 3 --- lldb/source/Core/RichManglingContext.cpp | 13 ------------- lldb/unittests/Core/RichManglingContextTest.cpp | 8 -------- 3 files changed, 24 deletions(-) diff --git a/lldb/include/lldb/Core/RichManglingContext.h b/lldb/include/lldb/Core/RichManglingContext.h index 48102ec..a6b7af8 100644 --- a/lldb/include/lldb/Core/RichManglingContext.h +++ b/lldb/include/lldb/Core/RichManglingContext.h @@ -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" 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 2dcb140..63170fe 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(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 f8a0bbf..89e9ef0 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()); -- 2.7.4