https://github.com/marcauberer updated 
https://github.com/llvm/llvm-project/pull/212987

>From fcccd603cc56cbbfb94b83ecdb1129d0a2793626 Mon Sep 17 00:00:00 2001
From: Claude <[email protected]>
Date: Thu, 30 Jul 2026 10:20:32 +0000
Subject: [PATCH 1/2] [ADT] Remove deprecated llvm::make_scope_exit

Update remaining call sites in lldb to construct llvm::scope_exit
directly, per the deprecation notice.
---
 lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm |  6 +++---
 lldb/source/Host/windows/DomainSocketWindows.cpp |  2 +-
 .../NativeRegisterContextWindows_arm64.cpp       |  8 ++++----
 llvm/include/llvm/ADT/ScopeExit.h                | 16 +---------------
 4 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm 
b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
index 5b3590f5e3f8d..8091e2d799914 100644
--- a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
+++ b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
@@ -1119,13 +1119,13 @@ static DataExtractorSP 
map_shared_cache_binary_segments(void *image) {
       path.size(), /*isDirectory=*/true);
   if (!url)
     return false;
-  auto url_cleanup = llvm::make_scope_exit([&]() { CFRelease(url); });
+  auto url_cleanup = llvm::scope_exit([&]() { CFRelease(url); });
 
   SecStaticCodeRef static_code = nullptr;
   if (SecStaticCodeCreateWithPath(url, kSecCSDefaultFlags, &static_code) !=
       errSecSuccess)
     return false;
-  auto code_cleanup = llvm::make_scope_exit([&]() { CFRelease(static_code); });
+  auto code_cleanup = llvm::scope_exit([&]() { CFRelease(static_code); });
 
   // Check that the signature chains to a trusted root CA.
   SecRequirementRef requirement = nullptr;
@@ -1133,7 +1133,7 @@ static DataExtractorSP 
map_shared_cache_binary_segments(void *image) {
                                      kSecCSDefaultFlags,
                                      &requirement) != errSecSuccess)
     return false;
-  auto req_cleanup = llvm::make_scope_exit([&]() { CFRelease(requirement); });
+  auto req_cleanup = llvm::scope_exit([&]() { CFRelease(requirement); });
 
   return SecStaticCodeCheckValidity(static_code, kSecCSDefaultFlags,
                                     requirement) == errSecSuccess;
diff --git a/lldb/source/Host/windows/DomainSocketWindows.cpp 
b/lldb/source/Host/windows/DomainSocketWindows.cpp
index eddc7a955ad38..ef87fe0831a0f 100644
--- a/lldb/source/Host/windows/DomainSocketWindows.cpp
+++ b/lldb/source/Host/windows/DomainSocketWindows.cpp
@@ -31,7 +31,7 @@ llvm::Expected<DomainSocket::Pair> 
DomainSocketWindows::CreatePair() {
   llvm::SmallString<128> path;
   llvm::sys::fs::createUniquePath(model, path, /*MakeAbsolute=*/false);
   auto remove_file =
-      llvm::make_scope_exit([&] { llvm::sys::fs::remove(path); });
+      llvm::scope_exit([&] { llvm::sys::fs::remove(path); });
 
   auto listen_socket =
       std::make_unique<DomainSocketWindows>(/*should_close=*/true);
diff --git 
a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
 
b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
index 8b1d7276d00bd..2a09c42531074 100644
--- 
a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
+++ 
b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
@@ -308,7 +308,7 @@ Status NativeRegisterContextWindows_arm64::GPRRead(const 
uint32_t reg,
 Status
 NativeRegisterContextWindows_arm64::GPRWrite(const uint32_t reg,
                                              const RegisterValue &reg_value) {
-  auto cleanup = llvm::make_scope_exit([&]() { m_context = nullptr; });
+  auto cleanup = llvm::scope_exit([&]() { m_context = nullptr; });
 
   PCONTEXT context = nullptr;
   DataBufferHeap context_buffer;
@@ -533,7 +533,7 @@ Status NativeRegisterContextWindows_arm64::FPRRead(const 
uint32_t reg,
 Status
 NativeRegisterContextWindows_arm64::FPRWrite(const uint32_t reg,
                                              const RegisterValue &reg_value) {
-  auto cleanup = llvm::make_scope_exit([&]() { m_context = nullptr; });
+  auto cleanup = llvm::scope_exit([&]() { m_context = nullptr; });
 
   PCONTEXT context = nullptr;
   DataBufferHeap context_buffer;
@@ -743,7 +743,7 @@ Status 
NativeRegisterContextWindows_arm64::ReadAllRegisterValues(
 
 Status NativeRegisterContextWindows_arm64::WriteAllRegisterValues(
     const lldb::DataBufferSP &data_sp) {
-  auto cleanup = llvm::make_scope_exit([&]() { m_context = nullptr; });
+  auto cleanup = llvm::scope_exit([&]() { m_context = nullptr; });
 
   Log *log = GetLog(WindowsLog::Registers);
   Status error;
@@ -796,7 +796,7 @@ llvm::Error 
NativeRegisterContextWindows_arm64::ReadHardwareDebugInfo() {
 
 llvm::Error
 NativeRegisterContextWindows_arm64::WriteHardwareDebugRegs(DREGType hwbType) {
-  auto cleanup = llvm::make_scope_exit([&]() { m_context = nullptr; });
+  auto cleanup = llvm::scope_exit([&]() { m_context = nullptr; });
 
   PCONTEXT context = nullptr;
   DataBufferHeap context_buffer;
diff --git a/llvm/include/llvm/ADT/ScopeExit.h 
b/llvm/include/llvm/ADT/ScopeExit.h
index a8943c680f4e1..2a014e508110a 100644
--- a/llvm/include/llvm/ADT/ScopeExit.h
+++ b/llvm/include/llvm/ADT/ScopeExit.h
@@ -7,7 +7,7 @@
 
//===----------------------------------------------------------------------===//
 ///
 /// \file
-/// This file defines the make_scope_exit function, which executes user-defined
+/// This file defines the scope_exit class, which executes user-defined
 /// cleanup logic at scope exit.
 ///
 
//===----------------------------------------------------------------------===//
@@ -15,7 +15,6 @@
 #ifndef LLVM_ADT_SCOPEEXIT_H
 #define LLVM_ADT_SCOPEEXIT_H
 
-#include "llvm/Support/Compiler.h"
 #include <utility>
 
 namespace llvm {
@@ -46,19 +45,6 @@ template <typename Callable> class [[nodiscard]] scope_exit {
 
 template <typename Callable> scope_exit(Callable) -> scope_exit<Callable>;
 
-// Keeps the callable object that is passed in, and execute it at the
-// destruction of the returned object (usually at the scope exit where the
-// returned object is kept).
-//
-// Interface is specified by p0052r2.
-template <typename Callable>
-[[nodiscard]]
-LLVM_DEPRECATED("Prefer calling the constructor of llvm::scope_exit directly.",
-                "scope_exit") auto make_scope_exit(Callable &&F) {
-  // TODO(LLVM 24): Remove this function.
-  return scope_exit(std::forward<Callable>(F));
-}
-
 } // end namespace llvm
 
 #endif

>From fc44e2bcf88cc4cce585bb34a826b9b9e48b61fc Mon Sep 17 00:00:00 2001
From: Claude <[email protected]>
Date: Thu, 30 Jul 2026 10:34:40 +0000
Subject: [PATCH 2/2] Apply clang-format to previous commit

---
 lldb/source/Host/windows/DomainSocketWindows.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lldb/source/Host/windows/DomainSocketWindows.cpp 
b/lldb/source/Host/windows/DomainSocketWindows.cpp
index ef87fe0831a0f..0dd10697ffe69 100644
--- a/lldb/source/Host/windows/DomainSocketWindows.cpp
+++ b/lldb/source/Host/windows/DomainSocketWindows.cpp
@@ -30,8 +30,7 @@ llvm::Expected<DomainSocket::Pair> 
DomainSocketWindows::CreatePair() {
   llvm::sys::path::append(model, "lldb-domain-socketpair-%%%%%%%%.sock");
   llvm::SmallString<128> path;
   llvm::sys::fs::createUniquePath(model, path, /*MakeAbsolute=*/false);
-  auto remove_file =
-      llvm::scope_exit([&] { llvm::sys::fs::remove(path); });
+  auto remove_file = llvm::scope_exit([&] { llvm::sys::fs::remove(path); });
 
   auto listen_socket =
       std::make_unique<DomainSocketWindows>(/*should_close=*/true);

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to