-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++] Remove dead code in legacy_debug_handler.cpp #68155
[libc++] Remove dead code in legacy_debug_handler.cpp #68155
Conversation
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.
@llvm/pr-subscribers-libcxx ChangesWe removed all traces of the legacy debug mode a while back, but we forgot to remove the actual Full diff: https://github.com/llvm/llvm-project/pull/68155.diff 2 Files Affected:
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 34b647a3bd2123c..308bb5b78fd5a0e 100644
--- a/libcxx/utils/data/ignore_format.txt
+++ b/libcxx/utils/data/ignore_format.txt
@@ -524,7 +524,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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming CI passes.
LGTM. |
@huixie90 FYI It doesn't seem to fail reliably, but it would be a good idea to investigate. |
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.