Since we use C++11, we should switch over to using std::unique_ptr when C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++.
Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179779 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
index bcc8c77..f80e5e0 100644
--- a/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
+++ b/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
@@ -691,7 +691,7 @@
m_client_fd(-1),
m_server_fd(-1)
{
- std::auto_ptr<LaunchArgs> args;
+ STD_UNIQUE_PTR(LaunchArgs) args;
args.reset(new LaunchArgs(this, module, argv, envp,
stdin_path, stdout_path, stderr_path, working_dir));
@@ -752,7 +752,7 @@
m_client_fd(-1),
m_server_fd(-1)
{
- std::auto_ptr<AttachArgs> args;
+ STD_UNIQUE_PTR(AttachArgs) args;
args.reset(new AttachArgs(this, pid));
diff --git a/source/Plugins/Process/Linux/ProcessMonitor.cpp b/source/Plugins/Process/Linux/ProcessMonitor.cpp
index 381f4be..269a41e 100644
--- a/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -924,7 +924,7 @@
m_client_fd(-1),
m_server_fd(-1)
{
- std::auto_ptr<LaunchArgs> args;
+ STD_UNIQUE_PTR(LaunchArgs) args;
args.reset(new LaunchArgs(this, module, argv, envp,
stdin_path, stdout_path, stderr_path, working_dir));
@@ -984,7 +984,7 @@
m_client_fd(-1),
m_server_fd(-1)
{
- std::auto_ptr<AttachArgs> args;
+ STD_UNIQUE_PTR(AttachArgs) args;
args.reset(new AttachArgs(this, pid));
diff --git a/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index 4a57b43..4d4e5f4 100644
--- a/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -196,7 +196,7 @@
return error;
}
- std::auto_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor());
+ STD_UNIQUE_PTR(ConnectionFileDescriptor) conn_ap(new ConnectionFileDescriptor());
if (conn_ap.get())
{
// Only try once for now.
diff --git a/source/Plugins/Process/POSIX/POSIXThread.h b/source/Plugins/Process/POSIX/POSIXThread.h
index 7aad671..d75146e 100644
--- a/source/Plugins/Process/POSIX/POSIXThread.h
+++ b/source/Plugins/Process/POSIX/POSIXThread.h
@@ -81,7 +81,7 @@
return (RegisterContextPOSIX *)m_reg_context_sp.get();
}
- std::auto_ptr<lldb_private::StackFrame> m_frame_ap;
+ STD_UNIQUE_PTR(lldb_private::StackFrame) m_frame_ap;
lldb::BreakpointSiteSP m_breakpoint;
lldb::StopInfoSP m_stop_info;
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 0086195..1d1a095 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -738,7 +738,7 @@
{
Error error;
// Sleep and wait a bit for debugserver to start to listen...
- std::auto_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor());
+ STD_UNIQUE_PTR(ConnectionFileDescriptor) conn_ap(new ConnectionFileDescriptor());
if (conn_ap.get())
{
const uint32_t max_retry_count = 50;