aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Demangle/Demangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Demangle/Demangle.cpp')
-rw-r--r--llvm/lib/Demangle/Demangle.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Demangle/Demangle.cpp b/llvm/lib/Demangle/Demangle.cpp
index 000f75b..1851fb7 100644
--- a/llvm/lib/Demangle/Demangle.cpp
+++ b/llvm/lib/Demangle/Demangle.cpp
@@ -19,10 +19,17 @@ static bool isItaniumEncoding(const std::string &MangledName) {
return Pos > 0 && Pos <= 4 && MangledName[Pos] == 'Z';
}
+static bool isRustEncoding(const std::string &MangledName) {
+ return MangledName.size() >= 2 && MangledName[0] == '_' &&
+ MangledName[1] == 'R';
+}
+
std::string llvm::demangle(const std::string &MangledName) {
char *Demangled;
if (isItaniumEncoding(MangledName))
Demangled = itaniumDemangle(MangledName.c_str(), nullptr, nullptr, nullptr);
+ else if (isRustEncoding(MangledName))
+ Demangled = rustDemangle(MangledName.c_str(), nullptr, nullptr, nullptr);
else
Demangled = microsoftDemangle(MangledName.c_str(), nullptr, nullptr,
nullptr, nullptr);