[flang-commits] [flang] dc72106 - [flang] Fix minor style issues. NFC
Diana Picus via flang-commits
flang-commits at lists.llvm.org
Tue Jul 27 03:30:06 PDT 2021
Author: Diana Picus
Date: 2021-07-27T10:29:50Z
New Revision: dc721064b43a40ed57454caebd533f89df16da7e
URL: https://github.com/llvm/llvm-project/commit/dc721064b43a40ed57454caebd533f89df16da7e
DIFF: https://github.com/llvm/llvm-project/commit/dc721064b43a40ed57454caebd533f89df16da7e.diff
LOG: [flang] Fix minor style issues. NFC
Added:
Modified:
flang/runtime/time-intrinsic.cpp
flang/unittests/RuntimeGTest/Time.cpp
Removed:
################################################################################
diff --git a/flang/runtime/time-intrinsic.cpp b/flang/runtime/time-intrinsic.cpp
index bd84ef9bdb42e..5e7c1bc484d55 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 <typename Unused = void> double getCpuTime(fallback_implementation) {
+template <typename Unused = void> double GetCpuTime(fallback_implementation) {
std::clock_t timestamp{std::clock()};
if (timestamp != std::clock_t{-1}) {
return static_cast<double>(timestamp) / CLOCKS_PER_SEC;
@@ -47,7 +47,7 @@ template <typename Unused = void> double getCpuTime(fallback_implementation) {
// POSIX implementation using clock_gettime. This is only enabled if
// clock_gettime is available.
template <typename T = int, typename U = struct timespec>
-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 1ade63ade5585..b2ca81f98c4e3 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
diff erent value from CpuTime. If we don't get one
More information about the flang-commits
mailing list