diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-10 00:20:50 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-10 00:20:50 +0000 |
commit | e0ea8d87eb943f89e32524d6386c4c9c4c9f1310 (patch) | |
tree | 04edfd58e5643fe4aaaf4e7d7f190905acddb111 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 87d47cb7c4792cb4dbb6911b9d11e5bd9f2dc928 (diff) | |
download | bcm5719-llvm-e0ea8d87eb943f89e32524d6386c4c9c4c9f1310.tar.gz bcm5719-llvm-e0ea8d87eb943f89e32524d6386c4c9c4c9f1310.zip |
[Utility] Replace `lldb_private::CleanUp` by `llvm::scope_exit`
This removes the CleanUp class and replaces its usages with llvm's
ScopeExit, which has similar semantics.
Differential revision: https://reviews.llvm.org/D67378
llvm-svn: 371474
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index fee7b3fd880..99041d5b0bb 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -63,7 +63,6 @@ #include "lldb/Target/TargetList.h" #include "lldb/Target/ThreadPlanCallFunction.h" #include "lldb/Utility/Args.h" -#include "lldb/Utility/CleanUp.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Reproducer.h" #include "lldb/Utility/State.h" @@ -81,6 +80,7 @@ #include "lldb/Host/Host.h" #include "lldb/Utility/StringExtractorGDBRemote.h" +#include "llvm/ADT/ScopeExit.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/Threading.h" #include "llvm/Support/raw_ostream.h" @@ -3519,8 +3519,8 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver( int our_socket = sockets[0]; int gdb_socket = sockets[1]; - CleanUp cleanup_our(close, our_socket); - CleanUp cleanup_gdb(close, gdb_socket); + auto cleanup_our = llvm::make_scope_exit([&]() { close(our_socket); }); + auto cleanup_gdb = llvm::make_scope_exit([&]() { close(gdb_socket); }); // Don't let any child processes inherit our communication socket SetCloexecFlag(our_socket); @@ -3540,7 +3540,7 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver( #ifdef USE_SOCKETPAIR_FOR_LOCAL_CONNECTION // Our process spawned correctly, we can now set our connection to use // our end of the socket pair - cleanup_our.disable(); + cleanup_our.release(); m_gdb_comm.SetConnection(new ConnectionFileDescriptor(our_socket, true)); #endif StartAsyncThread(); |