#define FORTRAN_RUNTIME_REDUCTION_H_
#include "flang/Common/uint128.h"
-#include "flang/Runtime/descriptor.h"
#include "flang/Runtime/entry-names.h"
+#include <cinttypes>
#include <complex>
#include <cstdint>
namespace Fortran::runtime {
+
+class Descriptor;
+
extern "C" {
// Reductions that are known to return scalars have per-type entry
--- /dev/null
+//===-- include/flang/Runtime/support.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 APIs for runtime support code for lowering.
+#ifndef FORTRAN_RUNTIME_SUPPORT_H_
+#define FORTRAN_RUNTIME_SUPPORT_H_
+
+#include "flang/Runtime/entry-names.h"
+
+namespace Fortran::runtime {
+
+class Descriptor;
+
+extern "C" {
+
+// Predicate: is the storage described by a Descriptor contiguous in memory?
+bool RTNAME(IsContiguous)(const Descriptor &);
+
+} // extern "C"
+} // namespace Fortran::runtime
+#endif // FORTRAN_RUNTIME_SUPPORT_H_
#ifndef FORTRAN_RUNTIME_TRANSFORMATIONAL_H_
#define FORTRAN_RUNTIME_TRANSFORMATIONAL_H_
-#include "flang/Runtime/descriptor.h"
#include "flang/Runtime/entry-names.h"
-#include "flang/Runtime/memory.h"
+#include <cinttypes>
namespace Fortran::runtime {
+class Descriptor;
+
extern "C" {
void RTNAME(Reshape)(Descriptor &result, const Descriptor &source,
stat.cpp
stop.cpp
sum.cpp
+ support.cpp
terminator.cpp
time-intrinsic.cpp
tools.cpp
#include "flang/Runtime/reduction.h"
#include "reduction-templates.h"
+#include "flang/Runtime/descriptor.h"
#include <cinttypes>
namespace Fortran::runtime {
--- /dev/null
+//===-- runtime/support.cpp -----------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "flang/Runtime/support.h"
+#include "flang/Runtime/descriptor.h"
+
+namespace Fortran::runtime {
+extern "C" {
+
+bool RTNAME(IsContiguous)(const Descriptor &descriptor) {
+ return descriptor.IsContiguous();
+}
+
+} // extern "C"
+} // namespace Fortran::runtime
#ifndef FORTRAN_RUNTIME_TERMINATOR_H_
#define FORTRAN_RUNTIME_TERMINATOR_H_
-#include "flang/Runtime/entry-names.h"
#include <cstdarg>
namespace Fortran::runtime {
#include "copy.h"
#include "terminator.h"
#include "tools.h"
+#include "flang/Runtime/descriptor.h"
#include <algorithm>
namespace Fortran::runtime {