aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Demangle/MicrosoftDemangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Demangle/MicrosoftDemangle.cpp')
-rw-r--r--llvm/lib/Demangle/MicrosoftDemangle.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp
index aa65f3b..6be8b0f 100644
--- a/llvm/lib/Demangle/MicrosoftDemangle.cpp
+++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp
@@ -24,6 +24,7 @@
#include <array>
#include <cctype>
#include <cstdio>
+#include <optional>
#include <string_view>
#include <tuple>
@@ -2428,6 +2429,24 @@ void Demangler::dumpBackReferences() {
std::printf("\n");
}
+std::optional<size_t>
+llvm::getArm64ECInsertionPointInMangledName(std::string_view MangledName) {
+ std::string_view ProcessedName{MangledName};
+
+ // We only support this for MSVC-style C++ symbols.
+ if (!consumeFront(ProcessedName, '?'))
+ return std::nullopt;
+
+ // The insertion point is just after the name of the symbol, so parse that to
+ // remove it from the processed name.
+ Demangler D;
+ D.demangleFullyQualifiedSymbolName(ProcessedName);
+ if (D.Error)
+ return std::nullopt;
+
+ return MangledName.length() - ProcessedName.length();
+}
+
char *llvm::microsoftDemangle(std::string_view MangledName, size_t *NMangled,
int *Status, MSDemangleFlags Flags) {
Demangler D;