From 517cd170c39f49a067aef93cbc4bd8f0a261f144 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 9 Nov 2016 11:43:57 +0000 Subject: [PATCH] Zero-initialize chrono duration objects The default duration constructor does not zero-initialize the object, we need to do that manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286359 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/CachePruning.h | 4 ++-- lib/Support/Unix/Process.inc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/llvm/Support/CachePruning.h b/include/llvm/Support/CachePruning.h index c20108763c3..954fd8ae7ff 100644 --- a/include/llvm/Support/CachePruning.h +++ b/include/llvm/Support/CachePruning.h @@ -60,8 +60,8 @@ public: private: // Options that matches the setters above. std::string Path; - std::chrono::seconds Expiration; - std::chrono::seconds Interval; + std::chrono::seconds Expiration = std::chrono::seconds::zero(); + std::chrono::seconds Interval = std::chrono::seconds::zero(); unsigned PercentageOfAvailableSpace = 0; }; diff --git a/lib/Support/Unix/Process.inc b/lib/Support/Unix/Process.inc index a5fac11370a..16f8f5a98e5 100644 --- a/lib/Support/Unix/Process.inc +++ b/lib/Support/Unix/Process.inc @@ -66,7 +66,7 @@ static std::pair getRUsage return { toDuration(RU.ru_utime), toDuration(RU.ru_stime) }; #else #warning Cannot get usage times on this platform - return {}; + return { std::chrono::microseconds::zero(), std::chrono::microseconds::zero() }; #endif } -- 2.40.0