diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2018-08-13 16:37:47 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2018-08-13 16:37:47 +0000 |
commit | 5ae98d1db6c4450f1e5e22b33b028b4124bd1663 (patch) | |
tree | ec2a322b63ea19ca44fb5be60700aba04f405135 /libcxxabi/src | |
parent | 6f00db355e93946b6bcf9afae8b53eb1659f37e5 (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
Diffstat (limited to 'libcxxabi/src')
-rw-r--r-- | libcxxabi/src/cxa_demangle.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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 <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': |