[llvm] r255621 - Fix MSVC build with LLVM_ENABLE_THREADS=OFF
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 15 06:49:25 PST 2015
Hi,
I have no idea what these are, and I don't have MSVC or Windows to reproduce. I fixed the previous build breaks by searching on the web for the bug.
A quick "solution" for these warning would be to disable them with pragma.
--
Mehdi
Sent from my iPhone
> On Dec 15, 2015, at 6:04 AM, Kuperstein, Michael M <michael.m.kuperstein at intel.com> wrote:
>
> Hi,
>
> I'm still getting warnings, as well as an error for the lambda in TheadPool.h.
> This is with MSVC2013 SP4.
>
> Michael
>
> 1>------ Build started: Project: SupportTests, Configuration: Release x64 ------
> 1> ThreadPool.cpp
> 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\pplconcrt.h(158): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
> 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(2461): warning C4062: enumerator '_Nothing' in switch of enum 'Concurrency::details::_Task_impl<_ReturnType>::_CancelAndRunContinuations::<unnamed-type-_Do>' is not handled
> 1> with
> 1> [
> 1> _ReturnType=Concurrency::details::_Unit_type
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(2371) : see declaration of 'Concurrency::details::_Task_impl<_ReturnType>::_CancelAndRunContinuations::<unnamed-type-_Do>'
> 1> with
> 1> [
> 1> _ReturnType=Concurrency::details::_Unit_type
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(2370) : while compiling class template member function 'bool Concurrency::details::_Task_impl<_ReturnType>::_CancelAndRunContinuations(bool,bool,bool,const std::shared_ptr<Concurrency::details::_ExceptionHolder> &)'
> 1> with
> 1> [
> 1> _ReturnType=Concurrency::details::_Unit_type
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(7231) : see reference to class template instantiation 'Concurrency::details::_Task_impl<_ReturnType>' being compiled
> 1> with
> 1> [
> 1> _ReturnType=Concurrency::details::_Unit_type
> 1> ]
> 1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(2461): warning C4062: enumerator '_Nothing' in switch of enum 'Concurrency::details::_Task_impl<_ReturnType>::_CancelAndRunContinuations::<unnamed-type-_Do>' is not handled
> 1> with
> 1> [
> 1> _ReturnType=std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(2371) : see declaration of 'Concurrency::details::_Task_impl<_ReturnType>::_CancelAndRunContinuations::<unnamed-type-_Do>'
> 1> with
> 1> [
> 1> _ReturnType=std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(2370) : while compiling class template member function 'bool Concurrency::details::_Task_impl<_ReturnType>::_CancelAndRunContinuations(bool,bool,bool,const std::shared_ptr<Concurrency::details::_ExceptionHolder> &)'
> 1> with
> 1> [
> 1> _ReturnType=std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(2679) : see reference to class template instantiation 'Concurrency::details::_Task_impl<_ReturnType>' being compiled
> 1> with
> 1> [
> 1> _ReturnType=std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(2652) : while compiling class template member function 'bool Concurrency::task_completion_event<_CompletionType>::set(_ResultType) const'
> 1> with
> 1> [
> 1> _CompletionType=std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>
> 1> , _ResultType=std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(7231) : see reference to function template instantiation 'bool Concurrency::task_completion_event<_CompletionType>::set(_ResultType) const' being compiled
> 1> with
> 1> [
> 1> _CompletionType=std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>
> 1> , _ResultType=std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(6770) : see reference to class template instantiation 'Concurrency::task_completion_event<_CompletionType>' being compiled
> 1> with
> 1> [
> 1> _CompletionType=std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>
> 1> ]
> 1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ppltasks.h(7211) : see reference to class template instantiation 'Concurrency::details::_RunAnyParam<std::pair<Concurrency::details::_Unit_type,Concurrency::details::_CancellationTokenState *>>' being compiled
> 1>C:\llvm\rw\include\llvm/Support/ThreadPool.h(73): error C3848: expression having type 'const std::_Bind<true,void,void (__cdecl *const )(std::atomic_int &,int),_Ty,size_t &>' would lose some const-volatile qualifiers in order to call 'void std::_Bind<true,void,void (__cdecl *const )(std::atomic_int &,int),_Ty,size_t &>::operator ()<>(void)'
> 1> with
> 1> [
> 1> _Ty=std::reference_wrapper<std::atomic_int>
> 1> ]
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>
> -----Original Message-----
> From: llvm-commits [mailto:llvm-commits-bounces at lists.llvm.org] On Behalf Of Mehdi Amini via llvm-commits
> Sent: Tuesday, December 15, 2015 07:54
> To: llvm-commits at lists.llvm.org
> Subject: [llvm] r255621 - Fix MSVC build with LLVM_ENABLE_THREADS=OFF
>
> Author: mehdi_amini
> Date: Mon Dec 14 23:53:41 2015
> New Revision: 255621
>
> URL: http://llvm.org/viewvc/llvm-project?rev=255621&view=rev
> Log:
> Fix MSVC build with LLVM_ENABLE_THREADS=OFF
>
> Follow-up to the ThreadPool implementation.
>
> From: Mehdi Amini <mehdi.amini at apple.com>
>
> Modified:
> llvm/trunk/lib/Support/ThreadPool.cpp
>
> Modified: llvm/trunk/lib/Support/ThreadPool.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ThreadPool.cpp?rev=255621&r1=255620&r2=255621&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/ThreadPool.cpp (original)
> +++ llvm/trunk/lib/Support/ThreadPool.cpp Mon Dec 14 23:53:41 2015
> @@ -125,16 +125,25 @@ void ThreadPool::wait() {
> while (!Tasks.empty()) {
> auto Task = std::move(Tasks.front());
> Tasks.pop();
> - Task();
> +#ifndef _MSC_VER
> + Task();
> +#else
> + Task(/* unused */ false);
> +#endif
> }
> }
>
> std::shared_future<ThreadPool::VoidTy> ThreadPool::asyncImpl(TaskTy Task) {
> +#ifndef _MSC_VER
> // Get a Future with launch::deferred execution using std::async
> auto Future = std::async(std::launch::deferred, std::move(Task)).share();
> // Wrap the future so that both ThreadPool::wait() can operate and the
> // returned future can be sync'ed on.
> PackagedTaskTy PackagedTask([Future]() { Future.get(); });
> +#else
> + auto Future = std::async(std::launch::deferred, std::move(Task),
> +false).share();
> + PackagedTaskTy PackagedTask([Future](bool) -> bool { Future.get();
> +return false; }); #endif
> Tasks.push(std::move(PackagedTask));
> return Future;
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
More information about the llvm-commits
mailing list