The API reference of abi::__cxa_demangle() can be found in libstdc++'s manual. https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01696.html
| 34 | // libstdc++'s manual. |
| 35 | // https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01696.html |
| 36 | string Demangle(const char *mangled) { |
| 37 | string demangled; |
| 38 | int status = 0; |
| 39 | char *result = nullptr; |
| 40 | #if HAS_CXA_DEMANGLE |
| 41 | result = abi::__cxa_demangle(mangled, nullptr, nullptr, &status); |
| 42 | #endif |
| 43 | if (status == 0 && result != nullptr) { // Demangling succeeded. |
| 44 | demangled.append(result); |
| 45 | free(result); |
| 46 | } |
| 47 | return demangled; |
| 48 | } |
| 49 | |
| 50 | } // namespace port |
| 51 | } // namespace stream_executor |