From ac6a801ccab90cc1889f6ababb1b44dbdee2baf7 Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Mon, 13 Aug 2018 16:37:47 +0000 Subject: [itanium demangler] Add llvm::itaniumFindTypesInMangledName() This function calls a callback whenever a is parsed. This is necessary to implement FindAlternateFunctionManglings in LLDB, which uses a similar hack in FastDemangle. Once that function has been updated to use this version, FastDemangle can finally be removed. Differential revision: https://reviews.llvm.org/D50586 llvm-svn: 339580 --- libcxxabi/src/cxa_demangle.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libcxxabi') diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp index 3a7ee061c94..9f58a0c6e4c 100644 --- a/libcxxabi/src/cxa_demangle.cpp +++ b/libcxxabi/src/cxa_demangle.cpp @@ -1976,6 +1976,9 @@ struct Db { // 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; @@ -3218,6 +3221,9 @@ Node *Db::parseQualifiedType() { Node *Db::parseType() { Node *Result = nullptr; + if (TypeCallback != nullptr) + TypeCallback(TypeCallbackContext, First); + switch (look()) { // ::= case 'r': -- cgit v1.2.3