From: Pavel Labath Date: Wed, 9 Nov 2016 11:43:57 +0000 (+0000) Subject: Zero-initialize chrono duration objects X-Git-Tag: llvmorg-4.0.0-rc1~5132 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=775bbc373639595f3c07ca15276145aa4917d0b7;p=platform%2Fupstream%2Fllvm.git Zero-initialize chrono duration objects The default duration constructor does not zero-initialize the object, we need to do that manually. llvm-svn: 286359 --- diff --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h index c201087..954fd8a 100644 --- a/llvm/include/llvm/Support/CachePruning.h +++ b/llvm/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/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc index a5fac11..16f8f5a 100644 --- a/llvm/lib/Support/Unix/Process.inc +++ b/llvm/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 }