aboutsummaryrefslogtreecommitdiff
path: root/libcxxabi
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
commitac6a801ccab90cc1889f6ababb1b44dbdee2baf7 (patch)
tree0764f1d2e049d715806528900075cd0766d90a1c /libcxxabi
parentd379f39e18ca26c63fa725b4a214ec7006862948 (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 llvm-svn: 339580
Diffstat (limited to 'libcxxabi')
-rw-r--r--libcxxabi/src/cxa_demangle.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp
index 3a7ee061c94d..9f58a0c6e4c1 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 <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':