impr: Handle demangling of identifiers without leading underscore

This commit is contained in:
WerWolv
2024-07-11 20:38:22 +02:00
parent c311b5315f
commit 1e18935513
7 changed files with 37 additions and 8 deletions

View File

@@ -0,0 +1,17 @@
#include <content/helpers/demangle.hpp>
#include <llvm/Demangle/Demangle.h>
namespace hex::plugin::builtin {
std::string demangle(const std::string &mangled) {
std::string result = llvm::demangle(mangled);
if (result.empty() || result == mangled)
result = llvm::demangle("_" + mangled);
if (result.empty() || result == ("_" + mangled))
result = mangled;
return result;
}
}