From dc721064b43a40ed57454caebd533f89df16da7e Mon Sep 17 00:00:00 2001 From: Diana Picus Date: Tue, 27 Jul 2021 10:21:10 +0000 Subject: [PATCH] [flang] Fix minor style issues. NFC --- flang/runtime/time-intrinsic.cpp | 6 +++--- flang/unittests/RuntimeGTest/Time.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flang/runtime/time-intrinsic.cpp b/flang/runtime/time-intrinsic.cpp index bd84ef9bdb42..5e7c1bc484d5 100644 --- a/flang/runtime/time-intrinsic.cpp +++ b/flang/runtime/time-intrinsic.cpp @@ -34,7 +34,7 @@ using fallback_implementation = double; using preferred_implementation = int; // This is the fallback implementation, which should work everywhere. -template double getCpuTime(fallback_implementation) { +template double GetCpuTime(fallback_implementation) { std::clock_t timestamp{std::clock()}; if (timestamp != std::clock_t{-1}) { return static_cast(timestamp) / CLOCKS_PER_SEC; @@ -47,7 +47,7 @@ template double getCpuTime(fallback_implementation) { // POSIX implementation using clock_gettime. This is only enabled if // clock_gettime is available. template -double getCpuTime(preferred_implementation, +double GetCpuTime(preferred_implementation, // We need some dummy parameters to pass to decltype(clock_gettime). T ClockId = 0, U *Timespec = nullptr, decltype(clock_gettime(ClockId, Timespec)) *Enabled = nullptr) { @@ -73,6 +73,6 @@ double getCpuTime(preferred_implementation, namespace Fortran::runtime { extern "C" { -double RTNAME(CpuTime)() { return getCpuTime(0); } +double RTNAME(CpuTime)() { return GetCpuTime(0); } } // extern "C" } // namespace Fortran::runtime diff --git a/flang/unittests/RuntimeGTest/Time.cpp b/flang/unittests/RuntimeGTest/Time.cpp index 1ade63ade558..b2ca81f98c4e 100644 --- a/flang/unittests/RuntimeGTest/Time.cpp +++ b/flang/unittests/RuntimeGTest/Time.cpp @@ -15,7 +15,7 @@ TEST(TimeIntrinsics, CpuTime) { // We can't really test that we get the "right" result for CPU_TIME, but we // can have a smoke test to see that we get something reasonable on the // platforms where we expect to support it. - double start = RTNAME(CpuTime)(); + double start{RTNAME(CpuTime)()}; ASSERT_GE(start, 0.0); // Loop until we get a different value from CpuTime. If we don't get one