Skip to content

Commit

Permalink
[flang] Move runtime API headers to flang/include/flang/Runtime
Browse files Browse the repository at this point in the history
Move the closure of the subset of flang/runtime/*.h header files that
are referenced by source files outside flang/runtime (apart from unit tests)
into a new directory (flang/include/flang/Runtime) so that relative
include paths into ../runtime need not be used.

flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate;
it's not used by the runtime.

Differential Revision: https://reviews.llvm.org/D109107
  • Loading branch information
klausler committed Sep 3, 2021
1 parent 343a72a commit 830c0b9
Show file tree
Hide file tree
Showing 103 changed files with 211 additions and 213 deletions.
6 changes: 3 additions & 3 deletions flang/examples/external-hello.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "../runtime/io-api.h"
#include "../runtime/main.h"
#include "../runtime/stop.h"
#include "flang/Runtime/io-api.h"
#include "flang/Runtime/main.h"
#include "flang/Runtime/stop.h"
#include <cstring>
#include <limits>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/pgmath.h.inc -------------------------------===//
//===-- include/flang/Evaluate/pgmath.h.inc -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/allocatable.h -----------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/allocatable.h ----------------
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -11,8 +11,8 @@
#ifndef FORTRAN_RUNTIME_ALLOCATABLE_H_
#define FORTRAN_RUNTIME_ALLOCATABLE_H_

#include "descriptor.h"
#include "entry-names.h"
#include "flang/Runtime/descriptor.h"
#include "flang/Runtime/entry-names.h"

namespace Fortran::runtime {

Expand Down
10 changes: 5 additions & 5 deletions flang/runtime/assign.h → flang/include/flang/Runtime/assign.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/assign.h --------------------------------------------------===//
//===-- include/flang/Runtime/assign.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.
Expand All @@ -20,10 +20,10 @@
// need not be handled here in the runtime; ditto for type conversions on
// intrinsic assignments.

#ifndef FLANG_RUNTIME_ASSIGN_H_
#define FLANG_RUNTIME_ASSIGN_H_
#ifndef FORTRAN_RUNTIME_ASSIGN_H_
#define FORTRAN_RUNTIME_ASSIGN_H_

#include "entry-names.h"
#include "flang/Runtime/entry-names.h"

namespace Fortran::runtime {
class Descriptor;
Expand All @@ -42,4 +42,4 @@ void RTNAME(Assign)(Descriptor &to, const Descriptor &from,
const char *sourceFile = nullptr, int sourceLine = 0);
} // extern "C"
} // namespace Fortran::runtime
#endif // FLANG_RUNTIME_ASSIGN_H_
#endif // FORTRAN_RUNTIME_ASSIGN_H_
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/c-or-cpp.h --------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/c-or-cpp.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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/character.h -------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/character.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.
Expand All @@ -11,7 +11,7 @@

#ifndef FORTRAN_RUNTIME_CHARACTER_H_
#define FORTRAN_RUNTIME_CHARACTER_H_
#include "entry-names.h"
#include "flang/Runtime/entry-names.h"
#include <cstddef>

namespace Fortran::runtime {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/command.h ---------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/command.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.
Expand All @@ -9,8 +9,8 @@
#ifndef FORTRAN_RUNTIME_COMMAND_H_
#define FORTRAN_RUNTIME_COMMAND_H_

#include "cpp-type.h"
#include "entry-names.h"
#include "flang/Runtime/cpp-type.h"
#include "flang/Runtime/entry-names.h"

namespace Fortran::runtime {
class Descriptor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/cpp-type.h --------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/cpp-type.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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/derived-api.h ---------------------------------------------===//
//===-- include/flang/Runtime/derived-api.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.
Expand All @@ -12,10 +12,10 @@
// local variables. Whole allocatable assignment should use AllocatableAssign()
// instead of this Assign().

#ifndef FLANG_RUNTIME_DERIVED_API_H_
#define FLANG_RUNTIME_DERIVED_API_H_
#ifndef FORTRAN_RUNTIME_DERIVED_API_H_
#define FORTRAN_RUNTIME_DERIVED_API_H_

#include "entry-names.h"
#include "flang/Runtime/entry-names.h"

namespace Fortran::runtime {
class Descriptor;
Expand All @@ -40,4 +40,4 @@ void RTNAME(Assign)(const Descriptor &, const Descriptor &,

} // extern "C"
} // namespace Fortran::runtime
#endif // FLANG_RUNTIME_DERIVED_API_H_
#endif // FORTRAN_RUNTIME_DERIVED_API_H_
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/descriptor.h ------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/descriptor.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.
Expand All @@ -18,9 +18,9 @@
// User C code is welcome to depend on that ISO_Fortran_binding.h file,
// but should never reference this internal header.

#include "memory.h"
#include "type-code.h"
#include "flang/ISO_Fortran_binding.h"
#include "flang/Runtime/memory.h"
#include "flang/Runtime/type-code.h"
#include <cassert>
#include <cinttypes>
#include <cstddef>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*===-- runtime/entry-names.h ---------------------------------------*- C -*-===
/*===-- include/flang/Runtime/entry-names.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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/io-api.h ----------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/io-api.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.
Expand All @@ -11,8 +11,8 @@
#ifndef FORTRAN_RUNTIME_IO_API_H_
#define FORTRAN_RUNTIME_IO_API_H_

#include "entry-names.h"
#include "iostat.h"
#include "flang/Runtime/entry-names.h"
#include "flang/Runtime/iostat.h"
#include <cinttypes>
#include <cstddef>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/iostat.h ----------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/iostat.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.
Expand All @@ -11,7 +11,7 @@

#ifndef FORTRAN_RUNTIME_IOSTAT_H_
#define FORTRAN_RUNTIME_IOSTAT_H_
#include "magic-numbers.h"
#include "flang/Runtime/magic-numbers.h"
namespace Fortran::runtime::io {

// The value of IOSTAT= is zero when no error, end-of-record,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#if 0 /*===-- runtime/magic-numbers.h -----------------------------------===*/
#if 0 /*===-- include/flang/Runtime/magic-numbers.h \
-----------------------===*/
/*
* 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
*
*===--------------------------------------------------------------------===*/
*===----------------------------------------------------------------------===*/
#endif
#if 0
This header can be included into both Fortran and C.
Expand Down
6 changes: 3 additions & 3 deletions flang/runtime/main.h → flang/include/flang/Runtime/main.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/main.h ------------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/main.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.
Expand All @@ -9,8 +9,8 @@
#ifndef FORTRAN_RUNTIME_MAIN_H_
#define FORTRAN_RUNTIME_MAIN_H_

#include "c-or-cpp.h"
#include "entry-names.h"
#include "flang/Runtime/c-or-cpp.h"
#include "flang/Runtime/entry-names.h"

FORTRAN_EXTERN_C_BEGIN
void RTNAME(ProgramStart)(int, const char *[], const char *[]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/matmul.h ----------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/matmul.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.
Expand All @@ -10,7 +10,7 @@

#ifndef FORTRAN_RUNTIME_MATMUL_H_
#define FORTRAN_RUNTIME_MATMUL_H_
#include "entry-names.h"
#include "flang/Runtime/entry-names.h"
namespace Fortran::runtime {
class Descriptor;
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/memory.h ----------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/memory.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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/misc-intrinsic.h --------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/misc-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.
Expand All @@ -11,7 +11,7 @@
#ifndef FORTRAN_RUNTIME_MISC_INTRINSIC_H_
#define FORTRAN_RUNTIME_MISC_INTRINSIC_H_

#include "entry-names.h"
#include "flang/Runtime/entry-names.h"
#include <cstdint>

namespace Fortran::runtime {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/numeric.h ---------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/numeric.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.
Expand All @@ -12,8 +12,8 @@
#ifndef FORTRAN_RUNTIME_NUMERIC_H_
#define FORTRAN_RUNTIME_NUMERIC_H_

#include "cpp-type.h"
#include "entry-names.h"
#include "flang/Runtime/cpp-type.h"
#include "flang/Runtime/entry-names.h"

namespace Fortran::runtime {
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/pointer.h ---------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/pointer.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.
Expand All @@ -12,8 +12,8 @@
#ifndef FORTRAN_RUNTIME_POINTER_H_
#define FORTRAN_RUNTIME_POINTER_H_

#include "descriptor.h"
#include "entry-names.h"
#include "flang/Runtime/descriptor.h"
#include "flang/Runtime/entry-names.h"

namespace Fortran::runtime {
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/random.h --------------------------------------------------===//
//===-- include/flang/Runtime/random.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.
Expand All @@ -8,7 +8,7 @@

// Intrinsic subroutines RANDOM_INIT, RANDOM_NUMBER, and RANDOM_SEED.

#include "entry-names.h"
#include "flang/Runtime/entry-names.h"
#include <cstdint>

namespace Fortran::runtime {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/reduction.h -------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/reduction.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.
Expand All @@ -11,9 +11,9 @@
#ifndef FORTRAN_RUNTIME_REDUCTION_H_
#define FORTRAN_RUNTIME_REDUCTION_H_

#include "descriptor.h"
#include "entry-names.h"
#include "flang/Common/uint128.h"
#include "flang/Runtime/descriptor.h"
#include "flang/Runtime/entry-names.h"
#include <complex>
#include <cstdint>

Expand Down
6 changes: 3 additions & 3 deletions flang/runtime/stop.h → flang/include/flang/Runtime/stop.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/stop.h ------------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/stop.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.
Expand All @@ -9,8 +9,8 @@
#ifndef FORTRAN_RUNTIME_STOP_H_
#define FORTRAN_RUNTIME_STOP_H_

#include "c-or-cpp.h"
#include "entry-names.h"
#include "flang/Runtime/c-or-cpp.h"
#include "flang/Runtime/entry-names.h"
#include <stdlib.h>

FORTRAN_EXTERN_C_BEGIN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/time-intrinsic.h --------------------------------*- C++ -*-===//
//===-- include/flang/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.
Expand All @@ -12,8 +12,8 @@
#ifndef FORTRAN_RUNTIME_TIME_INTRINSIC_H_
#define FORTRAN_RUNTIME_TIME_INTRINSIC_H_

#include "cpp-type.h"
#include "entry-names.h"
#include "flang/Runtime/cpp-type.h"
#include "flang/Runtime/entry-names.h"

namespace Fortran::runtime {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/transformational.h ------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/transformational.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.
Expand All @@ -17,9 +17,9 @@
#ifndef FORTRAN_RUNTIME_TRANSFORMATIONAL_H_
#define FORTRAN_RUNTIME_TRANSFORMATIONAL_H_

#include "descriptor.h"
#include "entry-names.h"
#include "memory.h"
#include "flang/Runtime/descriptor.h"
#include "flang/Runtime/entry-names.h"
#include "flang/Runtime/memory.h"

namespace Fortran::runtime {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- runtime/type-code.h -------------------------------------*- C++ -*-===//
//===-- include/flang/Runtime/type-code.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.
Expand Down
Loading

0 comments on commit 830c0b9

Please sign in to comment.