]> granicus.if.org Git - llvm/commit
[Support][Chrono] Use explicit cast of text output of time values.
authorSimon Dardis <simon.dardis@mips.com>
Mon, 6 Nov 2017 23:01:46 +0000 (23:01 +0000)
committerSimon Dardis <simon.dardis@mips.com>
Mon, 6 Nov 2017 23:01:46 +0000 (23:01 +0000)
commitb67df9f5a0602b6b67b23e8007629275335b52af
tree3be9f57491e5a5a69814026af61bb1e852ef8c0a
parent790be31f8c56d57d88967a206d21be2c3fc5ba31
[Support][Chrono] Use explicit cast of text output of time values.

rL316419 exposed a platform specific issue where the type of the values
passed to llvm::format could be different to the format string.

Debian unstable for mips uses long long int for std::chrono:duration,
while x86_64 uses long int.

For mips, this resulted in the value being corrupted when rendered to a
string. Address this by explicitly casting the result of the duration_cast
to the type specified in the format string.

Reviewers: sammccall

Differential Revision: https://reviews.llvm.org/D39597

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317523 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Chrono.cpp