diff options
author | Zachary Turner <zturner@google.com> | 2015-04-02 20:57:38 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-04-02 20:57:38 +0000 |
commit | 48b475cbaa098095b47d220aa3503a275ee70982 (patch) | |
tree | 549e17d17d08085eb196ffa9fcc2321f5d120a9f /lldb/source/Host/windows/ThisThread.cpp | |
parent | d4e1b8685e4c6f9514ffff5f7cd030d4aa4d58a1 (diff) | |
download | bcm5719-llvm-48b475cbaa098095b47d220aa3503a275ee70982.tar.gz bcm5719-llvm-48b475cbaa098095b47d220aa3503a275ee70982.zip |
Fix warnings generated by clang-cl.
There were a couple of real bugs here regarding error checking and
signed/unsigned comparisons, but mostly these were just noise.
There was one class of bugs fixed here which is particularly
annoying, dealing with MSVC's non-standard behavior regarding
the underlying type of enums. See the comment in
lldb-enumerations.h for details. In short, from now on please use
FLAGS_ENUM and FLAGS_ANONYMOUS_ENUM when defining enums which
contain values larger than can fit into a signed integer.
llvm-svn: 233943
Diffstat (limited to 'lldb/source/Host/windows/ThisThread.cpp')
-rw-r--r-- | lldb/source/Host/windows/ThisThread.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lldb/source/Host/windows/ThisThread.cpp b/lldb/source/Host/windows/ThisThread.cpp index 9c37d7c57e7..bcd5b8d1c1d 100644 --- a/lldb/source/Host/windows/ThisThread.cpp +++ b/lldb/source/Host/windows/ThisThread.cpp @@ -18,6 +18,8 @@ using namespace lldb; using namespace lldb_private; +#if defined(_MSC_VER) && !defined(__clang__) + namespace { static const DWORD MS_VC_EXCEPTION = 0x406D1388; @@ -33,19 +35,23 @@ struct THREADNAME_INFO #pragma pack(pop) } +#endif + void ThisThread::SetName(llvm::StringRef name) { // Other compilers don't yet support SEH, so we can only set the thread if compiling with MSVC. // TODO(zturner): Once clang-cl supports SEH, relax this conditional. -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang__) THREADNAME_INFO info; info.dwType = 0x1000; info.szName = name.data(); info.dwThreadId = ::GetCurrentThreadId(); info.dwFlags = 0; - __try { ::RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR *)&info); } + __try { + ::RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR *)&info); + } __except(EXCEPTION_EXECUTE_HANDLER) {} #endif } |