Demangle the name of components when a GNU/Clang compiler is being used

This commit is contained in:
Username404 2021-10-29 00:10:49 +02:00
parent c123965098
commit ac12773e6c
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 10 additions and 1 deletions

View File

@ -10,6 +10,9 @@
#include <unordered_map>
#include <typeindex>
#include <optional>
#ifdef __GNUC__
#include <cxxabi.h>
#endif
#include "../parsing/ParseComponents.hpp"
@ -86,7 +89,13 @@ public:
const optional<task>& currentTask = taskMap.at(id);
if (currentTask.has_value()) currentTask.value()(tree, i);
} catch (const out_of_range&) {
throw Yerbacon::Exception(string(id.name()) += " is not supported by the current target");
throw Yerbacon::Exception(string(
#ifndef __GNUC__
id.name()
#else
abi::__cxa_demangle(id.name(), nullptr, nullptr, nullptr)
#endif
) += " is not supported by the current target");
}
}
return output.str();