diff options
author | Diana Picus <diana.picus@linaro.org> | 2021-06-07 11:48:32 +0000 |
---|---|---|
committer | Diana Picus <diana.picus@linaro.org> | 2021-06-09 08:20:58 +0000 |
commit | 35b0ddab0ee8064d23c6f390e30da14e756b5ba6 (patch) | |
tree | 6f2da0820b63b7309a86ce255b4840d90938c0d0 | |
parent | 5c5ae6a661ce01fb4e5f3a645de188028e8c981e (diff) | |
download | llvm-35b0ddab0ee8064d23c6f390e30da14e756b5ba6.zip llvm-35b0ddab0ee8064d23c6f390e30da14e756b5ba6.tar.gz llvm-35b0ddab0ee8064d23c6f390e30da14e756b5ba6.tar.bz2 |
[flang] Define the API for CPU_TIME
CPU_TIME takes a single real scalar INTENT(OUT) argument. We can
therefore return a double and let lowering handle casting that to the
precision used for the default real kind.
Differential Revision: https://reviews.llvm.org/D103805
-rw-r--r-- | flang/runtime/time-intrinsic.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/flang/runtime/time-intrinsic.h b/flang/runtime/time-intrinsic.h new file mode 100644 index 0000000..835f24c --- /dev/null +++ b/flang/runtime/time-intrinsic.h @@ -0,0 +1,27 @@ +//===-- runtime/time-intrinsic.h --------------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt 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. + +#ifndef FORTRAN_RUNTIME_TIME_INTRINSIC_H_ +#define FORTRAN_RUNTIME_TIME_INTRINSIC_H_ + +#include "cpp-type.h" +#include "entry-names.h" + +namespace Fortran::runtime { +extern "C" { + +// Lowering may need to cast this result to match the precision of the default +// real kind. +double RTNAME(CpuTime)(); + +} // extern "C" +} // namespace Fortran::runtime +#endif // FORTRAN_RUNTIME_TIME_INTRINSIC_H_ |