On Windows lldb::thread_result_t resolves to typedef unsigned thread_result_t; and on other platforms it resolves to typedef void *thread_result_t;.
Therefore one cannot use nullptr when returning from a function that returns thread_result_t.
I've made this change because a windows build bot fails with these errors:
FAILED: tools/lldb/source/Core/CMakeFiles/lldbCore.dir/Communication.cpp.obj C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe /nologo /TP -DGTEST_HAS_RTTI=0 -DLLDB_CONFIGURATION_RELEASE -DLLDB_DISABLE_CURSES -DLLDB_DISABLE_LIBEDIT -DLLDB_PYTHON_HOME="\"C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64\"" -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\lldb\source\Core -IE:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core -Itools\lldb\include -IE:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\include -Iinclude -IE:\build_slave\lldb-x64-windows-ninja\llvm\include -I"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Include" -IE:\build_slave\lldb-x64-windows-ninja\llvm\tools\clang\include -Itools\lldb\..\clang\include -IE:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\. /DWIN32 /D_WINDOWS /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /MD /O2 /Ob2 /DNDEBUG -wd4018 -wd4068 -wd4150 -wd4201 -wd4251 -wd4521 -wd4530 /EHs-c- /GR- /showIncludes /Fotools\lldb\source\Core\CMakeFiles\lldbCore.dir\Communication.cpp.obj /Fdtools\lldb\source\Core\CMakeFiles\lldbCore.dir\lldbCore.pdb /FS -c E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Communication.cpp E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Communication.cpp(362): error C2440: 'return': cannot convert from 'nullptr' to 'lldb::thread_result_t' E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Communication.cpp(362): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
and
FAILED: tools/lldb/source/Core/CMakeFiles/lldbCore.dir/Debugger.cpp.obj C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe /nologo /TP -DGTEST_HAS_RTTI=0 -DLLDB_CONFIGURATION_RELEASE -DLLDB_DISABLE_CURSES -DLLDB_DISABLE_LIBEDIT -DLLDB_PYTHON_HOME="\"C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64\"" -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\lldb\source\Core -IE:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core -Itools\lldb\include -IE:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\include -Iinclude -IE:\build_slave\lldb-x64-windows-ninja\llvm\include -I"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Include" -IE:\build_slave\lldb-x64-windows-ninja\llvm\tools\clang\include -Itools\lldb\..\clang\include -IE:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\. /DWIN32 /D_WINDOWS /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /MD /O2 /Ob2 /DNDEBUG -wd4018 -wd4068 -wd4150 -wd4201 -wd4251 -wd4521 -wd4530 /EHs-c- /GR- /showIncludes /Fotools\lldb\source\Core\CMakeFiles\lldbCore.dir\Debugger.cpp.obj /Fdtools\lldb\source\Core\CMakeFiles\lldbCore.dir\lldbCore.pdb /FS -c E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1619): error C2440: 'return': cannot convert from 'nullptr' to 'lldb::thread_result_t' E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1619): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1664): error C2440: 'return': cannot convert from 'nullptr' to 'lldb::thread_result_t' E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1664): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
This is the failing build: http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/5035/steps/build/logs/stdio