summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2018-08-13 16:37:47 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2018-08-13 16:37:47 +0000
commit357347f66eacbc685a6b4fe9b0ec621f21ab913e (patch)
tree6c1512d1a80615677a82aceabef6e104c2703b85
parent26bf8491be71665300cdf18282b3da038e73bf51 (diff)
[itanium demangler] Add llvm::itaniumFindTypesInMangledName()
This function calls a callback whenever a <type> 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 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@339580 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--src/cxa_demangle.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cxa_demangle.cpp b/src/cxa_demangle.cpp
index 3a7ee06..9f58a0c 100644
--- a/src/cxa_demangle.cpp
+++ b/src/cxa_demangle.cpp
@@ -1976,6 +1976,9 @@ struct Db {
// conversion operator's type, and are resolved in the enclosing <encoding>.
PODSmallVector<ForwardTemplateReference *, 4> 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()) {
// ::= <qualified-type>
case 'r':