From 3c19686d8c23cf3f6458978f4025b53bebf0bcb1 Mon Sep 17 00:00:00 2001 From: Chris Cummins Date: Thu, 17 Feb 2022 18:41:02 +0000 Subject: [PATCH] Use io_context rather than io_service alias. boost::asio::io_service is only for backwards compatibility. --- compiler_gym/envs/llvm/service/Cost.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler_gym/envs/llvm/service/Cost.cc b/compiler_gym/envs/llvm/service/Cost.cc index 38c3c657a1..884cf4bf67 100644 --- a/compiler_gym/envs/llvm/service/Cost.cc +++ b/compiler_gym/envs/llvm/service/Cost.cc @@ -74,9 +74,9 @@ Status getTextSizeInBytes(llvm::Module& module, int64_t* value, const fs::path& fmt::format("{} -w -xir - -o {} -c", clangPath.string(), tmpFile.string()); #endif - boost::asio::io_service clangService; + boost::asio::io_context clangContext; auto stdinBuffer{boost::asio::buffer(ir)}; - bp::async_pipe stdinPipe(clangService); + bp::async_pipe stdinPipe(clangContext); boost::asio::io_context clangStderrStream; std::future clangStderrFuture; @@ -88,8 +88,8 @@ Status getTextSizeInBytes(llvm::Module& module, int64_t* value, const fs::path& stdinPipe, stdinBuffer, [&](const boost::system::error_code& ec, std::size_t n) { stdinPipe.async_close(); }); - clangService.run_for(std::chrono::seconds(60)); - if (clangService.poll()) { + clangContext.run_for(std::chrono::seconds(60)); + if (clangContext.poll()) { return Status(StatusCode::INVALID_ARGUMENT, fmt::format("Failed to compute .text size cost within 60 seconds")); }