diff --git a/CMakeLists.txt b/CMakeLists.txt index d8b7efb4..0f958cc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,7 +166,6 @@ set(XEUS_CPP_HEADERS include/xeus-cpp/xmagics.hpp include/xeus-cpp/xoptions.hpp include/xeus-cpp/xpreamble.hpp - #src/xdemangle.hpp #src/xinspect.hpp #src/xsystem.hpp #src/xparser.hpp diff --git a/src/xdemangle.hpp b/src/xdemangle.hpp deleted file mode 100644 index 98d40cee..00000000 --- a/src/xdemangle.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************************ - * Copyright (c) 2023, xeus-cpp contributors * - * Copyright (c) 2023, Johan Mabille, Loic Gouarin, Sylvain Corlay, Wolf Vollprecht * - * * - * Distributed under the terms of the BSD 3-Clause License. * - * * - * The full license is in the file LICENSE, distributed with this software. * - ************************************************************************************/ - -#ifndef XEUS_CPP_DEMANGLE_HPP -#define XEUS_CPP_DEMANGLE_HPP - -#include -#include - -// __has_include is currently supported by GCC and Clang. However GCC 4.9 may have issues and -// returns 1 for 'defined( __has_include )', while '__has_include' is actually not supported: -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63662 -#if defined(__has_include) && (!defined(__GNUC__) || (__GNUC__ + 0) >= 5) -#if __has_include() -#define XEUS_HAS_CXXABI_H -#endif -#elif defined(__GLIBCXX__) || defined(__GLIBCPP__) -#define XEUS_HAS_CXXABI_H -#endif - -#if defined(XEUS_HAS_CXXABI_H) -#include -// For some archtectures (mips, mips64, x86, x86_64) cxxabi.h in Android NDK is implemented by gabi++ library -// (https://android.googlesource.com/platform/ndk/+/master/sources/cxx-stl/gabi++/), which does not implement -// abi::__cxa_demangle(). We detect this implementation by checking the include guard here. -#if defined(_GABIXX_CXXABI_H__) -#undef XEUS_HAS_CXXABI_H -#else -#include -#endif -#endif - -namespace xcpp -{ - const char* demangle(const char* name) noexcept; - const char* demangle(const std::string& name) noexcept; - -#if defined(XEUS_HAS_CXXABI_H) - - inline const char* demangle(const char* name) noexcept - { - std::size_t size = 0; - int status = 0; - return abi::__cxa_demangle(name, 0, &size, &status); - } - - inline const char* demangle(const std::string& name) noexcept - { - std::size_t size = 0; - int status = 0; - return abi::__cxa_demangle(name.c_str(), 0, &size, &status); - } - -#else - - inline const char* demangle(const char* name) noexcept - { - return name; - } - - inline const char* demangle(const std::string& name) noexcept - { - return demangle(name.c_str()); - } - -#endif -} - -#endif diff --git a/src/xinspect.hpp b/src/xinspect.hpp index bdc4a13e..c512f35f 100644 --- a/src/xinspect.hpp +++ b/src/xinspect.hpp @@ -19,7 +19,6 @@ #include "xeus-cpp/xpreamble.hpp" #include "xeus-cpp/xutils.hpp" -#include "xdemangle.hpp" #include "xparser.hpp" #include "clang/Interpreter/CppInterOp.h"