diff --git a/llvm/include/llvm/Support/thread.h b/llvm/include/llvm/Support/thread.h index 32599b9f7121e4..69c06c050aac5f 100644 --- a/llvm/include/llvm/Support/thread.h +++ b/llvm/include/llvm/Support/thread.h @@ -36,18 +36,13 @@ namespace llvm { /// LLVM thread following std::thread interface with added constructor to /// specify stack size. class thread { - template - static void Apply(std::tuple &Callee, - std::index_sequence) { - std::move(std::get<0>(Callee))(std::move(std::get(Callee))...); - } - template static void GenericThreadProxy(void *Ptr) { std::unique_ptr Callee(static_cast(Ptr)); - - // FIXME: use std::apply when C++17 is allowed. - std::make_index_sequence() - 1> Indices{}; - Apply(*Callee.get(), Indices); + std::apply( + [](auto &&F, auto &&...Args) { + std::forward(F)(std::forward(Args)...); + }, + *Callee); } public: