62 changes: 31 additions & 31 deletions FortranRuntime/README.md → flang-rt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
-->

# Fortran Runtime
# Fortran Runtime (flang-rt)

Fortran Runtime is the runtime library for code emitted by the Flang compiler
Flang-rt is the runtime library for code emitted by the Flang compiler
(https://flang.llvm.org).


## Getting Started

There are two build modes for the FortranRuntime. The bootstrap build, also
There are two build modes for the flang-rt. The bootstrap build, also
called the in-tree build, and the runtime-only build, also called the
out-of-tree build.
Not to be confused with the terms
Expand All @@ -29,29 +29,29 @@ source directory. LLVM does not support in-source builds.

Requirements:
* [Same as LLVM](https://llvm.org/docs/GettingStarted.html#requirements).
* While for LLVM C++14 suffices, Flang and FortranRuntime require a
* While for LLVM C++14 suffices, Flang and flang-rt require a
C++17-capable C++ compiler.


### Bootstrap/In-Tree Build

The bootstrap build will first build Clang and Flang, then use these compilers
to compile the FortranRuntime. CMake will create a secondary build tree in
to compile flang-rt. CMake will create a secondary build tree in
configured with these just-built compilers. The secondary build will reuse the
same build options (Flags, Debug/Release, ...) as the primary build. It will
also ensure that once built, the FortranRuntime is found by Flang from either
the build- or install-prefix. To enable, add `FortranRuntime` to
also ensure that once built, flang-rt is found by Flang from either
the build- or install-prefix. To enable, add `flang-rt` to
`LLVM_ENABLE_RUNTIMES`:

```bash
cmake -S <path-to-llvm-project>/llvm \
-DNinja \
-DLLVM_ENABLE_PROJECTS=flang \
-DLLVM_ENABLE_RUNTIMES=FortranRuntime \
-DLLVM_ENABLE_RUNTIMES=flang-rt \
...
```

It is recommended to enable building OpenMP alongside Flang and FortranRuntime
It is recommended to enable building OpenMP alongside Flang and flang-rt
as well. This will build `omp_lib.mod` required to use OpenMP from Fortran.
Building Compiler-RT may also be required, particularly on platforms that do
not provide all C-ABI functionality (such as Windows).
Expand All @@ -61,7 +61,7 @@ cmake -S <path-to-llvm-project>/llvm \
-DNinja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="flang;openmp" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;FortranRuntime" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;flang-rt" \
...
```

Expand All @@ -74,8 +74,8 @@ cross-compilation via `flang-new --target=<target-triple>`, add more triples to
After configuration, build, test, and install the runtime(s) via

```shell
$ ninja FortranRuntime
$ ninja check-FortranRuntime
$ ninja flang-rt
$ ninja check-flang-rt
$ ninja install
```

Expand All @@ -87,7 +87,7 @@ CMake's environment introspection to find a C, C++, and Fortran compiler. The
compiler to be used can be controlled using CMake's standard mechanisms such as
`CMAKE_CXX_COMPILER`, `CMAKE_CXX_COMPILER`, and `CMAKE_Fortran_COMPILER`.
`CMAKE_Fortran_COMPILER` must be `flang-new` built from the same Git commit as
FortranRuntime to ensure they are using the same ABI. The C and C++ compiler
flang-rt to ensure they are using the same ABI. The C and C++ compiler
can be any compiler supporting the same ABI.

In addition to the compiler, the build be able to find LLVM development tools
Expand All @@ -100,13 +100,13 @@ cmake -S <path-to-llvm-project>/runtimes \
-GNinja \
-DLLVM_BINARY_DIR=<path-to-llvm-builddir> \
-DCMAKE_Fortran_COMPILER=<path-to-llvm-builddir>/bin/flang-new \
-DLLVM_ENABLE_RUNTIMES=FortranRuntime \
-DLLVM_ENABLE_RUNTIMES=flang-rt \
...
```

Building the FortranRuntime for cross-compilation triple, the target triple can
Building flang-rt for cross-compilation triple, the target triple can
be selected using `LLVM_DEFAULT_TARGET_TRIPLE` AND `LLVM_RUNTIMES_TARGET`.
Of course, FortranRuntime can be built multiple times with different build
Of course, flang-rt can be built multiple times with different build
configurations, but have to be located manually when using with the Flang
driver using the `-L` option.

Expand All @@ -117,7 +117,7 @@ cmake -S <path-to-llvm-project>/runtimes
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${HOME}/local" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;FortranRuntime" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;flang-rt" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DLLVM_BINARY_DIR=<path-to-llvm-builddir> \
Expand All @@ -131,13 +131,13 @@ cmake -S <path-to-llvm-project>/runtimes

## Configuration Option Reference

The FortranRuntime has the followign configuration options. This is in
Flang-rt has the followign configuration options. This is in
addition to the build options the LLVM_ENABLE_RUNTIMES mechanism and
CMake itself provide.

* `FORTRANRUNTIME_INCLUDE_TESTS` (boolean; default: `ON`)
* `FLANG_RT_INCLUDE_TESTS` (boolean; default: `ON`)

When `OFF`, does not add any tests and unittests. The `check-FortranRuntime`
When `OFF`, does not add any tests and unittests. The `check-flang-rt`
build target will do nothing.

* `FLANG_RUNTIME_F128_MATH_LIB` (default: `""`)
Expand All @@ -148,35 +148,35 @@ CMake itself provide.
the compiler for `__float128` or 128-bit `long double` support.
[More details](docs/Real16MathSupport.md).

* `FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT` (values: `"CUDA"`,`"OpenMP"`, `""` default: `""`)
* `FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT` (values: `"CUDA"`,`"OpenMP"`, `""` default: `""`)

When set to `CUDA`, builds a FortranRuntime with experimental support for GPU
When set to `CUDA`, builds flang-rt with experimental support for GPU
accelerators using CUDA. `CMAKE_CUDA_COMPILER` must be set if not
automatically detected by CMake. `nvcc` as well as `clang` are supported.

When set to `OpenMP`, builds a FortranRuntime with experimental support for
When set to `OpenMP`, builds flang-rt with experimental support for
GPU accelerators using OpenMP offloading. Only Clang is supported for
`CMAKE_C_COMPILER` and `CMAKE_CXX_COMPILER`.

* `FORTRANRUNTIME_ENABLE_CUF` (bool, default: `OFF`)
* `FLANG_RT_ENABLE_CUF` (bool, default: `OFF`)

Compiles the `libCufRuntime_cuda_<CUDA-version>.a/.so` library. This is
independent of `FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA` and only
independent of `FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA` and only
requires a
[CUDA Toolkit installation](https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html)
(no `CMAKE_CUDA_COMPILER`).


### CUDA Support

With `-DFORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA`, the following
With `-DFLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA`, the following
additional configuration options become available.

* `FORTRANRUNTIME_LIBCUDACXX_PATH` (path, default: `""`)
* `FLANG_RT_LIBCUDACXX_PATH` (path, default: `""`)

Path to libcu++ package installation.

* `FORTRANRUNTIME_CUDA_RUNTIME_PTX_WITHOUT_GLOBAL_VARS` (boolean, default: `OFF`)
* `FLANG_RT_CUDA_RUNTIME_PTX_WITHOUT_GLOBAL_VARS` (boolean, default: `OFF`)

Do not compile global variables' definitions when producing PTX library.
Default is `OFF`, meaning global variable definitions are compiled by
Expand All @@ -185,11 +185,11 @@ additional configuration options become available.

### OpenMP Offload Support

With `-DFORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT=OpenMP`, the following
With `-DFLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=OpenMP`, the following
additional configuration options become available.

* `FORTRANRUNTIME_DEVICE_ARCHITECTURES` (default: `"all"`)
* `FLANG_RT_DEVICE_ARCHITECTURES` (default: `"all"`)

A list of device architectures that the FortranRuntime is supporting.
A list of device architectures that flang-rt is supporting.
If `"all"` uses a pre-defined list of architectures. Same purpose as
`LIBOMPTARGET_DEVICE_ARCHITECTURES` from liboffload.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#===-- cmake/modules/AddFortranRuntime.cmake -------------------------------===#
#===-- cmake/modules/AddFlangRT.cmake -------------------------------===#
#
# 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
#
#===------------------------------------------------------------------------===#

# Builds a library with common options for FortranRuntime.
# Builds a library with common options for flang-rt.
#
# Usage:
#
# add_fortranruntime_library(name sources ...
# add_flangrt_library(name sources ...
# SHARED
# Build a dynamic (.so/.dll) library
# STATIC
Expand All @@ -28,7 +28,7 @@
# ADDITIONAL_HEADERS
# May specify header files for IDE generators.
# )
function (add_fortranruntime_library name)
function (add_flangrt_library name)
set(options STATIC SHARED OBJECT INSTALL_WITH_TOOLCHAIN EXCLUDE_FROM_ALL LINK_TO_LLVM)
set(multiValueArgs ADDITIONAL_HEADERS)
cmake_parse_arguments(ARG
Expand Down Expand Up @@ -76,23 +76,23 @@ function (add_fortranruntime_library name)
)
endif ()

# FortranRuntime's public headers
target_include_directories(${name} PRIVATE "${FORTRANRUNTIME_SOURCE_DIR}/include")
# Flang-rt's public headers
target_include_directories(${name} PRIVATE "${FLANGRT_SOURCE_DIR}/include")

# For ISO_Fortran_binding.h to be found by the runtime itself (Accessed as #include "flang/ISO_Fortran_binding.h")
# User applications can use #include <ISO_Fortran_binding.h>
target_include_directories(${name} PRIVATE "${FLANG_SOURCE_DIR}/include")

# For FortranRuntime's configured config.h to be found
target_include_directories(${name} PRIVATE "${FORTRANRUNTIME_BINARY_DIR}")
# For flang-rt's configured config.h to be found
target_include_directories(${name} PRIVATE "${FLANGRT_BINARY_DIR}")

# Clang/Flang, targeting the MSVC ABI, including clang-cl, should only depends
# on msv(u)crt. LLVM still emits libgcc/compiler-rt functions for 128-bit
# integer math (__udivti3, __modti3, __fixsfti, __floattidf, ...) that msvc
# does not support. We are injecting a dependency to Compiler-RT where these
# are implemented.
if (MSVC AND (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") AND FORTRANRUNTIME_LIBCALL)
target_compile_options(${name} PRIVATE "$<$<COMPILE_LANGUAGE:CXX,C>:-Xclang>$<$<COMPILE_LANGUAGE:Fortran>:-Xflang>" "--dependent-lib=${FORTRANRUNTIME_LIBCALL}")
# Flang/Clang (including clang-cl) -compiled programs targeting the MSVC ABI
# should only depend on msv(u)crt. LLVM still emits libgcc/compiler-rt
# functions for 128-bit integer math (__udivti3, __modti3, __fixsfti,
# __floattidf, ...) that msvc does not support. We are injecting a dependency
# to Compiler-RT where these are implemented.
if (MSVC AND (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") AND FLANGRT_LIBCALL)
target_compile_options(${name} PRIVATE "$<$<COMPILE_LANGUAGE:CXX,C>:-Xclang>$<$<COMPILE_LANGUAGE:Fortran>:-Xflang>" "--dependent-lib=${FLANGRT_LIBCALL}")
endif ()

# Non-GTest unittests depend on LLVMSupport
Expand All @@ -112,15 +112,15 @@ function (add_fortranruntime_library name)
if (ARG_INSTALL_WITH_TOOLCHAIN)
set_target_properties(${name}
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${FORTRANRUNTIME_BUILD_LIB_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${FORTRANRUNTIME_BUILD_LIB_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${FORTRANRUNTIME_BUILD_LIB_DIR}"
LIBRARY_OUTPUT_DIRECTORY "${FLANGRT_BUILD_LIB_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${FLANGRT_BUILD_LIB_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${FLANGRT_BUILD_LIB_DIR}"
)

install(TARGETS ${name}
LIBRARY DESTINATION "${FORTRANRUNTIME_INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${FORTRANRUNTIME_INSTALL_LIB_DIR}"
RUNTIME DESTINATION "${FORTRANRUNTIME_INSTALL_LIB_DIR}"
LIBRARY DESTINATION "${FLANGRT_INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${FLANGRT_INSTALL_LIB_DIR}"
RUNTIME DESTINATION "${FLANGRT_INSTALL_LIB_DIR}"
)
endif ()
endfunction (add_fortranruntime_library)
endfunction (add_flangrt_library)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#===------------------------------------------------------------------------===#

macro(enable_cuda_compilation name files)
if (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA")
if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA")
if (BUILD_SHARED_LIBS)
message(FATAL_ERROR
"BUILD_SHARED_LIBS is not supported for CUDA build of Fortran runtime"
Expand Down Expand Up @@ -42,26 +42,26 @@ macro(enable_cuda_compilation name files)
"${CUDA_COMPILE_OPTIONS}"
)

if (EXISTS "${FORTRANRUNTIME_LIBCUDACXX_PATH}/include")
if (EXISTS "${FLANG_RT_LIBCUDACXX_PATH}/include")
# When using libcudacxx headers files, we have to use them
# for all files of F18 runtime.
include_directories(AFTER ${FORTRANRUNTIME_LIBCUDACXX_PATH}/include)
include_directories(AFTER ${FLANG_RT_LIBCUDACXX_PATH}/include)
add_compile_definitions(RT_USE_LIBCUDACXX=1)
endif()

# Add an OBJECT library consisting of CUDA PTX.
add_fortranruntime_library(${name}PTX OBJECT ${files})
add_flangrt_library(${name}PTX OBJECT ${files})
set_property(TARGET ${name}PTX PROPERTY CUDA_PTX_COMPILATION ON)
if (FORTRANRUNTIME_CUDA_RUNTIME_PTX_WITHOUT_GLOBAL_VARS)
if (FLANG_RT_CUDA_RUNTIME_PTX_WITHOUT_GLOBAL_VARS)
target_compile_definitions(${name}PTX
PRIVATE FORTRANRUNTIME_NO_GLOBAL_VAR_DEFS
PRIVATE FLANGRT_NO_GLOBAL_VAR_DEFS
)
endif()
endif()
endmacro()

macro(enable_omp_offload_compilation files)
if (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "OpenMP")
if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "OpenMP")
# OpenMP offload build only works with Clang compiler currently.

if (BUILD_SHARED_LIBS)
Expand All @@ -88,13 +88,13 @@ macro(enable_omp_offload_compilation files)
"${all_amdgpu_architectures};${all_nvptx_architectures}"
)
# TODO: support auto detection on the build system.
if (FORTRANRUNTIME_DEVICE_ARCHITECTURES STREQUAL "all")
set(FORTRANRUNTIME_DEVICE_ARCHITECTURES ${all_gpu_architectures})
if (FLANG_RT_DEVICE_ARCHITECTURES STREQUAL "all")
set(FLANG_RT_DEVICE_ARCHITECTURES ${all_gpu_architectures})
endif()
list(REMOVE_DUPLICATES FORTRANRUNTIME_DEVICE_ARCHITECTURES)
list(REMOVE_DUPLICATES FLANG_RT_DEVICE_ARCHITECTURES)

string(REPLACE ";" "," compile_for_architectures
"${FORTRANRUNTIME_DEVICE_ARCHITECTURES}"
"${FLANG_RT_DEVICE_ARCHITECTURES}"
)

set(OMP_COMPILE_OPTIONS
Expand All @@ -115,7 +115,7 @@ macro(enable_omp_offload_compilation files)
)
else()
message(FATAL_ERROR
"FortranRuntime build with OpenMP offload is not supported for these compilers:\n"
"Flang-rt build with OpenMP offload is not supported for these compilers:\n"
"CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}\n"
"CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}")
endif()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//===-- include/flang/Runtime/CUDA/allocator.h ------------------*- C++ -*-===//
//===-- include/flang-rt/CufRuntime/allocator.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_CUDA_ALLOCATOR_H_
#define FORTRAN_RUNTIME_CUDA_ALLOCATOR_H_
#ifndef FORTRAN_CUFRUNTIME_ALLOCATOR_H_
#define FORTRAN_CUFRUNTIME_ALLOCATOR_H_

#include "flang/Runtime/descriptor-consts.h"
#include "flang/Runtime/entry-names.h"
Expand Down Expand Up @@ -43,4 +43,4 @@ void *CUFAllocUnified(std::size_t);
void CUFFreeUnified(void *);

} // namespace Fortran::runtime::cuda
#endif // FORTRAN_RUNTIME_CUDA_ALLOCATOR_H_
#endif /* FORTRAN_CUFRUNTIME_ALLOCATOR_H_ */
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//===-- include/FortranRuntime/Runtime/allocator-registry.h -----*- C++ -*-===//
//===-- include/flang-rt/flang_rt/allocator-registry.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_ALLOCATOR_REGISTRY_H_
#define FORTRAN_RUNTIME_ALLOCATOR_REGISTRY_H_
#ifndef FORTRAN_FLANG_RT_ALLOCATOR_REGISTRY_H_
#define FORTRAN_FLANG_RT_ALLOCATOR_REGISTRY_H_

#include "flang/Common/api-attrs.h"
#include "flang/Runtime/allocator-registry-consts.h"
Expand Down Expand Up @@ -55,4 +55,4 @@ RT_OFFLOAD_VAR_GROUP_END

} // namespace Fortran::runtime

#endif /* FORTRAN_RUNTIME_ALLOCATOR_REGISTRY_H_ */
#endif /* FORTRAN_FLANG_RT_ALLOCATOR_REGISTRY_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- include/FortranRuntime/Runtime/array-constructor.h ------*- C++ -*-===//
//===-- include/flang-rt/flang_rt/array-constructor.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,10 +9,10 @@
// External APIs to create temporary storage for array constructors when their
// final extents or length parameters cannot be pre-computed.

#ifndef FORTRAN_RUNTIME_ARRAY_CONSTRUCTOR_H_
#define FORTRAN_RUNTIME_ARRAY_CONSTRUCTOR_H_
#ifndef FORTRAN_FLANG_RT_ARRAY_CONSTRUCTOR_H_
#define FORTRAN_FLANG_RT_ARRAY_CONSTRUCTOR_H_

#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang/Runtime/array-constructor-consts.h"
#include "flang/Runtime/entry-names.h"
#include <cstdint>
Expand Down Expand Up @@ -45,4 +45,4 @@ struct ArrayConstructorVector {
};

} // namespace Fortran::runtime
#endif /* FORTRAN_RUNTIME_ARRAY_CONSTRUCTOR_H_ */
#endif /* FORTRAN_FLANG_RT_ARRAY_CONSTRUCTOR_H_ */
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//===-- include/FortranRuntime/Runtime/descriptor.h -------------*- C++ -*-===//
//===-- include/flang-rt/flang_rt/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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_DESCRIPTOR_H_
#define FORTRAN_RUNTIME_DESCRIPTOR_H_
#ifndef FORTRAN_FLANG_RT_DESCRIPTOR_H_
#define FORTRAN_FLANG_RT_DESCRIPTOR_H_

// Defines data structures used during execution of a Fortran program
// to implement nontrivial dummy arguments, pointers, allocatables,
Expand All @@ -18,8 +18,8 @@
// User C code is welcome to depend on that ISO_Fortran_binding.h file,
// but should never reference this internal header.

#include "FortranRuntime/Runtime/memory.h"
#include "FortranRuntime/Runtime/type-code.h"
#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
#include "flang/Runtime/descriptor-consts.h"
#include <algorithm>
Expand Down Expand Up @@ -482,4 +482,4 @@ class alignas(Descriptor) StaticDescriptor {
};

} // namespace Fortran::runtime
#endif /* FORTRAN_RUNTIME_DESCRIPTOR_H_ */
#endif /* FORTRAN_FLANG_RT_DESCRIPTOR_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- include/FortranRuntime/Runtime/io-api-funcs.h -----------*- C++ -*-===//
//===-- include/flang-rt/flang_rt/io-api-funcs.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,8 +8,8 @@

// Defines API between compiled code and I/O runtime library.

#ifndef FORTRAN_RUNTIME_IO_API_FUNCS_H_
#define FORTRAN_RUNTIME_IO_API_FUNCS_H_
#ifndef FORTRAN_FLANG_RT_IO_API_FUNCS_H_
#define FORTRAN_FLANG_RT_IO_API_FUNCS_H_

#include "flang/Common/uint128.h"
#include "flang/Runtime/entry-names.h"
Expand All @@ -36,4 +36,4 @@ RT_API_ATTRS const char *InquiryKeywordHashDecode(
char *buffer, std::size_t, InquiryKeywordHash);

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_IO_API_FUNCS_H_ */
#endif /* FORTRAN_FLANG_RT_IO_API_FUNCS_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- include/FortranRuntime/Runtime/iostat-funcs.h -----------*- C++ -*-===//
//===-- include/flang-rt/flang_rt/iostat-funcs.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 @@
// Defines the values returned by the runtime for IOSTAT= specifiers
// on I/O statements.

#ifndef FORTRAN_RUNTIME_IOSTAT_FUNCS_H_
#define FORTRAN_RUNTIME_IOSTAT_FUNCS_H_
#ifndef FORTRAN_FLANG_RT_IOSTAT_FUNCS_H_
#define FORTRAN_FLANG_RT_IOSTAT_FUNCS_H_

#include "flang/Common/api-attrs.h"
#include "flang/Runtime/iostat.h"
Expand All @@ -20,4 +20,4 @@ namespace Fortran::runtime::io {
RT_API_ATTRS const char *IostatErrorString(int);

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_IOSTAT_FUNCS_H_ */
#endif /* FORTRAN_FLANG_RT_IOSTAT_FUNCS_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- include/FortranRuntime/Runtime/memory.h -----------------*- C++ -*-===//
//===-- include/flang-rt/flang_rt/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 All @@ -9,8 +9,8 @@
// Thin wrapper around malloc()/free() to isolate the dependency,
// ease porting, and provide an owning pointer.

#ifndef FORTRAN_RUNTIME_MEMORY_H_
#define FORTRAN_RUNTIME_MEMORY_H_
#ifndef FORTRAN_FLANG_RT_MEMORY_H_
#define FORTRAN_FLANG_RT_MEMORY_H_

#include "flang/Common/api-attrs.h"
#include <cassert>
Expand Down Expand Up @@ -170,4 +170,4 @@ template <typename A> struct Allocator {
};
} // namespace Fortran::runtime

#endif /* FORTRAN_RUNTIME_MEMORY_H_ */
#endif /* FORTRAN_FLANG_RT_MEMORY_H_ */
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//===-- include/FortranRuntime/Runtime/type-code.h --------------*- C++ -*-===//
//===-- include/flang-rt/flang_rt/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.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_TYPE_CODE_H_
#define FORTRAN_RUNTIME_TYPE_CODE_H_
#ifndef FORTRAN_FLANG_RT_TYPE_CODE_H_
#define FORTRAN_FLANG_RT_TYPE_CODE_H_

#include "flang/Common/Fortran-consts.h"
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
Expand Down Expand Up @@ -75,4 +75,4 @@ class TypeCode {
ISO::CFI_type_t raw_{CFI_type_other};
};
} // namespace Fortran::runtime
#endif /* FORTRAN_RUNTIME_TYPE_CODE_H_ */
#endif /* FORTRAN_FLANG_RT_TYPE_CODE_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
#
#===------------------------------------------------------------------------===#

add_subdirectory(Runtime)
if (FORTRANRUNTIME_INCLUDE_TESTS)
add_subdirectory(FortranFloat128Math)
add_subdirectory(flang_rt)
if (FLANG_RT_ENABLE_CUF)
add_subdirectory(CufRuntime)
endif()

if (FLANG_RT_INCLUDE_TESTS)
add_subdirectory(Testing)
endif ()

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#===-- lib/Runtime/CUDA/CMakeLists.txt -------------------------------------===#
#===-- lib/CufRuntime/CMakeLists.txt ---------------------------------------===#
#
# 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 @@
# added to the library name.
set(CUFRT_LIBNAME CufRuntime_cuda_${CUDAToolkit_VERSION_MAJOR})

add_fortranruntime_library(${CUFRT_LIBNAME}
add_flangrt_library(${CUFRT_LIBNAME}
allocator.cpp
descriptor.cpp
)
Expand All @@ -25,6 +25,6 @@ endif()

target_link_libraries(${CUFRT_LIBNAME}
PRIVATE
FortranRuntime
flang_rt
${CUDA_RT_TARGET}
)
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//===-- lib/Runtime/CUDA/allocator.cpp --------------------------*- C++ -*-===//
//===-- lib/CufRuntime/allocator.cpp ----------------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "FortranRuntime/Runtime/CUDA/allocator.h"
#include "FortranRuntime/Runtime/allocator-registry.h"
#include "../derived.h"
#include "../stat.h"
#include "../terminator.h"
#include "../type-info.h"
#include "flang/ISO_Fortran_binding_wrapper.h"
#include "flang/Support/Fortran.h"
#include "flang-rt/CufRuntime/allocator.h"
#include "flang-rt/flang_rt/allocator-registry.h"
#include "../flang_rt/derived.h"
#include "../flang_rt/stat.h"
#include "../flang_rt/terminator.h"
#include "../flang_rt/type-info.h"
#include "flang/Common/Fortran-consts.h"
#include "flang/Common/ISO_Fortran_binding_wrapper.h"

#include "cuda_runtime.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//===-- lib/Runtime/CUDA/descriptor.cpp -------------------------*- C++ -*-===//
//===-- lib/CufRuntime/descriptor.cpp ---------------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "FortranRuntime/Runtime/CUDA/descriptor.h"
#include "FortranRuntime/Runtime/CUDA/allocator.h"
#include "flang/Runtime/CUDA/descriptor.h"
#include "flang-rt/CufRuntime/allocator.h"

namespace Fortran::runtime::cuda {
extern "C" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#===-- runtime/Float128Math/CMakeLists.txt ---------------------------------===#
#===-- lib/FortranFloat128Math/CMakeLists.txt ------------------------------===#
#
# 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 Expand Up @@ -91,12 +91,11 @@ if (FLANG_RUNTIME_F128_MATH_LIB)

if (WIN32)
# Do not create a FortranFloat128Math library under Windows, the Flang
# driver never links it. Instead, add the sources to the main
# FortranRuntime.lib.
# driver never links it. Instead, add the sources to the flang_rt itself.
target_sources(FortranFloat128MathILib INTERFACE ${sources})
target_compile_definitions(FortranFloat128MathILib INTERFACE HAS_QUADMATHLIB)
else ()
add_fortranruntime_library(FortranFloat128Math STATIC INSTALL_WITH_TOOLCHAIN
add_flangrt_library(FortranFloat128Math STATIC INSTALL_WITH_TOOLCHAIN
${sources})
endif ()
elseif (HAVE_LDBL_MANT_DIG_113)
Expand All @@ -108,7 +107,7 @@ elseif (HAVE_LDBL_MANT_DIG_113)
)
target_sources(FortranFloat128MathILib INTERFACE ${sources})
else()
message(FATAL_ERROR "FortranRuntime cannot build without libm")
message(FATAL_ERROR "flang-rt cannot build without libm")
endif()
else()
# We can use '__float128' version from libc, if it has them.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/Float128Math/acos.cpp -----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/acos.cpp ------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/acosh.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/acosh.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/asin.cpp -----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/asin.cpp ------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/asinh.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/asinh.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/atan.cpp -----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/atan.cpp ------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/atan2.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/atan2.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/atanh.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/atanh.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/ceil.cpp -----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/ceil.cpp ------------------------*- 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 @@
/*===-- lib/Runtime/Float128Math/complex-math.c ---------------------*- C -*-===
/*===-- lib/FortranFloat128Math/complex-math.c ----------------------*- 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,13 +1,13 @@
/*===-- lib/Runtime/Float128Math/complex-math.h ---------------------*- C -*-===
/*===-- lib/FortranFloat128Math/complex-math.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
*
*===----------------------------------------------------------------------===*/

#ifndef FORTRAN_RUNTIME_FLOAT128MATH_COMPLEX_MATH_H_
#define FORTRAN_RUNTIME_FLOAT128MATH_COMPLEX_MATH_H_
#ifndef FORTRAN_FORTRANFLOAT128MATH_COMPLEX_MATH_H_
#define FORTRAN_FORTRANFLOAT128MATH_COMPLEX_MATH_H_

#include "flang/Common/float128.h"
#include "flang/Runtime/entry-names.h"
Expand Down Expand Up @@ -59,4 +59,4 @@
#error "Float128Math build with glibc>=2.26 is unsupported yet"
#endif

#endif /* FORTRAN_RUNTIME_FLOAT128MATH_COMPLEX_MATH_H_ */
#endif /* FORTRAN_FORTRANFLOAT128MATH_COMPLEX_MATH_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/Float128Math/cos.cpp ------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/cos.cpp -------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/cosh.cpp -----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/cosh.cpp ------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/erf.cpp ------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/erf.cpp -------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/erfc.cpp -----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/erfc.cpp ------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/exp.cpp ------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/exp.cpp -------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/exponent.cpp -------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/exponent.cpp --------------------*- 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 @@
//===-- lib/Runtime/Float128Math/floor.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/floor.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/fma.cpp ------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/fma.cpp -------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/fraction.cpp -------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/fraction.cpp --------------------*- 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 @@
//===-- lib/Runtime/Float128Math/hypot.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/hypot.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/j0.cpp -------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/j0.cpp --------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/j1.cpp -------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/j1.cpp --------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/jn.cpp -------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/jn.cpp --------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/lgamma.cpp ---------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/lgamma.cpp ----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/llround.cpp --------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/llround.cpp ---------------------*- 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 @@
//===-- lib/Runtime/Float128Math/log.cpp ------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/log.cpp -------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/log10.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/log10.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/lround.cpp ---------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/lround.cpp ----------------------*- 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,13 +1,13 @@
//===-- lib/Runtime/Float128Math/math-entries.h -----------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/math-entries.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_FLOAT128MATH_MATH_ENTRIES_H_
#define FORTRAN_RUNTIME_FLOAT128MATH_MATH_ENTRIES_H_
#ifndef FORTRAN_FORTRANFLOAT128MATH_MATH_ENTRIES_H_
#define FORTRAN_FORTRANFLOAT128MATH_MATH_ENTRIES_H_
#include "terminator.h"
#include "tools.h"
#include "flang/Common/float128.h"
Expand Down Expand Up @@ -222,4 +222,4 @@ DEFINE_SIMPLE_ALIAS(Yn, ynl)

} // namespace Fortran::runtime

#endif /* FORTRAN_RUNTIME_FLOAT128MATH_MATH_ENTRIES_H_ */
#endif /* FORTRAN_FORTRANFLOAT128MATH_MATH_ENTRIES_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/Float128Math/mod-real.cpp -------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/mod-real.cpp --------------------*- 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 @@
//===-- lib/Runtime/Float128Math/modulo-real.cpp ----------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/modulo-real.cpp -----------------*- 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 @@
//===-- lib/Runtime/Float128Math/nearest.cpp --------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/nearest.cpp ---------------------*- 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 @@
//===-- lib/Runtime/Float128Math/norm2.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/norm2.cpp -----------------------*- 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,13 +1,13 @@
//===-- lib/Runtime/Float128Math/numeric-template-specs.h -------*- C++ -*-===//
//===-- lib/FortranFloat128Math/numeric-template-specs.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_FLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_
#define FORTRAN_RUNTIME_FLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_
#ifndef FORTRAN_FORTRANFLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_
#define FORTRAN_FORTRANFLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_

#include "math-entries.h"
#include "numeric-templates.h"
Expand Down Expand Up @@ -52,4 +52,4 @@ template <> struct SQRTTy<F128Type> {
};

} // namespace Fortran::runtime
#endif /* FORTRAN_RUNTIME_FLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_ */
#endif /* FORTRAN_FORTRANFLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/Float128Math/pow.cpp ------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/pow.cpp -------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/random.cpp ---------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/random.cpp ----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/round.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/round.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/rrspacing.cpp ------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/rrspacing.cpp -------------------*- 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 @@
//===-- lib/Runtime/Float128Math/scale.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/scale.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/set-exponent.cpp ---------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/set-exponent.cpp ----------------*- 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 @@
//===-- lib/Runtime/Float128Math/sin.cpp ------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/sin.cpp -------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/sinh.cpp -----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/sinh.cpp ------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/spacing.cpp --------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/spacing.cpp ---------------------*- 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 @@
//===-- lib/Runtime/Float128Math/sqrt.cpp -----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/sqrt.cpp ------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/tan.cpp ------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/tan.cpp -------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/tanh.cpp -----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/tanh.cpp ------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/tgamma.cpp ---------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/tgamma.cpp ----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/trunc.cpp ----------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/trunc.cpp -----------------------*- 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 @@
//===-- lib/Runtime/Float128Math/y0.cpp -------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/y0.cpp --------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/y1.cpp -------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/y1.cpp --------------------------*- 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 @@
//===-- lib/Runtime/Float128Math/yn.cpp -------------------------*- C++ -*-===//
//===-- lib/FortranFloat128Math/yn.cpp --------------------------*- 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
Expand Up @@ -11,7 +11,7 @@ file(GLOB_RECURSE public_headers
"${FLANG_SOURCE_DIR}/lib/Testing/*.h"
)

add_fortranruntime_library(NonGTestTesting EXCLUDE_FROM_ALL LINK_TO_LLVM
add_flangrt_library(NonGTestTesting EXCLUDE_FROM_ALL LINK_TO_LLVM
${FLANG_SOURCE_DIR}/lib/Testing/testing.cpp
${FLANG_SOURCE_DIR}/lib/Testing/fp-testing.cpp
ADDITIONAL_HEADERS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#===-- lib/Runtime/CMakeLists.txt ------------------------------------------===#
#===-- lib/flang_rt/CMakeLists.txt -----------------------------------------===#
#
# 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(AddFortranOffloadRuntime)
include(AddFlangRTOffload)

# List of files that are buildable for all devices.
set(supported_sources
Expand Down Expand Up @@ -73,7 +73,7 @@ set(host_sources
exceptions.cpp
execute.cpp
extensions.cpp
iso_fortran_env_impl.f90
${FLANG_SOURCE_DIR}/module/iso_fortran_env_impl.f90
main.cpp
random.cpp
reduce.cpp
Expand All @@ -84,18 +84,17 @@ set(host_sources
)

file(GLOB_RECURSE public_headers
"${FLANGRUNTIME_SOURCE_DIR}/include/flang/Runtime/*.h"
"${FLANGRUNTIME_SOURCE_DIR}/include/flang/Common/*.h"
"${FLANGRT_SOURCE_DIR}/include/flang/Runtime/*.h"
"${FLANGRT_SOURCE_DIR}/include/flang/Common/*.h"
)

file(GLOB_RECURSE private_headers
"${FLANGRUNTIME_SOURCE_DIR}/lib/Runtime/*.h"
"${FLANGRUNTIME_SOURCE_DIR}/lib/Common/*.h"
"${FLANGRT_SOURCE_DIR}/lib/Runtime/*.h"
"${FLANGRT_SOURCE_DIR}/lib/Common/*.h"
)


add_subdirectory(Float128Math)

# Import changes from sibling FortranFloat128Math
get_target_property(f128_sources
FortranFloat128MathILib INTERFACE_SOURCES
)
Expand All @@ -117,23 +116,23 @@ endif ()
set(sources ${supported_sources} ${host_sources} ${f128_sources})

if (NOT WIN32)
add_fortranruntime_library(FortranRuntime STATIC
add_flangrt_library(flang_rt STATIC
${sources}
INSTALL_WITH_TOOLCHAIN
ADDITIONAL_HEADERS ${public_headers} ${private_headers}
)

enable_cuda_compilation(FortranRuntime "${supported_sources}")
enable_cuda_compilation(flang_rt "${supported_sources}")
enable_omp_offload_compilation("${supported_sources}")

# For unittests that link to FortranRuntime. Should link to the static version
# For unittests that depend on flang_rt. Should link to the static version
# of the library.
add_library(FortranRuntime.static ALIAS FortranRuntime)
add_library(FortranRuntime.unittest ALIAS FortranRuntime)
add_library(flang_rt.static ALIAS flang_rt)
add_library(flang_rt.unittest ALIAS flang_rt)
else()
function (add_win_fortranruntime_library libtype suffix msvc_lib)
set(name "FortranRuntime.${suffix}")
add_fortranruntime_library(${name} ${libtype}
function (add_win_flangrt_library libtype suffix msvc_lib)
set(name "flang_rt.${suffix}")
add_flangrt_library(${name} ${libtype}
${sources}
${ARGN}
INSTALL_WITH_TOOLCHAIN
Expand All @@ -148,32 +147,28 @@ else()
Fortran_MODULE_DIRECTORY "module.${suffix}"
)

enable_cuda_compilation(FortranRuntime "${supported_sources}")
enable_cuda_compilation(${name} "${supported_sources}")
enable_omp_offload_compilation("${supported_sources}")
endfunction ()

add_win_fortranruntime_library(STATIC static MultiThreaded)
add_win_fortranruntime_library(STATIC static_dbg MultiThreadedDebug)
add_win_flangrt_library(STATIC static MultiThreaded)
add_win_flangrt_library(STATIC static_dbg MultiThreadedDebug)

# unittests link against LLVMSupport which is compiled with /MD
add_win_fortranruntime_library(STATIC unittest MultiThreadedDLL EXCLUDE_FROM_ALL)
add_win_flangrt_library(STATIC unittest MultiThreadedDLL EXCLUDE_FROM_ALL)

# FIXME: Before DLL versions of the runtime can be used, exported definitions
# must be annotated with __declspec(dllexport).
add_win_fortranruntime_library(SHARED dynamic MultiThreadedDLL)
add_win_fortranruntime_library(SHARED dynamic_dbg MultiThreadedDebugDLL)
add_win_flangrt_library(SHARED dynamic MultiThreadedDLL)
add_win_flangrt_library(SHARED dynamic_dbg MultiThreadedDebugDLL)

# Target for building all versions of the runtime
add_custom_target(FortranRuntime)
set_target_properties(FortranRuntime PROPERTIES FOLDER "Fortran Runtime/Meta")
add_dependencies(FortranRuntime
FortranRuntime.static
FortranRuntime.static_dbg
FortranRuntime.dynamic
FortranRuntime.dynamic_dbg
add_custom_target(flang_rt)
set_target_properties(flang_rt PROPERTIES FOLDER "Fortran Runtime/Meta")
add_dependencies(flang_rt
flang_rt.static
flang_rt.static_dbg
flang_rt.dynamic
flang_rt.dynamic_dbg
)
endif()

if (FORTRANRUNTIME_ENABLE_CUF)
add_subdirectory(CUDA)
endif()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/ISO_Fortran_binding.cpp ---------------------*- C++ -*-===//
//===-- lib/flang_rt/ISO_Fortran_binding.cpp --------------------*- 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,9 +9,9 @@
// Implements the required interoperability API from ISO_Fortran_binding.h
// as specified in section 18.5.5 of Fortran 2018.

#include "FortranRuntime/Runtime/descriptor.h"
#include "FortranRuntime/Runtime/type-code.h"
#include "ISO_Fortran_util.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/type-code.h"
#include "terminator.h"
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
#include "flang/Runtime/pointer.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//===-- lib/Runtime/ISO_Fortran_util.h --------------------------*- C++ -*-===//
//===-- lib/flang_rt/ISO_Fortran_util.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_ISO_FORTRAN_UTIL_H_
#define FORTRAN_RUNTIME_ISO_FORTRAN_UTIL_H_
#ifndef FORTRAN_FLANG_RT_ISO_FORTRAN_UTIL_H_
#define FORTRAN_FLANG_RT_ISO_FORTRAN_UTIL_H_

// Internal utils for establishing CFI_cdesc_t descriptors.

#include "FortranRuntime/Runtime/descriptor.h"
#include "FortranRuntime/Runtime/type-code.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/type-code.h"
#include "terminator.h"
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
#include <cstdlib>
Expand Down Expand Up @@ -99,4 +99,4 @@ static inline RT_API_ATTRS void EstablishDescriptor(CFI_cdesc_t *descriptor,
}
}
} // namespace Fortran::ISO
#endif /* FORTRAN_RUNTIME_ISO_FORTRAN_UTIL_H_ */
#endif /* FORTRAN_FLANG_RT_ISO_FORTRAN_UTIL_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/allocatable.cpp -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/allocatable.cpp ----------------------------*- 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 @@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/allocatable.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "assign-impl.h"
#include "derived.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "stat.h"
#include "terminator.h"
#include "type-info.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
//===-- lib/Runtime/allocator-registry.cpp ----------------------*- C++ -*-===//
//===-- lib/flang_rt/allocator-registry.cpp ---------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "FortranRuntime/Runtime/allocator-registry.h"
#include "flang-rt/flang_rt/allocator-registry.h"
#include "terminator.h"

namespace Fortran::runtime {

#ifndef FLANG_RUNTIME_NO_GLOBAL_VAR_DEFS
#ifndef FLANGRT_NO_GLOBAL_VAR_DEFS
RT_OFFLOAD_VAR_GROUP_BEGIN
RT_VAR_ATTRS AllocatorRegistry allocatorRegistry;
RT_OFFLOAD_VAR_GROUP_END
#endif // FLANG_RUNTIME_NO_GLOBAL_VAR_DEFS
#endif // FLANGRT_NO_GLOBAL_VAR_DEFS

RT_OFFLOAD_API_GROUP_BEGIN
RT_API_ATTRS void AllocatorRegistry::Register(int pos, Allocator_t allocator) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//===-- lib/Runtime/array-constructor.cpp -----------------------*- C++ -*-===//
//===-- lib/flang_rt/array-constructor.cpp ----------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "FortranRuntime/Runtime/array-constructor.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/array-constructor.h"
#include "derived.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "type-info.h"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/assign.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/assign.cpp ---------------------------------*- 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 @@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/assign.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "assign-impl.h"
#include "derived.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "stat.h"
#include "terminator.h"
#include "tools.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/buffer.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/buffer.cpp ---------------------------------*- 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 @@
//===-- lib/Runtime/buffer.h ------------------------------------*- C++ -*-===//
//===-- lib/flang_rt/buffer.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,10 +8,10 @@

// External file buffering

#ifndef FORTRAN_RUNTIME_BUFFER_H_
#define FORTRAN_RUNTIME_BUFFER_H_
#ifndef FORTRAN_FLANG_RT_BUFFER_H_
#define FORTRAN_FLANG_RT_BUFFER_H_

#include "FortranRuntime/Runtime/memory.h"
#include "flang-rt/flang_rt/memory.h"
#include "io-error.h"
#include "flang/Runtime/freestanding-tools.h"
#include <algorithm>
Expand Down Expand Up @@ -221,4 +221,4 @@ template <typename STORE, std::size_t minBuffer = 65536> class FileFrame {
bool dirty_{false};
};
} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_BUFFER_H_ */
#endif /* FORTRAN_FLANG_RT_BUFFER_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/character.cpp -------------------------------*- C++ -*-===//
//===-- lib/flang_rt/character.cpp ------------------------------*- 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 @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/character.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Common/bit-population-count.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/command.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/command.cpp --------------------------------*- 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 @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/command.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "environment.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "stat.h"
#include "terminator.h"
#include "tools.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/complex-powi.cpp ----------------------------*- C++ -*-===//
//===-- lib/flang_rt/complex-powi.cpp ---------------------------*- 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 @@
/*===-- lib/Runtime/complex-reduction.c -----------------------------*- C -*-===
/*===-- lib/flang_rt/complex-reduction.c ----------------------------*- 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 @@
/*===-- lib/Runtime/complex-reduction.h -----------------------------*- C -*-===
/*===-- lib/flang_rt/complex-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,8 +11,8 @@
* with C++ build compilers that don't support C's _Complex.
*/

#ifndef FORTRAN_RUNTIME_COMPLEX_REDUCTION_H_
#define FORTRAN_RUNTIME_COMPLEX_REDUCTION_H_
#ifndef FORTRAN_FLANG_RT_COMPLEX_REDUCTION_H_
#define FORTRAN_FLANG_RT_COMPLEX_REDUCTION_H_

#include "flang/Common/float128.h"
#include "flang/Runtime/entry-names.h"
Expand Down Expand Up @@ -155,4 +155,4 @@ void RTNAME(ReduceComplex16DimValue)(
REDUCE_DIM_ARGS(CFloat128ComplexType, CFloat128ComplexType_value_op));
#endif

#endif /* FORTRAN_RUNTIME_COMPLEX_REDUCTION_H_ */
#endif /* FORTRAN_FLANG_RT_COMPLEX_REDUCTION_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/connection.cpp ------------------------------*- C++ -*-===//
//===-- lib/flang_rt/connection.cpp -----------------------------*- 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 @@
//===-- lib/Runtime/connection.h --------------------------------*- C++ -*-===//
//===-- lib/flang_rt/connection.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,8 +8,8 @@

// Fortran I/O connection state (abstracted over internal & external units)

#ifndef FORTRAN_RUNTIME_CONNECTION_H_
#define FORTRAN_RUNTIME_CONNECTION_H_
#ifndef FORTRAN_FLANG_RT_CONNECTION_H_
#define FORTRAN_FLANG_RT_CONNECTION_H_

#include "format.h"
#include "flang/Common/optional.h"
Expand Down Expand Up @@ -124,4 +124,4 @@ class SavedPosition {
};

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_CONNECTION_H_ */
#endif /* FORTRAN_FLANG_RT_CONNECTION_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/copy.cpp ------------------------------------*- C++ -*-===//
//===-- lib/flang_rt/copy.cpp -----------------------------------*- 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 @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "copy.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "stack.h"
#include "terminator.h"
#include "type-info.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/copy.h --------------------------------------*- C++ -*-===//
//===-- lib/flang_rt/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.
Expand All @@ -9,10 +9,10 @@
// Utilities that copy data in a type-aware fashion, allocating & duplicating
// allocatable/automatic components of derived types along the way.

#ifndef FORTRAN_RUNTIME_COPY_H_
#define FORTRAN_RUNTIME_COPY_H_
#ifndef FORTRAN_FLANG_RT_COPY_H_
#define FORTRAN_FLANG_RT_COPY_H_

#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"

namespace Fortran::runtime {

Expand All @@ -22,4 +22,4 @@ RT_API_ATTRS void CopyElement(const Descriptor &to, const SubscriptValue toAt[],
const Descriptor &from, const SubscriptValue fromAt[], Terminator &);

} // namespace Fortran::runtime
#endif /* FORTRAN_RUNTIME_COPY_H_ */
#endif /* FORTRAN_FLANG_RT_COPY_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/derived-api.cpp -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/derived-api.cpp ----------------------------*- 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 @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/derived-api.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "derived.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "type-info.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/derived.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/derived.cpp --------------------------------*- 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 @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "derived.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "stat.h"
#include "terminator.h"
#include "tools.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/derived.h -----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/derived.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,8 +8,8 @@

// Internal runtime utilities for derived type operations.

#ifndef FORTRAN_RUNTIME_DERIVED_H_
#define FORTRAN_RUNTIME_DERIVED_H_
#ifndef FORTRAN_FLANG_RT_DERIVED_H_
#define FORTRAN_FLANG_RT_DERIVED_H_

#include "flang/Common/api-attrs.h"

Expand Down Expand Up @@ -40,4 +40,4 @@ RT_API_ATTRS void Destroy(const Descriptor &, bool finalize,
RT_API_ATTRS bool HasDynamicComponent(const Descriptor &);

} // namespace Fortran::runtime
#endif /* FORTRAN_RUNTIME_DERIVED_H_ */
#endif /* FORTRAN_FLANG_RT_DERIVED_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/descriptor-io.cpp ---------------------------*- C++ -*-===//
//===-- lib/flang_rt/descriptor-io.cpp --------------------------*- 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,22 +1,22 @@
//===-- lib/Runtime/descriptor-io.h -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/descriptor-io.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_DESCRIPTOR_IO_H_
#define FORTRAN_RUNTIME_DESCRIPTOR_IO_H_
#ifndef FORTRAN_FLANG_RT_DESCRIPTOR_IO_H_
#define FORTRAN_FLANG_RT_DESCRIPTOR_IO_H_

// Implementation of I/O data list item transfers based on descriptors.
// (All I/O items come through here so that the code is exercised for test;
// some scalar I/O data transfer APIs could be changed to bypass their use
// of descriptors in the future for better efficiency.)

#include "FortranRuntime/Runtime/descriptor.h"
#include "edit-input.h"
#include "edit-output.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "io-stmt.h"
#include "namelist.h"
#include "terminator.h"
Expand Down Expand Up @@ -608,4 +608,4 @@ static RT_API_ATTRS bool DescriptorIO(IoStatementState &io,
return false;
}
} // namespace Fortran::runtime::io::descr
#endif /* FORTRAN_RUNTIME_DESCRIPTOR_IO_H_ */
#endif /* FORTRAN_FLANG_RT_DESCRIPTOR_IO_H_ */
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//===-- lib/Runtime/descriptor.cpp ------------------------------*- C++ -*-===//
//===-- lib/flang_rt/descriptor.cpp -----------------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "FortranRuntime/Runtime/descriptor.h"
#include "FortranRuntime/Runtime/allocator-registry.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "ISO_Fortran_util.h"
#include "derived.h"
#include "flang-rt/flang_rt/allocator-registry.h"
#include "memory.h"
#include "stat.h"
#include "terminator.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//===-- lib/Runtime/dot-product.cpp -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/dot-product.cpp ----------------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "float.h"
#include "terminator.h"
#include "tools.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/edit-input.cpp ------------------------------*- C++ -*-===//
//===-- lib/flang_rt/edit-input.cpp -----------------------------*- 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,13 +1,13 @@
//===-- lib/Runtime/edit-input.h --------------------------------*- C++ -*-===//
//===-- lib/flang_rt/edit-input.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_EDIT_INPUT_H_
#define FORTRAN_RUNTIME_EDIT_INPUT_H_
#ifndef FORTRAN_FLANG_RT_EDIT_INPUT_H_
#define FORTRAN_FLANG_RT_EDIT_INPUT_H_

#include "format.h"
#include "io-stmt.h"
Expand Down Expand Up @@ -50,4 +50,4 @@ extern template RT_API_ATTRS bool EditCharacterInput(
IoStatementState &, const DataEdit &, char32_t *, std::size_t);

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_EDIT_INPUT_H_ */
#endif /* FORTRAN_FLANG_RT_EDIT_INPUT_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/edit-output.cpp -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/edit-output.cpp ----------------------------*- 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,13 +1,13 @@
//===-- lib/Runtime/edit-output.h -------------------------------*- C++ -*-===//
//===-- lib/flang_rt/edit-output.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_EDIT_OUTPUT_H_
#define FORTRAN_RUNTIME_EDIT_OUTPUT_H_
#ifndef FORTRAN_FLANG_RT_EDIT_OUTPUT_H_
#define FORTRAN_FLANG_RT_EDIT_OUTPUT_H_

// Output data editing templates implementing the FORMAT data editing
// descriptors E, EN, ES, EX, D, F, and G for REAL data (and COMPLEX
Expand Down Expand Up @@ -138,4 +138,4 @@ extern template class RealOutputEditing<10>;
extern template class RealOutputEditing<16>;

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_EDIT_OUTPUT_H_ */
#endif /* FORTRAN_FLANG_RT_EDIT_OUTPUT_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/emit-encoded.h ------------------------------*- C++ -*-===//
//===-- lib/flang_rt/emit-encoded.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,8 +8,8 @@

// Templates for emitting CHARACTER values with conversion

#ifndef FORTRAN_RUNTIME_EMIT_ENCODED_H_
#define FORTRAN_RUNTIME_EMIT_ENCODED_H_
#ifndef FORTRAN_FLANG_RT_EMIT_ENCODED_H_
#define FORTRAN_FLANG_RT_EMIT_ENCODED_H_

#include "connection.h"
#include "environment.h"
Expand Down Expand Up @@ -114,4 +114,4 @@ RT_API_ATTRS bool EmitRepeated(CONTEXT &to, char ch, std::size_t n) {
}

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_EMIT_ENCODED_H_ */
#endif /* FORTRAN_FLANG_RT_EMIT_ENCODED_H_ */
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/environment.cpp -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/environment.cpp ----------------------------*- 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 @@ -23,11 +23,11 @@ extern char **environ;

namespace Fortran::runtime {

#ifndef FLANG_RUNTIME_NO_GLOBAL_VAR_DEFS
#ifndef FLANGRT_NO_GLOBAL_VAR_DEFS
RT_OFFLOAD_VAR_GROUP_BEGIN
RT_VAR_ATTRS ExecutionEnvironment executionEnvironment;
RT_OFFLOAD_VAR_GROUP_END
#endif // FLANG_RUNTIME_NO_GLOBAL_VAR_DEFS
#endif // FLANGRT_NO_GLOBAL_VAR_DEFS

static void SetEnvironmentDefaults(const EnvironmentDefaultList *envDefaults) {
if (!envDefaults) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//===-- lib/Runtime/environment.h -------------------------------*- C++ -*-===//
//===-- lib/flang_rt/environment.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_ENVIRONMENT_H_
#define FORTRAN_RUNTIME_ENVIRONMENT_H_
#ifndef FORTRAN_FLANG_RT_ENVIRONMENT_H_
#define FORTRAN_FLANG_RT_ENVIRONMENT_H_

#include "flang/Common/decimal.h"
#include "flang/Common/optional.h"
Expand Down Expand Up @@ -64,4 +64,4 @@ RT_OFFLOAD_VAR_GROUP_END

} // namespace Fortran::runtime

#endif /* FORTRAN_RUNTIME_ENVIRONMENT_H_ */
#endif /* FORTRAN_FLANG_RT_ENVIRONMENT_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/exceptions.cpp ------------------------------*- C++ -*-===//
//===-- lib/flang_rt/exceptions.cpp -----------------------------*- 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 @@
//===-- lib/Runtime/execute.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/execute.cpp --------------------------------*- 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 @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/execute.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "environment.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "stat.h"
#include "terminator.h"
#include "tools.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/extensions.cpp ------------------------------*- C++ -*-===//
//===-- lib/flang_rt/extensions.cpp -----------------------------*- 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,8 +10,8 @@
// extensions that will eventually be implemented in Fortran.

#include "flang/Runtime/extensions.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "FortranRuntime/Runtime/io-api-funcs.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Runtime/command.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/external-unit.cpp ---------------------------*- C++ -*-===//
//===-- lib/flang_rt/external-unit.cpp --------------------------*- 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 @@
//===-- lib/Runtime/extrema.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/extrema.cpp --------------------------------*- 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 @@
//===-- lib/Runtime/file.cpp ------------------------------------*- C++ -*-===//
//===-- lib/flang_rt/file.cpp -----------------------------------*- 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 @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "file.h"
#include "FortranRuntime/Runtime/memory.h"
#include "flang-rt/flang_rt/memory.h"
#include "tools.h"
#include "flang/Runtime/magic-numbers.h"
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/file.h --------------------------------------*- C++ -*-===//
//===-- lib/flang_rt/file.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,10 +8,10 @@

// Raw system I/O wrappers

#ifndef FORTRAN_RUNTIME_FILE_H_
#define FORTRAN_RUNTIME_FILE_H_
#ifndef FORTRAN_FLANG_RT_FILE_H_
#define FORTRAN_FLANG_RT_FILE_H_

#include "FortranRuntime/Runtime/memory.h"
#include "flang-rt/flang_rt/memory.h"
#include "io-error.h"
#include "flang/Common/optional.h"
#include <cinttypes>
Expand Down Expand Up @@ -113,4 +113,4 @@ RT_API_ATTRS bool MayWrite(const char *path);
RT_API_ATTRS bool MayReadAndWrite(const char *path);
RT_API_ATTRS std::int64_t SizeInBytes(const char *path);
} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_FILE_H_ */
#endif /* FORTRAN_FLANG_RT_FILE_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/findloc.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/findloc.cpp --------------------------------*- 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 @@
//===-- lib/Runtime/format-implementation.h ---------------------*- C++ -*-===//
//===-- lib/flang_rt/format-implementation.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,8 +8,8 @@

// Implements out-of-line member functions of template class FormatControl

#ifndef FORTRAN_RUNTIME_FORMAT_IMPLEMENTATION_H_
#define FORTRAN_RUNTIME_FORMAT_IMPLEMENTATION_H_
#ifndef FORTRAN_FLANG_RT_FORMAT_IMPLEMENTATION_H_
#define FORTRAN_FLANG_RT_FORMAT_IMPLEMENTATION_H_

#include "emit-encoded.h"
#include "format.h"
Expand Down Expand Up @@ -601,4 +601,4 @@ RT_API_ATTRS void FormatControl<CONTEXT>::Finish(Context &context) {
}
}
} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_FORMAT_IMPLEMENTATION_H_ */
#endif /* FORTRAN_FLANG_RT_FORMAT_IMPLEMENTATION_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/format.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/format.cpp ---------------------------------*- 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 @@
//===-- lib/Runtime/format.h ------------------------------------*- C++ -*-===//
//===-- lib/flang_rt/format.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,8 +8,8 @@

// FORMAT string processing

#ifndef FORTRAN_RUNTIME_FORMAT_H_
#define FORTRAN_RUNTIME_FORMAT_H_
#ifndef FORTRAN_FLANG_RT_FORMAT_H_
#define FORTRAN_FLANG_RT_FORMAT_H_

#include "environment.h"
#include "io-error.h"
Expand Down Expand Up @@ -201,4 +201,4 @@ template <typename CONTEXT> class FormatControl {
Iteration stack_[maxMaxHeight];
};
} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_FORMAT_H_ */
#endif /* FORTRAN_FLANG_RT_FORMAT_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/inquiry.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/inquiry.cpp --------------------------------*- 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,8 +10,8 @@
// inquire about shape information of arrays -- LBOUND and SIZE.

#include "flang/Runtime/inquiry.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "copy.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/internal-unit.cpp ---------------------------*- C++ -*-===//
//===-- lib/flang_rt/internal-unit.cpp --------------------------*- 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 @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "internal-unit.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "io-error.h"
#include "flang/Runtime/freestanding-tools.h"
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/internal-unit.h -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/internal-unit.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,11 +8,11 @@

// Fortran internal I/O "units"

#ifndef FORTRAN_RUNTIME_INTERNAL_UNIT_H_
#define FORTRAN_RUNTIME_INTERNAL_UNIT_H_
#ifndef FORTRAN_FLANG_RT_INTERNAL_UNIT_H_
#define FORTRAN_FLANG_RT_INTERNAL_UNIT_H_

#include "FortranRuntime/Runtime/descriptor.h"
#include "connection.h"
#include "flang-rt/flang_rt/descriptor.h"
#include <cinttypes>
#include <type_traits>

Expand Down Expand Up @@ -56,4 +56,4 @@ template <Direction DIR> class InternalDescriptorUnit : public ConnectionState {
extern template class InternalDescriptorUnit<Direction::Output>;
extern template class InternalDescriptorUnit<Direction::Input>;
} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_INTERNAL_UNIT_H_ */
#endif /* FORTRAN_FLANG_RT_INTERNAL_UNIT_H_ */
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//===-- lib/Runtime/io-api-common.h -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/io-api-common.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_IO_API_COMMON_H_
#define FORTRAN_RUNTIME_IO_API_COMMON_H_
#ifndef FORTRAN_FLANG_RT_IO_API_COMMON_H_
#define FORTRAN_FLANG_RT_IO_API_COMMON_H_

#include "FortranRuntime/Runtime/io-api-funcs.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "io-stmt.h"
#include "terminator.h"
#include "unit.h"
Expand Down Expand Up @@ -94,4 +94,4 @@ RT_API_ATTRS Cookie BeginExternalListIO(
}

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_IO_API_COMMON_H_ */
#endif /* FORTRAN_FLANG_RT_IO_API_COMMON_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/io-api-minimal.cpp --------------------------*- C++ -*-===//
//===-- lib/flang_rt/io-api-minimal.cpp -------------------------*- 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 @@
// Implements the subset of the I/O statement API needed for basic
// list-directed output (PRINT *) of intrinsic types.

#include "FortranRuntime/Runtime/io-api-funcs.h"
#include "edit-output.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "format.h"
#include "io-api-common.h"
#include "io-stmt.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/io-api.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/io-api.cpp ---------------------------------*- 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 @@ -13,13 +13,13 @@
// OutputReal{32,64}, OutputComplex{32,64}, OutputAscii, & EndIoStatement()
// are in runtime/io-api-minimal.cpp.

#include "FortranRuntime/Runtime/descriptor.h"
#include "FortranRuntime/Runtime/io-api-funcs.h"
#include "FortranRuntime/Runtime/memory.h"
#include "descriptor-io.h"
#include "edit-input.h"
#include "edit-output.h"
#include "environment.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "flang-rt/flang_rt/memory.h"
#include "format.h"
#include "io-api-common.h"
#include "io-stmt.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/io-error.cpp --------------------------------*- C++ -*-===//
//===-- lib/flang_rt/io-error.cpp -------------------------------*- 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 @@
//===-- lib/Runtime/io-error.h ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/io-error.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,11 +12,11 @@
// IOSTAT error codes are raw errno values augmented with values for
// Fortran-specific errors.

#ifndef FORTRAN_RUNTIME_IO_ERROR_H_
#define FORTRAN_RUNTIME_IO_ERROR_H_
#ifndef FORTRAN_FLANG_RT_IO_ERROR_H_
#define FORTRAN_FLANG_RT_IO_ERROR_H_

#include "FortranRuntime/Runtime/iostat-funcs.h"
#include "FortranRuntime/Runtime/memory.h"
#include "flang-rt/flang_rt/iostat-funcs.h"
#include "flang-rt/flang_rt/memory.h"
#include "terminator.h"
#include <cinttypes>

Expand Down Expand Up @@ -78,4 +78,4 @@ class IoErrorHandler : public Terminator {
};

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_IO_ERROR_H_ */
#endif /* FORTRAN_FLANG_RT_IO_ERROR_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/io-stmt.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/io-stmt.cpp --------------------------------*- 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 @@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//

#include "io-stmt.h"
#include "FortranRuntime/Runtime/memory.h"
#include "connection.h"
#include "emit-encoded.h"
#include "flang-rt/flang_rt/memory.h"
#include "format.h"
#include "tools.h"
#include "unit.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/io-stmt.h -----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/io-stmt.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,13 +8,13 @@

// Representations of the state of an I/O statement in progress

#ifndef FORTRAN_RUNTIME_IO_STMT_H_
#define FORTRAN_RUNTIME_IO_STMT_H_
#ifndef FORTRAN_FLANG_RT_IO_STMT_H_
#define FORTRAN_FLANG_RT_IO_STMT_H_

#include "FortranRuntime/Runtime/descriptor.h"
#include "FortranRuntime/Runtime/io-api-funcs.h"
#include "connection.h"
#include "file.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "format.h"
#include "internal-unit.h"
#include "io-error.h"
Expand Down Expand Up @@ -789,4 +789,4 @@ class ErroneousIoStatementState : public IoStatementBase {
};

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_IO_STMT_H_ */
#endif /* FORTRAN_FLANG_RT_IO_STMT_H_ */
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//===-- lib/Runtime/iostat.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/iostat.cpp ---------------------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "FortranRuntime/Runtime/iostat-funcs.h"
#include "flang-rt/flang_rt/iostat-funcs.h"

namespace Fortran::runtime::io {
RT_OFFLOAD_API_GROUP_BEGIN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/lock.h --------------------------------------*- C++ -*-===//
//===-- lib/flang_rt/lock.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,8 +8,8 @@

// Wraps a mutex

#ifndef FORTRAN_RUNTIME_LOCK_H_
#define FORTRAN_RUNTIME_LOCK_H_
#ifndef FORTRAN_FLANG_RT_LOCK_H_
#define FORTRAN_FLANG_RT_LOCK_H_

#include "terminator.h"
#include "tools.h"
Expand Down Expand Up @@ -113,4 +113,4 @@ class CriticalSection {
};
} // namespace Fortran::runtime

#endif /* FORTRAN_RUNTIME_LOCK_H_ */
#endif /* FORTRAN_FLANG_RT_LOCK_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/main.cpp ------------------------------------*- C++ -*-===//
//===-- lib/flang_rt/main.cpp -----------------------------------*- 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 @@
//===-- lib/Runtime/matmul-transpose.cpp ------------------------*- C++ -*-===//
//===-- lib/flang_rt/matmul-transpose.cpp -----------------------*- 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 @@ -21,7 +21,7 @@
// to use the faster BLAS routines.

#include "flang/Runtime/matmul-transpose.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Common/optional.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/matmul.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/matmul.cpp ---------------------------------*- 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,7 +20,7 @@
// Places where BLAS routines could be called are marked as TODO items.

#include "flang/Runtime/matmul.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Common/optional.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//===-- lib/Runtime/memory.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/memory.cpp ---------------------------------*- 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
//
//===----------------------------------------------------------------------===//

#include "FortranRuntime/Runtime/memory.h"
#include "flang-rt/flang_rt/memory.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Runtime/freestanding-tools.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/misc-intrinsic.cpp --------------------------*- C++ -*-===//
//===-- lib/flang_rt/misc-intrinsic.cpp -------------------------*- 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 @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/misc-intrinsic.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Common/optional.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/namelist.cpp --------------------------------*- C++ -*-===//
//===-- lib/flang_rt/namelist.cpp -------------------------------*- 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 @@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//

#include "namelist.h"
#include "FortranRuntime/Runtime/io-api-funcs.h"
#include "descriptor-io.h"
#include "emit-encoded.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "io-stmt.h"
#include <algorithm>
#include <cstring>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/namelist.h ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/namelist.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,8 +8,8 @@

// Defines the data structure used for NAMELIST I/O

#ifndef FORTRAN_RUNTIME_NAMELIST_H_
#define FORTRAN_RUNTIME_NAMELIST_H_
#ifndef FORTRAN_FLANG_RT_NAMELIST_H_
#define FORTRAN_FLANG_RT_NAMELIST_H_

#include "non-tbp-dio.h"
#include "flang/Common/api-attrs.h"
Expand Down Expand Up @@ -51,4 +51,4 @@ class NamelistGroup {
RT_API_ATTRS bool IsNamelistNameOrSlash(IoStatementState &);

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_NAMELIST_H_ */
#endif /* FORTRAN_FLANG_RT_NAMELIST_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/non-tbp-dio.cpp -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/non-tbp-dio.cpp ----------------------------*- 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 @@
//===-- lib/Runtime/non-tbp-dio.h -------------------------------*- C++ -*-===//
//===-- lib/flang_rt/non-tbp-dio.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 @@ -19,8 +19,8 @@
// a containing scope has become inaccessible in a nested scope due
// to the use of "IMPORT, NONE" or "IMPORT, ONLY:".

#ifndef FORTRAN_RUNTIME_NON_TBP_DIO_H_
#define FORTRAN_RUNTIME_NON_TBP_DIO_H_
#ifndef FORTRAN_FLANG_RT_NON_TBP_DIO_H_
#define FORTRAN_FLANG_RT_NON_TBP_DIO_H_

#include "flang/Common/Fortran-consts.h"
#include "flang/Common/api-attrs.h"
Expand Down Expand Up @@ -53,4 +53,4 @@ struct NonTbpDefinedIoTable {
};

} // namespace Fortran::runtime::io
#endif /* FORTRAN_RUNTIME_NON_TBP_DIO_H_ */
#endif /* FORTRAN_FLANG_RT_NON_TBP_DIO_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/numeric-templates.h -------------------------*- C++ -*-===//
//===-- lib/flang_rt/numeric-templates.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 @@ -15,8 +15,8 @@
// for the data type corresponding to CppTypeFor<TypeCategory::Real, 16>
// on the target.

#ifndef FORTRAN_RUNTIME_NUMERIC_TEMPLATES_H_
#define FORTRAN_RUNTIME_NUMERIC_TEMPLATES_H_
#ifndef FORTRAN_FLANG_RT_NUMERIC_TEMPLATES_H_
#define FORTRAN_FLANG_RT_NUMERIC_TEMPLATES_H_

#include "terminator.h"
#include "tools.h"
Expand Down Expand Up @@ -465,4 +465,4 @@ template <typename T> inline RT_API_ATTRS T ErfcScaled(T arg) {

} // namespace Fortran::runtime

#endif /* FORTRAN_RUNTIME_NUMERIC_TEMPLATES_H_ */
#endif /* FORTRAN_FLANG_RT_NUMERIC_TEMPLATES_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/numeric.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/numeric.cpp --------------------------------*- 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 @@
//===-- lib/Runtime/pointer.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/pointer.cpp --------------------------------*- 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 @@
//===-- lib/Runtime/product.cpp ---------------------------------*- C++ -*-===//
//===-- lib/flang_rt/product.cpp --------------------------------*- 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 @@
//===-- lib/Runtime/pseudo-unit.cpp -----------------------------*- C++ -*-===//
//===-- lib/flang_rt/pseudo-unit.cpp ----------------------------*- 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 @@
//===-- lib/Runtime/ragged.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/ragged.cpp ---------------------------------*- 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,15 +1,15 @@
//===-- lib/Runtime/random-templates.h --------------------------*- C++ -*-===//
//===-- lib/flang_rt/random-templates.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
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_RUNTIME_RANDOM_TEMPLATES_H_
#define FORTRAN_RUNTIME_RANDOM_TEMPLATES_H_
#ifndef FORTRAN_FLANG_RT_RANDOM_TEMPLATES_H_
#define FORTRAN_FLANG_RT_RANDOM_TEMPLATES_H_

#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "lock.h"
#include "numeric-templates.h"
#include "flang/Common/optional.h"
Expand Down Expand Up @@ -85,4 +85,4 @@ inline void Generate(const Descriptor &harvest) {

} // namespace Fortran::runtime::random

#endif /* FORTRAN_RUNTIME_RANDOM_TEMPLATES_H_ */
#endif /* FORTRAN_FLANG_RT_RANDOM_TEMPLATES_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/random.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/random.cpp ---------------------------------*- 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 @@
// RANDOM_SEED.

#include "flang/Runtime/random.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "lock.h"
#include "random-templates.h"
#include "terminator.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/reduce.cpp ----------------------------------*- C++ -*-===//
//===-- lib/flang_rt/reduce.cpp ---------------------------------*- 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,7 +9,7 @@
// REDUCE() implementation

#include "flang/Runtime/reduce.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "reduction-templates.h"
#include "terminator.h"
#include "tools.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/reduction-templates.h -----------------------*- C++ -*-===//
//===-- lib/flang_rt/reduction-templates.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,10 +18,10 @@
// * Character-valued reductions (MAXVAL & MINVAL) return arbitrary
// length results, dynamically allocated in a caller-supplied descriptor

#ifndef FORTRAN_RUNTIME_REDUCTION_TEMPLATES_H_
#define FORTRAN_RUNTIME_REDUCTION_TEMPLATES_H_
#ifndef FORTRAN_FLANG_RT_REDUCTION_TEMPLATES_H_
#define FORTRAN_FLANG_RT_REDUCTION_TEMPLATES_H_

#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "numeric-templates.h"
#include "terminator.h"
#include "tools.h"
Expand Down Expand Up @@ -412,4 +412,4 @@ template <int KIND> struct Norm2Helper {
};

} // namespace Fortran::runtime
#endif /* FORTRAN_RUNTIME_REDUCTION_TEMPLATES_H_ */
#endif /* FORTRAN_FLANG_RT_REDUCTION_TEMPLATES_H_ */
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Runtime/reduction.cpp -------------------------------*- C++ -*-===//
//===-- lib/flang_rt/reduction.cpp ------------------------------*- 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 @@ -14,7 +14,7 @@
// NORM2, MAXLOC, MINLOC, MAXVAL, and MINVAL are in extrema.cpp.

#include "flang/Runtime/reduction.h"
#include "FortranRuntime/Runtime/descriptor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "reduction-templates.h"
#include <cinttypes>

Expand Down
Loading