Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_Demangle.H
Go to the documentation of this file.
1#ifndef AMREX_DEMANGLE_H_
2#define AMREX_DEMANGLE_H_
3#include <AMReX_Config.H>
4
10#include <string>
11
12#if __has_include(<cxxabi.h>)
13# include <cxxabi.h>
14# include <cstdlib>
15# define AMREX_USE_CXXABI
16#endif
17
18namespace amrex {
19
31inline std::string demangle (const char* name)
32{
33#ifdef AMREX_USE_CXXABI
34 int status;
35 char* p = abi::__cxa_demangle(name, nullptr, nullptr, &status);
36 if (p) {
37 std::string s(p);
38 std::free(p);
39 return s;
40 } else
41#endif
42 {
43 return name;
44 }
45}
46
47}
48
49#endif
Definition AMReX_Amr.cpp:50
std::string demangle(const char *name)
Demangle C++ name.
Definition AMReX_Demangle.H:31