Commit a3ab5485 authored by Ruslan Sayfutdinov's avatar Ruslan Sayfutdinov Committed by Facebook GitHub Bot

fix internal clang errors on Windows

Summary: Fix clang internal error on Windows.

Reviewed By: yfeldblum

Differential Revision: D26994868

fbshipit-source-id: 97fe79231fcbfc0fc6712626dee8e1d570dd0dd6
parent 01f86817
...@@ -507,8 +507,12 @@ auto collectAllTryRange(InputRange awaitables) ...@@ -507,8 +507,12 @@ auto collectAllTryRange(InputRange awaitables)
executor.get_alias(), executor.get_alias(),
co_withCancellation(cancelToken, std::move(semiAwaitable)))); co_withCancellation(cancelToken, std::move(semiAwaitable))));
} }
// This causes "Instruction does not dominate all uses!" internal compiler
// error on Windows with Clang.
#if !(defined(_WIN32) && defined(__clang__))
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
result.emplaceException(std::current_exception(), ex); result.emplaceException(std::current_exception(), ex);
#endif
} catch (...) { } catch (...) {
result.emplaceException(std::current_exception()); result.emplaceException(std::current_exception());
} }
......
...@@ -360,8 +360,11 @@ class FOLLY_NODISCARD TaskWithExecutor { ...@@ -360,8 +360,11 @@ class FOLLY_NODISCARD TaskWithExecutor {
detail::InlineTaskDetached startImpl(TaskWithExecutor task, F cb) { detail::InlineTaskDetached startImpl(TaskWithExecutor task, F cb) {
try { try {
cb(co_await folly::coro::co_awaitTry(std::move(task))); cb(co_await folly::coro::co_awaitTry(std::move(task)));
// This causes clang internal error on Windows.
#if !(defined(_WIN32) && defined(__clang__))
} catch (const std::exception& e) { } catch (const std::exception& e) {
cb(Try<StorageType>(exception_wrapper(std::current_exception(), e))); cb(Try<StorageType>(exception_wrapper(std::current_exception(), e)));
#endif
} catch (...) { } catch (...) {
cb(Try<StorageType>(exception_wrapper(std::current_exception()))); cb(Try<StorageType>(exception_wrapper(std::current_exception())));
} }
...@@ -371,8 +374,11 @@ class FOLLY_NODISCARD TaskWithExecutor { ...@@ -371,8 +374,11 @@ class FOLLY_NODISCARD TaskWithExecutor {
detail::InlineTaskDetached startInlineImpl(TaskWithExecutor task, F cb) { detail::InlineTaskDetached startInlineImpl(TaskWithExecutor task, F cb) {
try { try {
cb(co_await InlineTryAwaitable{std::exchange(task.coro_, {})}); cb(co_await InlineTryAwaitable{std::exchange(task.coro_, {})});
// This causes clang internal error on Windows.
#if !(defined(_WIN32) && defined(__clang__))
} catch (const std::exception& e) { } catch (const std::exception& e) {
cb(Try<StorageType>(exception_wrapper(std::current_exception(), e))); cb(Try<StorageType>(exception_wrapper(std::current_exception(), e)));
#endif
} catch (...) { } catch (...) {
cb(Try<StorageType>(exception_wrapper(std::current_exception()))); cb(Try<StorageType>(exception_wrapper(std::current_exception())));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment