[libcxx-commits] [libcxx] 2848125 - [libc++] Remove dead code in legacy_debug_handler.cpp (#68155)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 4 08:38:40 PDT 2023
Author: Louis Dionne
Date: 2023-10-04T11:38:35-04:00
New Revision: 2848125c6c224edf6a41b9cdd2140340e5a24562
URL: https://github.com/llvm/llvm-project/commit/2848125c6c224edf6a41b9cdd2140340e5a24562
DIFF: https://github.com/llvm/llvm-project/commit/2848125c6c224edf6a41b9cdd2140340e5a24562.diff
LOG: [libc++] Remove dead code in legacy_debug_handler.cpp (#68155)
We removed all traces of the legacy debug mode a while back, but we
forgot to remove the actual `.cpp` file that implemented the legacy
debug handler. The file is not referenced from anywhere so this is
effectively a NFC.
Added:
Modified:
libcxx/utils/data/ignore_format.txt
Removed:
libcxx/src/legacy_debug_handler.cpp
################################################################################
diff --git a/libcxx/src/legacy_debug_handler.cpp b/libcxx/src/legacy_debug_handler.cpp
deleted file mode 100644
index cb2025bfc9b6d7a..000000000000000
--- a/libcxx/src/legacy_debug_handler.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include <__config>
-#include <cstdio>
-#include <cstdlib>
-#include <string>
-
-// This file defines the legacy default debug handler and related mechanisms
-// to set it. This is for backwards ABI compatibility with code that has been
-// using this debug handler previously.
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-struct _LIBCPP_TEMPLATE_VIS __libcpp_debug_info {
- _LIBCPP_EXPORTED_FROM_ABI string what() const;
-
- const char* __file_;
- int __line_;
- const char* __pred_;
- const char* __msg_;
-};
-
-std::string __libcpp_debug_info::what() const {
- string msg = __file_;
- msg += ":" + std::to_string(__line_) + ": _LIBCPP_ASSERT '";
- msg += __pred_;
- msg += "' failed. ";
- msg += __msg_;
- return msg;
-}
-
-_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __libcpp_abort_debug_function(__libcpp_debug_info const& info) {
- std::fprintf(stderr, "%s\n", info.what().c_str());
- std::abort();
-}
-
-typedef void (*__libcpp_debug_function_type)(__libcpp_debug_info const&);
-
-_LIBCPP_EXPORTED_FROM_ABI
-constinit __libcpp_debug_function_type __libcpp_debug_function = __libcpp_abort_debug_function;
-
-_LIBCPP_EXPORTED_FROM_ABI
-bool __libcpp_set_debug_function(__libcpp_debug_function_type __func) {
- __libcpp_debug_function = __func;
- return true;
-}
-
-_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/utils/data/ignore_format.txt b/libcxx/utils/data/ignore_format.txt
index 9c7ee455a4708d1..50bb890ed748f1b 100644
--- a/libcxx/utils/data/ignore_format.txt
+++ b/libcxx/utils/data/ignore_format.txt
@@ -523,7 +523,6 @@ libcxx/src/include/ryu/ryu.h
libcxx/src/include/sso_allocator.h
libcxx/src/ios.cpp
libcxx/src/iostream.cpp
-libcxx/src/legacy_debug_handler.cpp
libcxx/src/locale.cpp
libcxx/src/memory.cpp
libcxx/src/mutex.cpp
More information about the libcxx-commits
mailing list