[flang] Move runtime API headers to flang/include/flang/Runtime
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
GitOrigin-RevId: 830c0b9023cd0cf91955900e0d96283e7a8c3711
diff --git a/examples/external-hello.cpp b/examples/external-hello.cpp
index 7c300d7..f06126d 100644
--- a/examples/external-hello.cpp
+++ b/examples/external-hello.cpp
@@ -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>
diff --git a/runtime/pgmath.h.inc b/include/flang/Evaluate/pgmath.h.inc
similarity index 98%
rename from runtime/pgmath.h.inc
rename to include/flang/Evaluate/pgmath.h.inc
index 4985005..02d8ae3 100644
--- a/runtime/pgmath.h.inc
+++ b/include/flang/Evaluate/pgmath.h.inc
@@ -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.
diff --git a/runtime/allocatable.h b/include/flang/Runtime/allocatable.h
similarity index 97%
rename from runtime/allocatable.h
rename to include/flang/Runtime/allocatable.h
index 0a7332e..4818fdd 100644
--- a/runtime/allocatable.h
+++ b/include/flang/Runtime/allocatable.h
@@ -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.
@@ -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 {
diff --git a/runtime/assign.h b/include/flang/Runtime/assign.h
similarity index 88%
rename from runtime/assign.h
rename to include/flang/Runtime/assign.h
index c687799..141a0b6 100644
--- a/runtime/assign.h
+++ b/include/flang/Runtime/assign.h
@@ -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.
@@ -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;
@@ -42,4 +42,4 @@
const char *sourceFile = nullptr, int sourceLine = 0);
} // extern "C"
} // namespace Fortran::runtime
-#endif // FLANG_RUNTIME_ASSIGN_H_
+#endif // FORTRAN_RUNTIME_ASSIGN_H_
diff --git a/runtime/c-or-cpp.h b/include/flang/Runtime/c-or-cpp.h
similarity index 92%
rename from runtime/c-or-cpp.h
rename to include/flang/Runtime/c-or-cpp.h
index 016bce0..4babd88 100644
--- a/runtime/c-or-cpp.h
+++ b/include/flang/Runtime/c-or-cpp.h
@@ -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.
diff --git a/runtime/character.h b/include/flang/Runtime/character.h
similarity index 98%
rename from runtime/character.h
rename to include/flang/Runtime/character.h
index 622fbca..441faf2 100644
--- a/runtime/character.h
+++ b/include/flang/Runtime/character.h
@@ -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.
@@ -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 {
diff --git a/runtime/command.h b/include/flang/Runtime/command.h
similarity index 90%
rename from runtime/command.h
rename to include/flang/Runtime/command.h
index 8367d7c..5e98b41 100644
--- a/runtime/command.h
+++ b/include/flang/Runtime/command.h
@@ -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.
@@ -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;
diff --git a/runtime/cpp-type.h b/include/flang/Runtime/cpp-type.h
similarity index 96%
rename from runtime/cpp-type.h
rename to include/flang/Runtime/cpp-type.h
index 613df97..38a8cf7 100644
--- a/runtime/cpp-type.h
+++ b/include/flang/Runtime/cpp-type.h
@@ -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.
diff --git a/runtime/derived-api.h b/include/flang/Runtime/derived-api.h
similarity index 85%
rename from runtime/derived-api.h
rename to include/flang/Runtime/derived-api.h
index 44cd5d6..515905d 100644
--- a/runtime/derived-api.h
+++ b/include/flang/Runtime/derived-api.h
@@ -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.
@@ -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;
@@ -40,4 +40,4 @@
} // extern "C"
} // namespace Fortran::runtime
-#endif // FLANG_RUNTIME_DERIVED_API_H_
+#endif // FORTRAN_RUNTIME_DERIVED_API_H_
diff --git a/runtime/descriptor.h b/include/flang/Runtime/descriptor.h
similarity index 98%
rename from runtime/descriptor.h
rename to include/flang/Runtime/descriptor.h
index a8b23b8..2b927df 100644
--- a/runtime/descriptor.h
+++ b/include/flang/Runtime/descriptor.h
@@ -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.
@@ -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>
diff --git a/runtime/entry-names.h b/include/flang/Runtime/entry-names.h
similarity index 93%
rename from runtime/entry-names.h
rename to include/flang/Runtime/entry-names.h
index 4b669bd..39a04a9 100644
--- a/runtime/entry-names.h
+++ b/include/flang/Runtime/entry-names.h
@@ -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.
diff --git a/runtime/io-api.h b/include/flang/Runtime/io-api.h
similarity index 98%
rename from runtime/io-api.h
rename to include/flang/Runtime/io-api.h
index 13254ce..e6b4617 100644
--- a/runtime/io-api.h
+++ b/include/flang/Runtime/io-api.h
@@ -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.
@@ -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>
diff --git a/runtime/iostat.h b/include/flang/Runtime/iostat.h
similarity index 95%
rename from runtime/iostat.h
rename to include/flang/Runtime/iostat.h
index f51636d..ec1c239 100644
--- a/runtime/iostat.h
+++ b/include/flang/Runtime/iostat.h
@@ -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.
@@ -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,
diff --git a/runtime/magic-numbers.h b/include/flang/Runtime/magic-numbers.h
similarity index 93%
rename from runtime/magic-numbers.h
rename to include/flang/Runtime/magic-numbers.h
index 388ee8a..f84b7ec 100644
--- a/runtime/magic-numbers.h
+++ b/include/flang/Runtime/magic-numbers.h
@@ -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.
diff --git a/runtime/main.h b/include/flang/Runtime/main.h
similarity index 79%
rename from runtime/main.h
rename to include/flang/Runtime/main.h
index a69eead..50bc46e 100644
--- a/runtime/main.h
+++ b/include/flang/Runtime/main.h
@@ -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.
@@ -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 *[]);
diff --git a/runtime/matmul.h b/include/flang/Runtime/matmul.h
similarity index 91%
rename from runtime/matmul.h
rename to include/flang/Runtime/matmul.h
index 8334d66..4598c48 100644
--- a/runtime/matmul.h
+++ b/include/flang/Runtime/matmul.h
@@ -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.
@@ -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" {
diff --git a/runtime/memory.h b/include/flang/Runtime/memory.h
similarity index 97%
rename from runtime/memory.h
rename to include/flang/Runtime/memory.h
index 4b09fe8..0afe525 100644
--- a/runtime/memory.h
+++ b/include/flang/Runtime/memory.h
@@ -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.
diff --git a/runtime/misc-intrinsic.h b/include/flang/Runtime/misc-intrinsic.h
similarity index 89%
rename from runtime/misc-intrinsic.h
rename to include/flang/Runtime/misc-intrinsic.h
index 16fa355..d4c2053 100644
--- a/runtime/misc-intrinsic.h
+++ b/include/flang/Runtime/misc-intrinsic.h
@@ -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.
@@ -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 {
diff --git a/runtime/numeric.h b/include/flang/Runtime/numeric.h
similarity index 98%
rename from runtime/numeric.h
rename to include/flang/Runtime/numeric.h
index e18ee36..6130a25 100644
--- a/runtime/numeric.h
+++ b/include/flang/Runtime/numeric.h
@@ -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.
@@ -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" {
diff --git a/runtime/pointer.h b/include/flang/Runtime/pointer.h
similarity index 96%
rename from runtime/pointer.h
rename to include/flang/Runtime/pointer.h
index 838fde2..ea3e5b7 100644
--- a/runtime/pointer.h
+++ b/include/flang/Runtime/pointer.h
@@ -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.
@@ -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" {
diff --git a/runtime/random.h b/include/flang/Runtime/random.h
similarity index 89%
rename from runtime/random.h
rename to include/flang/Runtime/random.h
index 5a8488f..388a589 100644
--- a/runtime/random.h
+++ b/include/flang/Runtime/random.h
@@ -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.
@@ -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 {
diff --git a/runtime/reduction.h b/include/flang/Runtime/reduction.h
similarity index 98%
rename from runtime/reduction.h
rename to include/flang/Runtime/reduction.h
index 4cc0765..d70bb0d 100644
--- a/runtime/reduction.h
+++ b/include/flang/Runtime/reduction.h
@@ -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.
@@ -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>
diff --git a/runtime/stop.h b/include/flang/Runtime/stop.h
similarity index 87%
rename from runtime/stop.h
rename to include/flang/Runtime/stop.h
index 638fa17..19c7814 100644
--- a/runtime/stop.h
+++ b/include/flang/Runtime/stop.h
@@ -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.
@@ -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
diff --git a/runtime/time-intrinsic.h b/include/flang/Runtime/time-intrinsic.h
similarity index 91%
rename from runtime/time-intrinsic.h
rename to include/flang/Runtime/time-intrinsic.h
index 42ac77f..c48e961 100644
--- a/runtime/time-intrinsic.h
+++ b/include/flang/Runtime/time-intrinsic.h
@@ -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.
@@ -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 {
diff --git a/runtime/transformational.h b/include/flang/Runtime/transformational.h
similarity index 93%
rename from runtime/transformational.h
rename to include/flang/Runtime/transformational.h
index 08f2d9a..ad17d48 100644
--- a/runtime/transformational.h
+++ b/include/flang/Runtime/transformational.h
@@ -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.
@@ -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 {
diff --git a/runtime/type-code.h b/include/flang/Runtime/type-code.h
similarity index 96%
rename from runtime/type-code.h
rename to include/flang/Runtime/type-code.h
index c859ede..b64167e 100644
--- a/runtime/type-code.h
+++ b/include/flang/Runtime/type-code.h
@@ -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.
diff --git a/lib/Evaluate/intrinsics-library.cpp b/lib/Evaluate/intrinsics-library.cpp
index 1023590..2aef9f7 100644
--- a/lib/Evaluate/intrinsics-library.cpp
+++ b/lib/Evaluate/intrinsics-library.cpp
@@ -287,7 +287,7 @@
// First declare all libpgmaths functions
#define PGMATH_LINKING
#define PGMATH_DECLARE
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
#define REAL_FOLDER(name, func) \
FolderFactory<decltype(&func), &func>::Create(#name)
@@ -295,7 +295,7 @@
static constexpr HostRuntimeFunction table[]{
#define PGMATH_FAST
#define PGMATH_USE_S(name, func) REAL_FOLDER(name, func),
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
};
static constexpr HostRuntimeMap map{table};
static_assert(map.Verify(), "map must be sorted");
@@ -304,7 +304,7 @@
static constexpr HostRuntimeFunction table[]{
#define PGMATH_FAST
#define PGMATH_USE_D(name, func) REAL_FOLDER(name, func),
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
};
static constexpr HostRuntimeMap map{table};
static_assert(map.Verify(), "map must be sorted");
@@ -313,7 +313,7 @@
static constexpr HostRuntimeFunction table[]{
#define PGMATH_RELAXED
#define PGMATH_USE_S(name, func) REAL_FOLDER(name, func),
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
};
static constexpr HostRuntimeMap map{table};
static_assert(map.Verify(), "map must be sorted");
@@ -322,7 +322,7 @@
static constexpr HostRuntimeFunction table[]{
#define PGMATH_RELAXED
#define PGMATH_USE_D(name, func) REAL_FOLDER(name, func),
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
};
static constexpr HostRuntimeMap map{table};
static_assert(map.Verify(), "map must be sorted");
@@ -331,7 +331,7 @@
static constexpr HostRuntimeFunction table[]{
#define PGMATH_PRECISE
#define PGMATH_USE_S(name, func) REAL_FOLDER(name, func),
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
};
static constexpr HostRuntimeMap map{table};
static_assert(map.Verify(), "map must be sorted");
@@ -340,7 +340,7 @@
static constexpr HostRuntimeFunction table[]{
#define PGMATH_PRECISE
#define PGMATH_USE_D(name, func) REAL_FOLDER(name, func),
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
};
static constexpr HostRuntimeMap map{table};
static_assert(map.Verify(), "map must be sorted");
diff --git a/lib/Lower/CharacterRuntime.cpp b/lib/Lower/CharacterRuntime.cpp
index 4bfbf58..e0d5dbc 100644
--- a/lib/Lower/CharacterRuntime.cpp
+++ b/lib/Lower/CharacterRuntime.cpp
@@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//
#include "flang/Lower/CharacterRuntime.h"
-#include "../../runtime/character.h"
#include "RTBuilder.h"
#include "flang/Lower/Bridge.h"
#include "flang/Lower/CharacterExpr.h"
#include "flang/Lower/FIRBuilder.h"
+#include "flang/Runtime/character.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
using namespace Fortran::runtime;
diff --git a/lib/Lower/IO.cpp b/lib/Lower/IO.cpp
index cca8561..236e90e 100644
--- a/lib/Lower/IO.cpp
+++ b/lib/Lower/IO.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include "flang/Lower/IO.h"
-#include "../../runtime/io-api.h"
#include "RTBuilder.h"
#include "flang/Lower/Bridge.h"
#include "flang/Lower/CharacterExpr.h"
@@ -17,6 +16,7 @@
#include "flang/Lower/Runtime.h"
#include "flang/Lower/Utils.h"
#include "flang/Parser/parse-tree.h"
+#include "flang/Runtime/io-api.h"
#include "flang/Semantics/tools.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
diff --git a/lib/Lower/IntrinsicCall.cpp b/lib/Lower/IntrinsicCall.cpp
index 2d00e90..ab9c594 100644
--- a/lib/Lower/IntrinsicCall.cpp
+++ b/lib/Lower/IntrinsicCall.cpp
@@ -29,7 +29,7 @@
#include <utility>
#define PGMATH_DECLARE
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
/// This file implements lowering of Fortran intrinsic procedures.
/// Intrinsics are lowered to a mix of FIR and MLIR operations as
@@ -283,17 +283,17 @@
static constexpr RuntimeFunction pgmathFast[] = {
#define PGMATH_FAST
#define PGMATH_USE_ALL_TYPES(name, func) RUNTIME_STATIC_DESCRIPTION(name, func)
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
};
static constexpr RuntimeFunction pgmathRelaxed[] = {
#define PGMATH_RELAXED
#define PGMATH_USE_ALL_TYPES(name, func) RUNTIME_STATIC_DESCRIPTION(name, func)
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
};
static constexpr RuntimeFunction pgmathPrecise[] = {
#define PGMATH_PRECISE
#define PGMATH_USE_ALL_TYPES(name, func) RUNTIME_STATIC_DESCRIPTION(name, func)
-#include "../runtime/pgmath.h.inc"
+#include "flang/Evaluate/pgmath.h.inc"
};
static mlir::FunctionType genF32F32FuncType(mlir::MLIRContext *context) {
diff --git a/lib/Lower/RTBuilder.h b/lib/Lower/RTBuilder.h
index 38dfa60..4b4e63d 100644
--- a/lib/Lower/RTBuilder.h
+++ b/lib/Lower/RTBuilder.h
@@ -25,7 +25,7 @@
#include <functional>
// List the runtime headers we want to be able to dissect
-#include "../../runtime/io-api.h"
+#include "flang/Runtime/io-api.h"
namespace Fortran::lower {
diff --git a/lib/Semantics/compute-offsets.cpp b/lib/Semantics/compute-offsets.cpp
index 5ebe3e4..c878f6c 100644
--- a/lib/Semantics/compute-offsets.cpp
+++ b/lib/Semantics/compute-offsets.cpp
@@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//
#include "compute-offsets.h"
-#include "../../runtime/descriptor.h"
#include "flang/Evaluate/fold-designator.h"
#include "flang/Evaluate/fold.h"
#include "flang/Evaluate/shape.h"
#include "flang/Evaluate/type.h"
+#include "flang/Runtime/descriptor.h"
#include "flang/Semantics/scope.h"
#include "flang/Semantics/semantics.h"
#include "flang/Semantics/symbol.h"
diff --git a/module/iso_fortran_env.f90 b/module/iso_fortran_env.f90
index c8dc03b..3d77485 100644
--- a/module/iso_fortran_env.f90
+++ b/module/iso_fortran_env.f90
@@ -9,7 +9,7 @@
! See Fortran 2018, clause 16.10.2
! TODO: These are placeholder values so that some tests can be run.
-include '../runtime/magic-numbers.h' ! for IOSTAT= error/end code values
+include '../include/flang/Runtime/magic-numbers.h' ! for IOSTAT= error/end code values
module iso_fortran_env
diff --git a/runtime/ISO_Fortran_binding.cpp b/runtime/ISO_Fortran_binding.cpp
index c49bb67..0a385ec 100644
--- a/runtime/ISO_Fortran_binding.cpp
+++ b/runtime/ISO_Fortran_binding.cpp
@@ -9,8 +9,8 @@
// Implements the required interoperability API from ISO_Fortran_binding.h
// as specified in section 18.5.5 of Fortran 2018.
-#include "../include/flang/ISO_Fortran_binding.h"
-#include "descriptor.h"
+#include "flang/ISO_Fortran_binding.h"
+#include "flang/Runtime/descriptor.h"
#include <cstdlib>
namespace Fortran::ISO {
diff --git a/runtime/allocatable.cpp b/runtime/allocatable.cpp
index 10ccb68..e0ffd5b 100644
--- a/runtime/allocatable.cpp
+++ b/runtime/allocatable.cpp
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
-#include "allocatable.h"
-#include "assign.h"
+#include "flang/Runtime/allocatable.h"
#include "derived.h"
#include "stat.h"
#include "terminator.h"
#include "type-info.h"
+#include "flang/Runtime/assign.h"
namespace Fortran::runtime {
extern "C" {
diff --git a/runtime/assign.cpp b/runtime/assign.cpp
index 5f31ad0..0455980 100644
--- a/runtime/assign.cpp
+++ b/runtime/assign.cpp
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
-#include "assign.h"
+#include "flang/Runtime/assign.h"
#include "derived.h"
-#include "descriptor.h"
#include "stat.h"
#include "terminator.h"
#include "type-info.h"
+#include "flang/Runtime/descriptor.h"
namespace Fortran::runtime {
diff --git a/runtime/buffer.h b/runtime/buffer.h
index 1097824..eec2841 100644
--- a/runtime/buffer.h
+++ b/runtime/buffer.h
@@ -12,7 +12,7 @@
#define FORTRAN_RUNTIME_BUFFER_H_
#include "io-error.h"
-#include "memory.h"
+#include "flang/Runtime/memory.h"
#include <algorithm>
#include <cinttypes>
#include <cstring>
diff --git a/runtime/character.cpp b/runtime/character.cpp
index d88db56..50f796d 100644
--- a/runtime/character.cpp
+++ b/runtime/character.cpp
@@ -6,13 +6,13 @@
//
//===----------------------------------------------------------------------===//
-#include "character.h"
-#include "cpp-type.h"
-#include "descriptor.h"
+#include "flang/Runtime/character.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Common/bit-population-count.h"
#include "flang/Common/uint128.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
#include <algorithm>
#include <cstring>
diff --git a/runtime/command.cpp b/runtime/command.cpp
index 603da15..5d11d6c 100644
--- a/runtime/command.cpp
+++ b/runtime/command.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "command.h"
+#include "flang/Runtime/command.h"
#include "environment.h"
namespace Fortran::runtime {
diff --git a/runtime/complex-reduction.h b/runtime/complex-reduction.h
index f26847f..5940fff 100644
--- a/runtime/complex-reduction.h
+++ b/runtime/complex-reduction.h
@@ -15,7 +15,7 @@
#ifndef FORTRAN_RUNTIME_COMPLEX_REDUCTION_H_
#define FORTRAN_RUNTIME_COMPLEX_REDUCTION_H_
-#include "entry-names.h"
+#include "flang/Runtime/entry-names.h"
#include <complex.h>
struct CppDescriptor; /* dummy type name for Fortran::runtime::Descriptor */
diff --git a/runtime/copy.cpp b/runtime/copy.cpp
index 1315472..71ef2c2 100644
--- a/runtime/copy.cpp
+++ b/runtime/copy.cpp
@@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//
#include "copy.h"
-#include "allocatable.h"
-#include "descriptor.h"
#include "terminator.h"
#include "type-info.h"
+#include "flang/Runtime/allocatable.h"
+#include "flang/Runtime/descriptor.h"
#include <cstring>
namespace Fortran::runtime {
diff --git a/runtime/copy.h b/runtime/copy.h
index 6de4455..6458e79 100644
--- a/runtime/copy.h
+++ b/runtime/copy.h
@@ -1,4 +1,4 @@
-//===-- runtime/copy.h -----------------------------------------*- C++ -*-===//
+//===-- runtime/copy.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.
@@ -12,7 +12,7 @@
#ifndef FORTRAN_RUNTIME_COPY_H_
#define FORTRAN_RUNTIME_COPY_H_
-#include "descriptor.h"
+#include "flang/Runtime/descriptor.h"
namespace Fortran::runtime {
diff --git a/runtime/derived-api.cpp b/runtime/derived-api.cpp
index 98a0096..fa76b96 100644
--- a/runtime/derived-api.cpp
+++ b/runtime/derived-api.cpp
@@ -7,11 +7,11 @@
//
//===----------------------------------------------------------------------===//
-#include "derived-api.h"
+#include "flang/Runtime/derived-api.h"
#include "derived.h"
-#include "descriptor.h"
#include "terminator.h"
#include "type-info.h"
+#include "flang/Runtime/descriptor.h"
namespace Fortran::runtime {
diff --git a/runtime/derived.cpp b/runtime/derived.cpp
index 6ae4d3e..887d813 100644
--- a/runtime/derived.cpp
+++ b/runtime/derived.cpp
@@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//
#include "derived.h"
-#include "descriptor.h"
#include "stat.h"
#include "terminator.h"
#include "type-info.h"
+#include "flang/Runtime/descriptor.h"
namespace Fortran::runtime {
diff --git a/runtime/derived.h b/runtime/derived.h
index e6b35ac..d655a67 100644
--- a/runtime/derived.h
+++ b/runtime/derived.h
@@ -8,8 +8,8 @@
// Internal runtime utilities for derived type operations.
-#ifndef FLANG_RUNTIME_DERIVED_H_
-#define FLANG_RUNTIME_DERIVED_H_
+#ifndef FORTRAN_RUNTIME_DERIVED_H_
+#define FORTRAN_RUNTIME_DERIVED_H_
namespace Fortran::runtime::typeInfo {
class DerivedType;
@@ -32,4 +32,4 @@
void Destroy(const Descriptor &, bool finalize, const typeInfo::DerivedType &);
} // namespace Fortran::runtime
-#endif // FLANG_RUNTIME_DERIVED_H_
+#endif // FORTRAN_RUNTIME_DERIVED_H_
diff --git a/runtime/descriptor-io.h b/runtime/descriptor-io.h
index 52b328b..e8cfc33 100644
--- a/runtime/descriptor-io.h
+++ b/runtime/descriptor-io.h
@@ -14,8 +14,6 @@
// some scalar I/O data transfer APIs could be changed to bypass their use
// of descriptors in the future for better efficiency.)
-#include "cpp-type.h"
-#include "descriptor.h"
#include "edit-input.h"
#include "edit-output.h"
#include "io-stmt.h"
@@ -23,6 +21,8 @@
#include "type-info.h"
#include "unit.h"
#include "flang/Common/uint128.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
namespace Fortran::runtime::io::descr {
template <typename A>
diff --git a/runtime/descriptor.cpp b/runtime/descriptor.cpp
index 274cdd7..fcb1c97 100644
--- a/runtime/descriptor.cpp
+++ b/runtime/descriptor.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "descriptor.h"
+#include "flang/Runtime/descriptor.h"
#include "derived.h"
#include "memory.h"
#include "stat.h"
diff --git a/runtime/dot-product.cpp b/runtime/dot-product.cpp
index 075d987..db790c3 100644
--- a/runtime/dot-product.cpp
+++ b/runtime/dot-product.cpp
@@ -6,11 +6,11 @@
//
//===----------------------------------------------------------------------===//
-#include "cpp-type.h"
-#include "descriptor.h"
-#include "reduction.h"
#include "terminator.h"
#include "tools.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/reduction.h"
#include <cinttypes>
namespace Fortran::runtime {
diff --git a/runtime/extrema.cpp b/runtime/extrema.cpp
index c0a97da..3e471b3 100644
--- a/runtime/extrema.cpp
+++ b/runtime/extrema.cpp
@@ -10,10 +10,10 @@
// and shapes and (for MAXLOC & MINLOC) result integer kinds. Also implements
// NORM2 using common infrastructure.
-#include "character.h"
#include "reduction-templates.h"
-#include "reduction.h"
#include "flang/Common/long-double.h"
+#include "flang/Runtime/character.h"
+#include "flang/Runtime/reduction.h"
#include <algorithm>
#include <cinttypes>
#include <cmath>
diff --git a/runtime/file.cpp b/runtime/file.cpp
index faf4051..b8e349b 100644
--- a/runtime/file.cpp
+++ b/runtime/file.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
#include "file.h"
-#include "magic-numbers.h"
-#include "memory.h"
+#include "flang/Runtime/magic-numbers.h"
+#include "flang/Runtime/memory.h"
#include <algorithm>
#include <cerrno>
#include <cstring>
diff --git a/runtime/file.h b/runtime/file.h
index 7e7b27c..3770b19 100644
--- a/runtime/file.h
+++ b/runtime/file.h
@@ -12,7 +12,7 @@
#define FORTRAN_RUNTIME_FILE_H_
#include "io-error.h"
-#include "memory.h"
+#include "flang/Runtime/memory.h"
#include <cinttypes>
#include <optional>
diff --git a/runtime/findloc.cpp b/runtime/findloc.cpp
index 74d9474..f268d46 100644
--- a/runtime/findloc.cpp
+++ b/runtime/findloc.cpp
@@ -9,10 +9,10 @@
// Implements FINDLOC for all required operand types and shapes and result
// integer kinds.
-#include "character.h"
#include "reduction-templates.h"
-#include "reduction.h"
#include "flang/Common/long-double.h"
+#include "flang/Runtime/character.h"
+#include "flang/Runtime/reduction.h"
#include <cinttypes>
#include <complex>
diff --git a/runtime/format-implementation.h b/runtime/format-implementation.h
index 8c41a98..b0ebcbc 100644
--- a/runtime/format-implementation.h
+++ b/runtime/format-implementation.h
@@ -13,9 +13,9 @@
#include "format.h"
#include "io-stmt.h"
-#include "main.h"
#include "flang/Common/format.h"
#include "flang/Decimal/decimal.h"
+#include "flang/Runtime/main.h"
#include <algorithm>
#include <limits>
diff --git a/runtime/internal-unit.cpp b/runtime/internal-unit.cpp
index 0c1d696..1cd0909 100644
--- a/runtime/internal-unit.cpp
+++ b/runtime/internal-unit.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
#include "internal-unit.h"
-#include "descriptor.h"
#include "io-error.h"
+#include "flang/Runtime/descriptor.h"
#include <algorithm>
#include <type_traits>
diff --git a/runtime/internal-unit.h b/runtime/internal-unit.h
index e5137eb..a26bcf6 100644
--- a/runtime/internal-unit.h
+++ b/runtime/internal-unit.h
@@ -12,7 +12,7 @@
#define FORTRAN_RUNTIME_IO_INTERNAL_UNIT_H_
#include "connection.h"
-#include "descriptor.h"
+#include "flang/Runtime/descriptor.h"
#include <cinttypes>
#include <type_traits>
diff --git a/runtime/io-api.cpp b/runtime/io-api.cpp
index d902bfe..43c5903 100644
--- a/runtime/io-api.cpp
+++ b/runtime/io-api.cpp
@@ -8,18 +8,18 @@
// Implements the I/O statement API
-#include "io-api.h"
+#include "flang/Runtime/io-api.h"
#include "descriptor-io.h"
-#include "descriptor.h"
#include "edit-input.h"
#include "edit-output.h"
#include "environment.h"
#include "format.h"
#include "io-stmt.h"
-#include "memory.h"
#include "terminator.h"
#include "tools.h"
#include "unit.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/memory.h"
#include <cstdlib>
#include <memory>
diff --git a/runtime/io-error.cpp b/runtime/io-error.cpp
index 529a51c..48647ec 100644
--- a/runtime/io-error.cpp
+++ b/runtime/io-error.cpp
@@ -8,8 +8,8 @@
#include "io-error.h"
#include "config.h"
-#include "magic-numbers.h"
#include "tools.h"
+#include "flang/Runtime/magic-numbers.h"
#include <cerrno>
#include <cstdarg>
#include <cstdio>
diff --git a/runtime/io-error.h b/runtime/io-error.h
index dd2a269..c530a12 100644
--- a/runtime/io-error.h
+++ b/runtime/io-error.h
@@ -15,9 +15,9 @@
#ifndef FORTRAN_RUNTIME_IO_ERROR_H_
#define FORTRAN_RUNTIME_IO_ERROR_H_
-#include "iostat.h"
-#include "memory.h"
#include "terminator.h"
+#include "flang/Runtime/iostat.h"
+#include "flang/Runtime/memory.h"
#include <cinttypes>
namespace Fortran::runtime::io {
diff --git a/runtime/io-stmt.cpp b/runtime/io-stmt.cpp
index edea5dc..0f64d76 100644
--- a/runtime/io-stmt.cpp
+++ b/runtime/io-stmt.cpp
@@ -9,9 +9,9 @@
#include "io-stmt.h"
#include "connection.h"
#include "format.h"
-#include "memory.h"
#include "tools.h"
#include "unit.h"
+#include "flang/Runtime/memory.h"
#include <algorithm>
#include <cstdio>
#include <cstring>
diff --git a/runtime/io-stmt.h b/runtime/io-stmt.h
index 32aeae0..dfaed3e 100644
--- a/runtime/io-stmt.h
+++ b/runtime/io-stmt.h
@@ -12,12 +12,12 @@
#define FORTRAN_RUNTIME_IO_STMT_H_
#include "connection.h"
-#include "descriptor.h"
#include "file.h"
#include "format.h"
#include "internal-unit.h"
-#include "io-api.h"
#include "io-error.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/io-api.h"
#include <functional>
#include <type_traits>
#include <variant>
diff --git a/runtime/iostat.cpp b/runtime/iostat.cpp
index 15a4877..649141f 100644
--- a/runtime/iostat.cpp
+++ b/runtime/iostat.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "iostat.h"
+#include "flang/Runtime/iostat.h"
namespace Fortran::runtime::io {
const char *IostatErrorString(int iostat) {
diff --git a/runtime/main.cpp b/runtime/main.cpp
index bc3c044..56a4709 100644
--- a/runtime/main.cpp
+++ b/runtime/main.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "main.h"
+#include "flang/Runtime/main.h"
#include "environment.h"
#include "terminator.h"
#include <cfenv>
diff --git a/runtime/matmul.cpp b/runtime/matmul.cpp
index 3d10ca0..ec15814 100644
--- a/runtime/matmul.cpp
+++ b/runtime/matmul.cpp
@@ -19,11 +19,11 @@
//
// Places where BLAS routines could be called are marked as TODO items.
-#include "matmul.h"
-#include "cpp-type.h"
-#include "descriptor.h"
+#include "flang/Runtime/matmul.h"
#include "terminator.h"
#include "tools.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
namespace Fortran::runtime {
diff --git a/runtime/memory.cpp b/runtime/memory.cpp
index 4fa599b..5ed7379 100644
--- a/runtime/memory.cpp
+++ b/runtime/memory.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "memory.h"
+#include "flang/Runtime/memory.h"
#include "terminator.h"
#include <cstdlib>
diff --git a/runtime/misc-intrinsic.cpp b/runtime/misc-intrinsic.cpp
index 3d77ce7..7b8509a 100644
--- a/runtime/misc-intrinsic.cpp
+++ b/runtime/misc-intrinsic.cpp
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#include "misc-intrinsic.h"
-#include "descriptor.h"
+#include "flang/Runtime/misc-intrinsic.h"
#include "terminator.h"
+#include "flang/Runtime/descriptor.h"
#include <algorithm>
#include <cstring>
diff --git a/runtime/namelist.cpp b/runtime/namelist.cpp
index 42140c5..b9b5fbc 100644
--- a/runtime/namelist.cpp
+++ b/runtime/namelist.cpp
@@ -8,8 +8,8 @@
#include "namelist.h"
#include "descriptor-io.h"
-#include "io-api.h"
#include "io-stmt.h"
+#include "flang/Runtime/io-api.h"
#include <cstring>
#include <limits>
diff --git a/runtime/numeric.cpp b/runtime/numeric.cpp
index fa3cbb4..c04d501 100644
--- a/runtime/numeric.cpp
+++ b/runtime/numeric.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "numeric.h"
+#include "flang/Runtime/numeric.h"
#include "flang/Common/long-double.h"
#include <climits>
#include <cmath>
diff --git a/runtime/pointer.cpp b/runtime/pointer.cpp
index 9b6bfee..dd41e1f 100644
--- a/runtime/pointer.cpp
+++ b/runtime/pointer.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "pointer.h"
+#include "flang/Runtime/pointer.h"
#include "derived.h"
#include "stat.h"
#include "terminator.h"
diff --git a/runtime/product.cpp b/runtime/product.cpp
index 9ef2d99..d245e0d 100644
--- a/runtime/product.cpp
+++ b/runtime/product.cpp
@@ -9,8 +9,8 @@
// Implements PRODUCT for all required operand types and shapes.
#include "reduction-templates.h"
-#include "reduction.h"
#include "flang/Common/long-double.h"
+#include "flang/Runtime/reduction.h"
#include <cinttypes>
#include <complex>
diff --git a/runtime/random.cpp b/runtime/random.cpp
index 0ae4f27..f425046 100644
--- a/runtime/random.cpp
+++ b/runtime/random.cpp
@@ -9,12 +9,12 @@
// Implements the intrinsic subroutines RANDOM_INIT, RANDOM_NUMBER, and
// RANDOM_SEED.
-#include "random.h"
-#include "cpp-type.h"
-#include "descriptor.h"
+#include "flang/Runtime/random.h"
#include "lock.h"
#include "flang/Common/leading-zero-bit-count.h"
#include "flang/Common/uint128.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
#include <algorithm>
#include <cmath>
#include <cstdint>
diff --git a/runtime/reduction-templates.h b/runtime/reduction-templates.h
index ff9841a..11b491a 100644
--- a/runtime/reduction-templates.h
+++ b/runtime/reduction-templates.h
@@ -21,10 +21,10 @@
#ifndef FORTRAN_RUNTIME_REDUCTION_TEMPLATES_H_
#define FORTRAN_RUNTIME_REDUCTION_TEMPLATES_H_
-#include "cpp-type.h"
-#include "descriptor.h"
#include "terminator.h"
#include "tools.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
namespace Fortran::runtime {
diff --git a/runtime/reduction.cpp b/runtime/reduction.cpp
index 66fe9ef..0f858c8 100644
--- a/runtime/reduction.cpp
+++ b/runtime/reduction.cpp
@@ -12,10 +12,8 @@
// DOT_PRODUCT, FINDLOC, MATMUL, SUM, and PRODUCT are in their own eponymous
// source files.
// NORM2, MAXLOC, MINLOC, MAXVAL, and MINVAL are in extrema.cpp.
-//
-// TODO: IALL, IANY
-#include "reduction.h"
+#include "flang/Runtime/reduction.h"
#include "reduction-templates.h"
#include <cinttypes>
diff --git a/runtime/stat.cpp b/runtime/stat.cpp
index 5fb68d2..c0620f4 100644
--- a/runtime/stat.cpp
+++ b/runtime/stat.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
#include "stat.h"
-#include "descriptor.h"
#include "terminator.h"
+#include "flang/Runtime/descriptor.h"
namespace Fortran::runtime {
const char *StatErrorString(int stat) {
diff --git a/runtime/stat.h b/runtime/stat.h
index 19098b9..5c1828e 100644
--- a/runtime/stat.h
+++ b/runtime/stat.h
@@ -11,8 +11,8 @@
#ifndef FORTRAN_RUNTIME_STAT_H_
#define FORTRAN_RUNTIME_STAT_H_
-#include "magic-numbers.h"
#include "flang/ISO_Fortran_binding.h"
+#include "flang/Runtime/magic-numbers.h"
namespace Fortran::runtime {
class Descriptor;
diff --git a/runtime/stop.cpp b/runtime/stop.cpp
index b448e2e..2a666b5 100644
--- a/runtime/stop.cpp
+++ b/runtime/stop.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "stop.h"
+#include "flang/Runtime/stop.h"
#include "file.h"
#include "io-error.h"
#include "terminator.h"
diff --git a/runtime/sum.cpp b/runtime/sum.cpp
index fb32505..6bdb599 100644
--- a/runtime/sum.cpp
+++ b/runtime/sum.cpp
@@ -13,8 +13,8 @@
// (basically the same as manual "double-double").
#include "reduction-templates.h"
-#include "reduction.h"
#include "flang/Common/long-double.h"
+#include "flang/Runtime/reduction.h"
#include <cinttypes>
#include <complex>
diff --git a/runtime/terminator.h b/runtime/terminator.h
index 02d97be..dbf08fe 100644
--- a/runtime/terminator.h
+++ b/runtime/terminator.h
@@ -11,7 +11,7 @@
#ifndef FORTRAN_RUNTIME_TERMINATOR_H_
#define FORTRAN_RUNTIME_TERMINATOR_H_
-#include "entry-names.h"
+#include "flang/Runtime/entry-names.h"
#include <cstdarg>
namespace Fortran::runtime {
diff --git a/runtime/time-intrinsic.cpp b/runtime/time-intrinsic.cpp
index 80064c9..7a70f52 100644
--- a/runtime/time-intrinsic.cpp
+++ b/runtime/time-intrinsic.cpp
@@ -8,11 +8,10 @@
// Implements time-related intrinsic subroutines.
-#include "time-intrinsic.h"
-
-#include "descriptor.h"
+#include "flang/Runtime/time-intrinsic.h"
#include "terminator.h"
#include "tools.h"
+#include "flang/Runtime/descriptor.h"
#include <algorithm>
#include <cstdint>
#include <cstdio>
diff --git a/runtime/tools.h b/runtime/tools.h
index 2daa53a..ee2641b 100644
--- a/runtime/tools.h
+++ b/runtime/tools.h
@@ -9,11 +9,11 @@
#ifndef FORTRAN_RUNTIME_TOOLS_H_
#define FORTRAN_RUNTIME_TOOLS_H_
-#include "cpp-type.h"
-#include "descriptor.h"
-#include "memory.h"
#include "terminator.h"
#include "flang/Common/long-double.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/memory.h"
#include <functional>
#include <map>
#include <type_traits>
diff --git a/runtime/transformational.cpp b/runtime/transformational.cpp
index 1bf9338..20d6100 100644
--- a/runtime/transformational.cpp
+++ b/runtime/transformational.cpp
@@ -16,7 +16,7 @@
// work with arbitrary lower bounds. This may be technically an extension
// of the standard but it more likely to conform with its intent.
-#include "transformational.h"
+#include "flang/Runtime/transformational.h"
#include "copy.h"
#include "terminator.h"
#include "tools.h"
diff --git a/runtime/type-code.cpp b/runtime/type-code.cpp
index a38a7ab..d09959b 100644
--- a/runtime/type-code.cpp
+++ b/runtime/type-code.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "type-code.h"
+#include "flang/Runtime/type-code.h"
namespace Fortran::runtime {
diff --git a/runtime/type-info.h b/runtime/type-info.h
index 4e9a100..9f9bfb6 100644
--- a/runtime/type-info.h
+++ b/runtime/type-info.h
@@ -12,10 +12,10 @@
// A C++ perspective of the derived type description schemata in
// flang/module/__fortran_type_info.f90.
-#include "descriptor.h"
#include "terminator.h"
#include "flang/Common/Fortran.h"
#include "flang/Common/bit-population-count.h"
+#include "flang/Runtime/descriptor.h"
#include <cinttypes>
#include <memory>
#include <optional>
diff --git a/runtime/unit-map.h b/runtime/unit-map.h
index 961962a..d7d3613 100644
--- a/runtime/unit-map.h
+++ b/runtime/unit-map.h
@@ -13,8 +13,8 @@
#define FORTRAN_RUNTIME_UNIT_MAP_H_
#include "lock.h"
-#include "memory.h"
#include "unit.h"
+#include "flang/Runtime/memory.h"
#include <cstdlib>
namespace Fortran::runtime::io {
diff --git a/runtime/unit.h b/runtime/unit.h
index 99ba05d..797c9fd 100644
--- a/runtime/unit.h
+++ b/runtime/unit.h
@@ -18,8 +18,8 @@
#include "io-error.h"
#include "io-stmt.h"
#include "lock.h"
-#include "memory.h"
#include "terminator.h"
+#include "flang/Runtime/memory.h"
#include <cstdlib>
#include <cstring>
#include <optional>
diff --git a/test/Runtime/no-cpp-dep.c b/test/Runtime/no-cpp-dep.c
index c1d5ba3..9f3b8b9 100644
--- a/test/Runtime/no-cpp-dep.c
+++ b/test/Runtime/no-cpp-dep.c
@@ -5,10 +5,10 @@
REQUIRES: c-compiler
-RUN: %cc -std=c90 %s -I%runtimeincludes %libruntime %libdecimal -o /dev/null
+RUN: %cc -std=c90 %s -I%include %libruntime %libdecimal -o /dev/null
*/
-#include "entry-names.h"
+#include "flang/Runtime/entry-names.h"
/*
Manually add declarations for the runtime functions that we want to make sure
diff --git a/test/lit.cfg.py b/test/lit.cfg.py
index 317a0d7..130f745 100644
--- a/test/lit.cfg.py
+++ b/test/lit.cfg.py
@@ -78,16 +78,16 @@
if config.cc:
libruntime = os.path.join(config.flang_lib_dir, 'libFortranRuntime.a')
libdecimal = os.path.join(config.flang_lib_dir, 'libFortranDecimal.a')
- includes = os.path.join(config.flang_src_dir, 'runtime')
+ include = os.path.join(config.flang_src_dir, 'include')
- if os.path.isfile(libruntime) and os.path.isfile(libdecimal) and os.path.isdir(includes):
+ if os.path.isfile(libruntime) and os.path.isfile(libdecimal) and os.path.isdir(include):
config.available_features.add('c-compiler')
tools.append(ToolSubst('%cc', command=config.cc, unresolved='fatal'))
tools.append(ToolSubst('%libruntime', command=libruntime,
unresolved='fatal'))
tools.append(ToolSubst('%libdecimal', command=libdecimal,
unresolved='fatal'))
- tools.append(ToolSubst('%runtimeincludes', command=includes,
+ tools.append(ToolSubst('%include', command=include,
unresolved='fatal'))
if config.flang_standalone_build:
diff --git a/unittests/Evaluate/ISO-Fortran-binding.cpp b/unittests/Evaluate/ISO-Fortran-binding.cpp
index 8631892..d356d19 100644
--- a/unittests/Evaluate/ISO-Fortran-binding.cpp
+++ b/unittests/Evaluate/ISO-Fortran-binding.cpp
@@ -1,6 +1,6 @@
#include "testing.h"
-#include "../../include/flang/ISO_Fortran_binding.h"
-#include "../../runtime/descriptor.h"
+#include "flang/ISO_Fortran_binding.h"
+#include "flang/Runtime/descriptor.h"
#include "llvm/Support/raw_ostream.h"
#include <type_traits>
diff --git a/unittests/Evaluate/reshape.cpp b/unittests/Evaluate/reshape.cpp
index b4c1eff..5d138cd 100644
--- a/unittests/Evaluate/reshape.cpp
+++ b/unittests/Evaluate/reshape.cpp
@@ -1,6 +1,6 @@
#include "testing.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/transformational.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/transformational.h"
#include <cinttypes>
using namespace Fortran::common;
diff --git a/unittests/Runtime/CharacterTest.cpp b/unittests/Runtime/CharacterTest.cpp
index a386365..d6d3439 100644
--- a/unittests/Runtime/CharacterTest.cpp
+++ b/unittests/Runtime/CharacterTest.cpp
@@ -9,9 +9,9 @@
// Basic sanity tests of CHARACTER API; exhaustive testing will be done
// in Fortran.
-#include "../../runtime/character.h"
+#include "flang/Runtime/character.h"
#include "gtest/gtest.h"
-#include "../../runtime/descriptor.h"
+#include "flang/Runtime/descriptor.h"
#include <cstring>
#include <functional>
#include <tuple>
diff --git a/unittests/Runtime/CommandTest.cpp b/unittests/Runtime/CommandTest.cpp
index 9c67329..84a05fc 100644
--- a/unittests/Runtime/CommandTest.cpp
+++ b/unittests/Runtime/CommandTest.cpp
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#include "../../runtime/command.h"
+#include "flang/Runtime/command.h"
#include "gtest/gtest.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/main.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/main.h"
using namespace Fortran::runtime;
diff --git a/unittests/Runtime/ExternalIOTest.cpp b/unittests/Runtime/ExternalIOTest.cpp
index e1621ed..b75a7fe 100644
--- a/unittests/Runtime/ExternalIOTest.cpp
+++ b/unittests/Runtime/ExternalIOTest.cpp
@@ -12,9 +12,9 @@
#include "CrashHandlerFixture.h"
#include "gtest/gtest.h"
-#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 "llvm/Support/raw_ostream.h"
#include <cstring>
diff --git a/unittests/Runtime/ListInputTest.cpp b/unittests/Runtime/ListInputTest.cpp
index 7bcfa0f..50df1a7 100644
--- a/unittests/Runtime/ListInputTest.cpp
+++ b/unittests/Runtime/ListInputTest.cpp
@@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//
#include "CrashHandlerFixture.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/io-api.h"
#include "../../runtime/io-error.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/io-api.h"
using namespace Fortran::runtime;
using namespace Fortran::runtime::io;
diff --git a/unittests/Runtime/Matmul.cpp b/unittests/Runtime/Matmul.cpp
index 1f0c756..25e3b20 100644
--- a/unittests/Runtime/Matmul.cpp
+++ b/unittests/Runtime/Matmul.cpp
@@ -6,13 +6,13 @@
//
//===----------------------------------------------------------------------===//
-#include "../../runtime/matmul.h"
+#include "flang/Runtime/matmul.h"
#include "gtest/gtest.h"
#include "tools.h"
-#include "../../runtime/allocatable.h"
-#include "../../runtime/cpp-type.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/type-code.h"
+#include "flang/Runtime/allocatable.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/type-code.h"
using namespace Fortran::runtime;
using Fortran::common::TypeCategory;
diff --git a/unittests/Runtime/MiscIntrinsic.cpp b/unittests/Runtime/MiscIntrinsic.cpp
index 62213d0..bfdd6d6 100644
--- a/unittests/Runtime/MiscIntrinsic.cpp
+++ b/unittests/Runtime/MiscIntrinsic.cpp
@@ -8,10 +8,10 @@
#include "gtest/gtest.h"
#include "tools.h"
-#include "../../runtime/allocatable.h"
-#include "../../runtime/cpp-type.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/misc-intrinsic.h"
+#include "flang/Runtime//misc-intrinsic.h"
+#include "flang/Runtime/allocatable.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
using namespace Fortran::runtime;
diff --git a/unittests/Runtime/Namelist.cpp b/unittests/Runtime/Namelist.cpp
index 8f896cb..67336bb 100644
--- a/unittests/Runtime/Namelist.cpp
+++ b/unittests/Runtime/Namelist.cpp
@@ -9,8 +9,8 @@
#include "../../runtime/namelist.h"
#include "CrashHandlerFixture.h"
#include "tools.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/io-api.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/io-api.h"
#include <algorithm>
#include <cinttypes>
#include <complex>
diff --git a/unittests/Runtime/Numeric.cpp b/unittests/Runtime/Numeric.cpp
index f37ac27..571247a 100644
--- a/unittests/Runtime/Numeric.cpp
+++ b/unittests/Runtime/Numeric.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "../../runtime/numeric.h"
+#include "flang/Runtime/numeric.h"
#include "gtest/gtest.h"
#include <cmath>
#include <limits>
diff --git a/unittests/Runtime/NumericalFormatTest.cpp b/unittests/Runtime/NumericalFormatTest.cpp
index 746a495..e2cad5f 100644
--- a/unittests/Runtime/NumericalFormatTest.cpp
+++ b/unittests/Runtime/NumericalFormatTest.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
#include "CrashHandlerFixture.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/io-api.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/io-api.h"
#include <algorithm>
#include <array>
#include <cstring>
diff --git a/unittests/Runtime/Random.cpp b/unittests/Runtime/Random.cpp
index f16f3dc..c9abe04 100644
--- a/unittests/Runtime/Random.cpp
+++ b/unittests/Runtime/Random.cpp
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#include "../../runtime/random.h"
+#include "flang/Runtime//random.h"
#include "gtest/gtest.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/type-code.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/type-code.h"
#include <cmath>
using namespace Fortran::runtime;
diff --git a/unittests/Runtime/Reduction.cpp b/unittests/Runtime/Reduction.cpp
index e709b0c..32520cb 100644
--- a/unittests/Runtime/Reduction.cpp
+++ b/unittests/Runtime/Reduction.cpp
@@ -6,13 +6,13 @@
//
//===----------------------------------------------------------------------===//
-#include "../../runtime/reduction.h"
+#include "flang/Runtime/reduction.h"
#include "gtest/gtest.h"
#include "tools.h"
-#include "../../runtime/allocatable.h"
-#include "../../runtime/cpp-type.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/type-code.h"
+#include "flang/Runtime/allocatable.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/type-code.h"
#include <cstdint>
#include <cstring>
#include <string>
diff --git a/unittests/Runtime/RuntimeCrashTest.cpp b/unittests/Runtime/RuntimeCrashTest.cpp
index c894540..d22a253 100644
--- a/unittests/Runtime/RuntimeCrashTest.cpp
+++ b/unittests/Runtime/RuntimeCrashTest.cpp
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
#include "CrashHandlerFixture.h"
-#include "../../runtime/io-api.h"
#include "../../runtime/terminator.h"
+#include "flang/Runtime/io-api.h"
#include <gtest/gtest.h>
using namespace Fortran::runtime;
diff --git a/unittests/Runtime/Time.cpp b/unittests/Runtime/Time.cpp
index ba54dda..4720e7e 100644
--- a/unittests/Runtime/Time.cpp
+++ b/unittests/Runtime/Time.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "gtest/gtest.h"
-#include "../../runtime/time-intrinsic.h"
+#include "flang/Runtime/time-intrinsic.h"
#include <algorithm>
#include <cctype>
#include <charconv>
diff --git a/unittests/Runtime/Transformational.cpp b/unittests/Runtime/Transformational.cpp
index 52e0b7e..ac4d9dd 100644
--- a/unittests/Runtime/Transformational.cpp
+++ b/unittests/Runtime/Transformational.cpp
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#include "../../runtime/transformational.h"
+#include "flang/Runtime/transformational.h"
#include "gtest/gtest.h"
#include "tools.h"
-#include "../../runtime/type-code.h"
+#include "flang/Runtime/type-code.h"
using namespace Fortran::runtime;
using Fortran::common::TypeCategory;
diff --git a/unittests/Runtime/tools.h b/unittests/Runtime/tools.h
index bca579b..b25e296 100644
--- a/unittests/Runtime/tools.h
+++ b/unittests/Runtime/tools.h
@@ -10,10 +10,10 @@
#define FORTRAN_UNITTESTS_RUNTIME_TOOLS_H_
#include "gtest/gtest.h"
-#include "../../runtime/allocatable.h"
-#include "../../runtime/cpp-type.h"
-#include "../../runtime/descriptor.h"
-#include "../../runtime/type-code.h"
+#include "flang/Runtime/allocatable.h"
+#include "flang/Runtime/cpp-type.h"
+#include "flang/Runtime/descriptor.h"
+#include "flang/Runtime/type-code.h"
#include <cstdint>
#include <cstring>
#include <vector>