[libcxx-commits] [libcxx] [libc++] Remove dead code in legacy_debug_handler.cpp (PR #68155)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 3 13:17:29 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/68155.diff


2 Files Affected:

- (removed) libcxx/src/legacy_debug_handler.cpp (-54) 
- (modified) libcxx/utils/data/ignore_format.txt (-1) 


``````````diff
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

``````````

</details>


https://github.com/llvm/llvm-project/pull/68155


More information about the libcxx-commits mailing list