FLANG
inquiry.h
1//===-- include/flang/Runtime/inquiry.h ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// Defines the API for the inquiry intrinsic functions
10// that inquire about shape information in arrays: LBOUND and SIZE.
11
12#ifndef FORTRAN_RUNTIME_INQUIRY_H_
13#define FORTRAN_RUNTIME_INQUIRY_H_
14
15#include "flang/Runtime/entry-names.h"
16#include <cinttypes>
17
18namespace Fortran::runtime {
19
20class Descriptor;
21
22extern "C" {
23
24std::int64_t RTDECL(LboundDim)(const Descriptor &array, int dim,
25 const char *sourceFile = nullptr, int line = 0);
26
27void RTDECL(Lbound)(void *result, const Descriptor &array, int kind,
28 const char *sourceFile = nullptr, int line = 0);
29
30void RTDECL(Shape)(void *result, const Descriptor &array, int kind,
31 const char *sourceFile = nullptr, int line = 0);
32std::int64_t RTDECL(Size)(
33 const Descriptor &array, const char *sourceFile = nullptr, int line = 0);
34
35std::int64_t RTDECL(SizeDim)(const Descriptor &array, int dim,
36 const char *sourceFile = nullptr, int line = 0);
37
38void RTDECL(Ubound)(void *result, const Descriptor &array, int kind,
39 const char *sourceFile = nullptr, int line = 0);
40
41} // extern "C"
42} // namespace Fortran::runtime
43#endif // FORTRAN_RUNTIME_INQUIRY_H_