aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Support/Program.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Support/Program.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Support/Program.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/contrib/llvm-project/llvm/lib/Support/Program.cpp b/contrib/llvm-project/llvm/lib/Support/Program.cpp
index 0560714a6acd..1dcd45e2d69e 100644
--- a/contrib/llvm-project/llvm/lib/Support/Program.cpp
+++ b/contrib/llvm-project/llvm/lib/Support/Program.cpp
@@ -23,17 +23,18 @@ using namespace sys;
//===----------------------------------------------------------------------===//
static bool Execute(ProcessInfo &PI, StringRef Program,
- ArrayRef<StringRef> Args, Optional<ArrayRef<StringRef>> Env,
- ArrayRef<Optional<StringRef>> Redirects,
+ ArrayRef<StringRef> Args,
+ std::optional<ArrayRef<StringRef>> Env,
+ ArrayRef<std::optional<StringRef>> Redirects,
unsigned MemoryLimit, std::string *ErrMsg,
BitVector *AffinityMask);
int sys::ExecuteAndWait(StringRef Program, ArrayRef<StringRef> Args,
- Optional<ArrayRef<StringRef>> Env,
- ArrayRef<Optional<StringRef>> Redirects,
+ std::optional<ArrayRef<StringRef>> Env,
+ ArrayRef<std::optional<StringRef>> Redirects,
unsigned SecondsToWait, unsigned MemoryLimit,
std::string *ErrMsg, bool *ExecutionFailed,
- Optional<ProcessStatistics> *ProcStat,
+ std::optional<ProcessStatistics> *ProcStat,
BitVector *AffinityMask) {
assert(Redirects.empty() || Redirects.size() == 3);
ProcessInfo PI;
@@ -41,9 +42,9 @@ int sys::ExecuteAndWait(StringRef Program, ArrayRef<StringRef> Args,
AffinityMask)) {
if (ExecutionFailed)
*ExecutionFailed = false;
- ProcessInfo Result =
- Wait(PI, SecondsToWait, /*WaitUntilTerminates=*/SecondsToWait == 0,
- ErrMsg, ProcStat);
+ ProcessInfo Result = Wait(
+ PI, SecondsToWait == 0 ? std::nullopt : std::optional(SecondsToWait),
+ ErrMsg, ProcStat);
return Result.ReturnCode;
}
@@ -54,8 +55,8 @@ int sys::ExecuteAndWait(StringRef Program, ArrayRef<StringRef> Args,
}
ProcessInfo sys::ExecuteNoWait(StringRef Program, ArrayRef<StringRef> Args,
- Optional<ArrayRef<StringRef>> Env,
- ArrayRef<Optional<StringRef>> Redirects,
+ std::optional<ArrayRef<StringRef>> Env,
+ ArrayRef<std::optional<StringRef>> Redirects,
unsigned MemoryLimit, std::string *ErrMsg,
bool *ExecutionFailed, BitVector *AffinityMask) {
assert(Redirects.empty() || Redirects.size() == 3);