diff --git a/include/llvm/Demangle/Demangle.h b/include/llvm/Demangle/Demangle.h index b9b4d158e2a..4c9dc9569e1 100644 --- a/include/llvm/Demangle/Demangle.h +++ b/include/llvm/Demangle/Demangle.h @@ -31,11 +31,6 @@ enum : int { char *itaniumDemangle(const char *mangled_name, char *buf, size_t *n, int *status); -/// Calls the callback \c Callback with \c Ctx as an argument whenever a type is -/// encountered. Returns true if \c MangledName couldn't be parsed. -bool itaniumFindTypesInMangledName(const char *MangledName, void *Ctx, - void (*Callback)(void *, const char *)); - enum MSDemangleFlags { MSDF_None = 0, MSDF_DumpBackrefs = 1 << 0 }; char *microsoftDemangle(const char *mangled_name, char *buf, size_t *n, diff --git a/include/llvm/Demangle/ItaniumDemangle.h b/include/llvm/Demangle/ItaniumDemangle.h index c5619a15bbe..0b9187f30a5 100644 --- a/include/llvm/Demangle/ItaniumDemangle.h +++ b/include/llvm/Demangle/ItaniumDemangle.h @@ -2157,9 +2157,6 @@ template struct AbstractManglingParser { // conversion operator's type, and are resolved in the enclosing . PODSmallVector ForwardTemplateRefs; - void (*TypeCallback)(void *, const char *) = nullptr; - void *TypeCallbackContext = nullptr; - bool TryToParseTemplateArgs = true; bool PermitForwardTemplateReferences = false; bool ParsingLambdaParams = false; @@ -3453,9 +3450,6 @@ template Node *AbstractManglingParser::parseType() { Node *Result = nullptr; - if (TypeCallback != nullptr) - TypeCallback(TypeCallbackContext, First); - switch (look()) { // ::= case 'r': diff --git a/lib/Demangle/ItaniumDemangle.cpp b/lib/Demangle/ItaniumDemangle.cpp index e3bd3b87633..b2de0be2b70 100644 --- a/lib/Demangle/ItaniumDemangle.cpp +++ b/lib/Demangle/ItaniumDemangle.cpp @@ -356,15 +356,6 @@ char *llvm::itaniumDemangle(const char *MangledName, char *Buf, return InternalStatus == demangle_success ? Buf : nullptr; } -bool llvm::itaniumFindTypesInMangledName(const char *MangledName, void *Ctx, - void (*Callback)(void *, - const char *)) { - Demangler Parser(MangledName, MangledName + std::strlen(MangledName)); - Parser.TypeCallback = Callback; - Parser.TypeCallbackContext = Ctx; - return Parser.parse() == nullptr; -} - ItaniumPartialDemangler::ItaniumPartialDemangler() : RootNode(nullptr), Context(new Demangler{nullptr, nullptr}) {} diff --git a/unittests/Demangle/CMakeLists.txt b/unittests/Demangle/CMakeLists.txt index 2f9d71a37e9..954f3d05eac 100644 --- a/unittests/Demangle/CMakeLists.txt +++ b/unittests/Demangle/CMakeLists.txt @@ -6,5 +6,4 @@ set(LLVM_LINK_COMPONENTS add_llvm_unittest(DemangleTests ItaniumDemangleTest.cpp PartialDemangleTest.cpp - FindTypesInMangledNameTest.cpp ) diff --git a/unittests/Demangle/FindTypesInMangledNameTest.cpp b/unittests/Demangle/FindTypesInMangledNameTest.cpp deleted file mode 100644 index a2f77dc6d96..00000000000 --- a/unittests/Demangle/FindTypesInMangledNameTest.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//===------------------ FindTypesInMangledNameTest.cpp --------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include -#include -#include "llvm/Demangle/Demangle.h" -#include "gtest/gtest.h" - -TEST(FindTypesInMangledNameTest, Test) { - std::vector Types; - const char *Mangled = "_Z1fiv"; - EXPECT_FALSE(llvm::itaniumFindTypesInMangledName( - Mangled, static_cast(&Types), [](void *Ty, const char *P) { - static_cast *>(Ty)->push_back(P); - })); - EXPECT_EQ(Types.size(), size_t(2)); - EXPECT_EQ(Mangled + 4, Types.front()); - EXPECT_EQ(Mangled + 5, Types.back()); - - EXPECT_TRUE(llvm::itaniumFindTypesInMangledName( - "Not a mangled name!", nullptr, [](void *, const char *) {})); - - int TC = 0; - EXPECT_FALSE(llvm::itaniumFindTypesInMangledName( - "_Z1fPRic", static_cast(&TC), - [](void *Ctx, const char *) { ++*static_cast(Ctx); })); - EXPECT_EQ(TC, 4); // pointer, reference, int, char. -}