[clang] [llvm] [Clang] Add env var for nvptx-arch/amdgpu-arch timeout (PR #102521)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 8 13:31:14 PDT 2024
================
@@ -116,6 +117,15 @@ ToolChain::executeToolChainProgram(StringRef Executable,
};
std::string ErrorMessage;
+ int SecondsToWait = DefaultSecondsToWait;
+ if (std::optional<std::string> Str =
+ llvm::sys::Process::GetEnv("CLANG_TOOL_CHAIN_PROGRAM_WAIT")) {
+ int Val = std::atoi(Str->c_str());
+ if (Val > 0)
+ SecondsToWait = Val;
+ else
+ SecondsToWait = 0; // infinite
----------------
jhuber6 wrote:
We should probably make sure the value is an integer.
```suggestion
if (!llvm::to_integer(Arg->getValue(), Val))
return createStringError("CLANG_TOOLCHAIN_PROGRAM_TIMEOUT expected an integer, got '%s'", *Str);
Val = std::max(Val, 0);
```
https://github.com/llvm/llvm-project/pull/102521
More information about the cfe-commits
mailing list