forked from OSchip/llvm-project
[flang] Fix minor style issues. NFC
This commit is contained in:
parent
a5b2ec9c26
commit
dc721064b4
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue