[clang] [llvm] [Clang] Add env var for nvptx-arch/amdgpu-arch timeout (PR #102521)
Joel E. Denny via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 4 15:52:46 PDT 2024
================
@@ -116,6 +116,16 @@ ToolChain::executeToolChainProgram(StringRef Executable,
};
std::string ErrorMessage;
+ int SecondsToWait = 60;
+ if (std::optional<std::string> Str =
+ llvm::sys::Process::GetEnv("CLANG_TOOLCHAIN_PROGRAM_TIMEOUT")) {
+ if (!llvm::to_integer(*Str, SecondsToWait))
+ return llvm::createStringError(std::error_code(),
+ "CLANG_TOOLCHAIN_PROGRAM_TIMEOUT expected "
+ "an integer, got '" +
+ *Str + "'");
+ SecondsToWait = std::min(SecondsToWait, 0); // infinite
----------------
jdenny-ornl wrote:
So that negative becomes 0 to mean infinite, that's obviously supposed to be max not min. Pushed a fix as 7c4eb60c9509c3a750961eac2dbcaad369d911f2.
https://github.com/llvm/llvm-project/pull/102521
More information about the cfe-commits
mailing list