diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-01-28 12:25:53 -0800 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-01-28 12:28:12 -0800 |
commit | 39ecfe614350fa5db7b8f13f81212f8e3831a390 (patch) | |
tree | f5667c9dad51dd9bacfc26f24cefebdac9856c3d /llvm/lib/Support/Unix/Program.inc | |
parent | fe190cf6c99e03389ded12f435da1658d52b782d (diff) | |
download | llvm-39ecfe614350fa5db7b8f13f81212f8e3831a390.zip llvm-39ecfe614350fa5db7b8f13f81212f8e3831a390.tar.gz llvm-39ecfe614350fa5db7b8f13f81212f8e3831a390.tar.bz2 |
Support: Simplify __HAIKU__ #ifdef in llvm::sys::Wait, NFC
This just reduces the amount of code in the `#ifndef` block as a
follow-up to 5c1cea6f406366b85f3c200a1c48f713da4450ba.
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Program.inc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc index d42681f..679ba53 100644 --- a/llvm/lib/Support/Unix/Program.inc +++ b/llvm/lib/Support/Unix/Program.inc @@ -452,12 +452,11 @@ ProcessInfo llvm::sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait, if (ProcStat) { std::chrono::microseconds UserT = toDuration(Info.ru_utime); std::chrono::microseconds KernelT = toDuration(Info.ru_stime); + uint64_t PeakMemory = 0; #ifndef __HAIKU__ - uint64_t PeakMemory = static_cast<uint64_t>(Info.ru_maxrss); - *ProcStat = ProcessStatistics{UserT + KernelT, UserT, PeakMemory}; -#else - *ProcStat = ProcessStatistics{UserT + KernelT, UserT, 0}; + PeakMemory = static_cast<uint64_t>(Info.ru_maxrss); #endif + *ProcStat = ProcessStatistics{UserT + KernelT, UserT, PeakMemory}; } // Return the proper exit status. Detect error conditions |