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/Host/macosx | |
| 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/Host/macosx')
| -rw-r--r-- | lldb/source/Host/macosx/objcxx/Host.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/source/Host/macosx/objcxx/Host.mm b/lldb/source/Host/macosx/objcxx/Host.mm index 82b3383bc01..75d88eb4d02 100644 --- a/lldb/source/Host/macosx/objcxx/Host.mm +++ b/lldb/source/Host/macosx/objcxx/Host.mm @@ -59,7 +59,6 @@ #include "lldb/Host/ProcessLaunchInfo.h" #include "lldb/Host/ThreadLauncher.h" #include "lldb/Utility/ArchSpec.h" -#include "lldb/Utility/CleanUp.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Endian.h" @@ -71,8 +70,9 @@ #include "lldb/Utility/StructuredData.h" #include "lldb/lldb-defines.h" -#include "llvm/Support/FileSystem.h" +#include "llvm/ADT/ScopeExit.h" #include "llvm/Support/Errno.h" +#include "llvm/Support/FileSystem.h" #include "../cfcpp/CFCBundle.h" #include "../cfcpp/CFCMutableArray.h" @@ -1092,7 +1092,8 @@ static Status LaunchProcessPosixSpawn(const char *exe_path, } // Make sure we clean up the posix spawn attributes before exiting this scope. - CleanUp cleanup_attr(posix_spawnattr_destroy, &attr); + auto cleanup_attr = + llvm::make_scope_exit([&]() { posix_spawnattr_destroy(&attr); }); sigset_t no_signals; sigset_t all_signals; @@ -1195,7 +1196,8 @@ static Status LaunchProcessPosixSpawn(const char *exe_path, } // Make sure we clean up the posix file actions before exiting this scope. - CleanUp cleanup_fileact(posix_spawn_file_actions_destroy, &file_actions); + auto cleanup_fileact = llvm::make_scope_exit( + [&]() { posix_spawn_file_actions_destroy(&file_actions); }); for (size_t i = 0; i < num_file_actions; ++i) { const FileAction *launch_file_action = |

