Change HostThread::GetNativeThread() to return a derived reference.

Previously using HostThread::GetNativeThread() required an ugly
cast to most-derived type.  This solves the issue by simply returning
the derived type directly.

llvm-svn: 222185
This commit is contained in:
Zachary Turner
2014-11-17 22:42:57 +00:00
parent 5453933867
commit c30189921e
8 changed files with 46 additions and 32 deletions

View File

@@ -13,13 +13,10 @@
#include "lldb/Core/Log.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostNativeThread.h"
#include "lldb/Host/HostThread.h"
#include "lldb/Host/ThreadLauncher.h"
#if !defined(_WIN32)
#include "lldb/Host/HostNativeThread.h"
#endif
using namespace lldb;
using namespace lldb_private;
@@ -105,7 +102,7 @@ SBHostOS::ThreadDetach (lldb::thread_t thread, SBError *error_ptr)
error_ptr->SetErrorString("ThreadDetach is not supported on this platform");
#else
HostThread host_thread(thread);
error = ((HostThreadPosix &)host_thread.GetNativeThread()).Detach();
error = host_thread.GetNativeThread().Detach();
if (error_ptr)
error_ptr->SetError(error);
host_thread.Release();