blob: c48e9614c8fe0587d1fcc2a09d182ae5bb527acd [file] [log] [blame]
//===-- include/flang/Runtime/time-intrinsic.h ------------------*- C++ -*-===//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// Defines the API between compiled code and the implementations of time-related
// intrinsic subroutines in the runtime library.
#include "flang/Runtime/cpp-type.h"
#include "flang/Runtime/entry-names.h"
namespace Fortran::runtime {
class Descriptor;
extern "C" {
// Lowering may need to cast this result to match the precision of the default
// real kind.
double RTNAME(CpuTime)();
// Interface for the SYSTEM_CLOCK intrinsic. We break it up into 3 distinct
// function calls, one for each of SYSTEM_CLOCK's optional output arguments.
// Lowering will have to cast the results to whatever type it prefers.
CppTypeFor<TypeCategory::Integer, 8> RTNAME(SystemClockCount)();
CppTypeFor<TypeCategory::Integer, 8> RTNAME(SystemClockCountRate)();
CppTypeFor<TypeCategory::Integer, 8> RTNAME(SystemClockCountMax)();
// Interface for DATE_AND_TIME intrinsic.
void RTNAME(DateAndTime)(char *date, std::size_t dateChars, char *time,
std::size_t timeChars, char *zone, std::size_t zoneChars,
const char *source = nullptr, int line = 0,
const Descriptor *values = nullptr);
} // extern "C"
} // namespace Fortran::runtime