summaryrefslogtreecommitdiffhomepage
path: root/demangle/demangle.cpp
blob: f3cfd2311d5fc7900153027cfebc6122d470d8e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "demangle.h"
#include <cstdlib>
#include <string>
#include "llvm/Demangle/Demangle.h"

using namespace Corrade::Containers;

String demangle_symbol(const char* symbol)
{
    if (!symbol || !*symbol)
        return {};
    if (const auto str = llvm::demangle(symbol); !str.empty())
        return String{str.data(), str.size()};
    return {};
}