@@ -736,6 +736,13 @@ static Expected<std::unique_ptr<ExecutorProcessControl>> launchExecutor() {
736
736
return make_error<StringError>(" -" + OutOfProcessExecutor.ArgStr +
737
737
" not supported on non-unix platforms" ,
738
738
inconvertibleErrorCode ());
739
+ #elif !LLVM_ENABLE_THREADS
740
+ // Out of process mode using SimpleRemoteEPC depends on threads.
741
+ return make_error<StringError>(
742
+ " -" + OutOfProcessExecutor.ArgStr +
743
+ " requires threads, but LLVM was built with "
744
+ " LLVM_ENABLE_THREADS=Off" ,
745
+ inconvertibleErrorCode ());
739
746
#else
740
747
741
748
constexpr int ReadEnd = 0 ;
@@ -795,7 +802,7 @@ static Expected<std::unique_ptr<ExecutorProcessControl>> launchExecutor() {
795
802
#endif
796
803
}
797
804
798
- #ifdef LLVM_ON_UNIX
805
+ #if LLVM_ON_UNIX && LLVM_ENABLE_THREADS
799
806
static Error createTCPSocketError (Twine Details) {
800
807
return make_error<StringError>(
801
808
formatv (" Failed to connect TCP socket '{0}': {1}" ,
@@ -847,6 +854,13 @@ static Expected<std::unique_ptr<ExecutorProcessControl>> connectToExecutor() {
847
854
return make_error<StringError>(" -" + OutOfProcessExecutorConnect.ArgStr +
848
855
" not supported on non-unix platforms" ,
849
856
inconvertibleErrorCode ());
857
+ #elif !LLVM_ENABLE_THREADS
858
+ // Out of process mode using SimpleRemoteEPC depends on threads.
859
+ return make_error<StringError>(
860
+ " -" + OutOfProcessExecutorConnect.ArgStr +
861
+ " requires threads, but LLVM was built with "
862
+ " LLVM_ENABLE_THREADS=Off" ,
863
+ inconvertibleErrorCode ());
850
864
#else
851
865
852
866
StringRef Host, PortStr;
@@ -907,8 +921,8 @@ Expected<std::unique_ptr<Session>> Session::Create(Triple TT) {
907
921
return PageSize.takeError ();
908
922
EPC = std::make_unique<SelfExecutorProcessControl>(
909
923
std::make_shared<SymbolStringPool>(),
910
- std::make_unique<DynamicThreadPoolTaskDispatcher >(),
911
- std::move (TT), *PageSize, createMemoryManager ());
924
+ std::make_unique<InPlaceTaskDispatcher >(), std::move (TT), *PageSize ,
925
+ createMemoryManager ());
912
926
}
913
927
914
928
Error Err = Error::success ();
0 commit comments