diff --git a/FortranRuntime/test/NonGtestUnit/lit.site.cfg.py.in b/FortranRuntime/test/NonGtestUnit/lit.site.cfg.py.in deleted file mode 100644 index 3d1780a5d600a9..00000000000000 --- a/FortranRuntime/test/NonGtestUnit/lit.site.cfg.py.in +++ /dev/null @@ -1,13 +0,0 @@ -@LIT_SITE_CFG_IN_HEADER@ - -import os - -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.fortranruntime_binary_dir = "@FORTRANRUNTIME_BINARY_DIR@" -config.fortranruntime_binary_test_dir = os.path.dirname(__file__) - -import lit.llvm -lit.llvm.initialize(lit_config, config) - -# Let the main config do the real work. -lit_config.load_config(config, "@FORTRANRUNTIME_SOURCE_DIR@/test/NonGtestUnit/lit.cfg.py") diff --git a/FortranRuntime/test/Unit/lit.site.cfg.py.in b/FortranRuntime/test/Unit/lit.site.cfg.py.in deleted file mode 100644 index fa993aa897faca..00000000000000 --- a/FortranRuntime/test/Unit/lit.site.cfg.py.in +++ /dev/null @@ -1,14 +0,0 @@ -@LIT_SITE_CFG_IN_HEADER@ - -import os - -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" -config.fortranruntime_binary_dir = "@FORTRANRUNTIME_BINARY_DIR@" -config.fortranruntime_binary_test_dir = os.path.dirname(__file__) - -import lit.llvm -lit.llvm.initialize(lit_config, config) - -# Let the main config do the real work. -lit_config.load_config(config, "@FORTRANRUNTIME_SOURCE_DIR@/test/Unit/lit.cfg.py") diff --git a/FortranRuntime/test/lit.site.cfg.py.in b/FortranRuntime/test/lit.site.cfg.py.in deleted file mode 100644 index a21fc128086eae..00000000000000 --- a/FortranRuntime/test/lit.site.cfg.py.in +++ /dev/null @@ -1,18 +0,0 @@ -@LIT_SITE_CFG_IN_HEADER@ - -import sys - -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.build_lib_dir = "@FORTRANRUNTIME_BUILD_LIB_DIR@" -config.flang_source_dir = "@FLANG_SOURCE_DIR@" -config.fortranruntime_source_dir = "@FORTRANRUNTIME_SOURCE_DIR@" -config.fortranruntime_binary_test_dir = os.path.dirname(__file__) -config.fortranruntime_build_lib_dir = "@FORTRANRUNTIME_BUILD_LIB_DIR@" -config.cc = "@CMAKE_C_COMPILER@" -config.osx_sysroot = path(r"@CMAKE_OSX_SYSROOT@") - -import lit.llvm -lit.llvm.initialize(lit_config, config) - -# Let the main config do the real work. -lit_config.load_config(config, "@FORTRANRUNTIME_SOURCE_DIR@/test/lit.cfg.py") diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp index 5e4057116a97cb..ed2539cb4e3c5e 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -1291,7 +1291,7 @@ void tools::addOpenMPHostOffloadingArgs(const Compilation &C, /// Add Fortran runtime libs void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args, llvm::opt::ArgStringList &CmdArgs) { - // Link FortranRuntime + // Link flang_rt // These are handled earlier on Windows by telling the frontend driver to // add the correct libraries to link against as dependents in the object // file. @@ -1307,7 +1307,7 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args, if (AsNeeded) addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false); } - CmdArgs.push_back("-lFortranRuntime"); + CmdArgs.push_back("-lflang_rt"); } } diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp index aff656d74daa2f..072d57e8a7ff46 100644 --- a/clang/lib/Driver/ToolChains/Flang.cpp +++ b/clang/lib/Driver/ToolChains/Flang.cpp @@ -304,26 +304,26 @@ static void processVSRuntimeLibrary(const ToolChain &TC, const ArgList &Args, case options::OPT__SLASH_MT: CmdArgs.push_back("-D_MT"); CmdArgs.push_back("--dependent-lib=libcmt"); - CmdArgs.push_back("--dependent-lib=FortranRuntime.static.lib"); + CmdArgs.push_back("--dependent-lib=flang_rt.static.lib"); break; case options::OPT__SLASH_MTd: CmdArgs.push_back("-D_MT"); CmdArgs.push_back("-D_DEBUG"); CmdArgs.push_back("--dependent-lib=libcmtd"); - CmdArgs.push_back("--dependent-lib=FortranRuntime.static_dbg.lib"); + CmdArgs.push_back("--dependent-lib=flang_rt.static_dbg.lib"); break; case options::OPT__SLASH_MD: CmdArgs.push_back("-D_MT"); CmdArgs.push_back("-D_DLL"); CmdArgs.push_back("--dependent-lib=msvcrt"); - CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic.lib"); + CmdArgs.push_back("--dependent-lib=flang_rt.dynamic.lib"); break; case options::OPT__SLASH_MDd: CmdArgs.push_back("-D_MT"); CmdArgs.push_back("-D_DEBUG"); CmdArgs.push_back("-D_DLL"); CmdArgs.push_back("--dependent-lib=msvcrtd"); - CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic_dbg.lib"); + CmdArgs.push_back("--dependent-lib=flang_rt.dynamic_dbg.lib"); break; } } diff --git a/FortranRuntime/.clang-format b/flang-rt/.clang-format similarity index 100% rename from FortranRuntime/.clang-format rename to flang-rt/.clang-format diff --git a/FortranRuntime/.clang-tidy b/flang-rt/.clang-tidy similarity index 100% rename from FortranRuntime/.clang-tidy rename to flang-rt/.clang-tidy diff --git a/FortranRuntime/CMakeLists.txt b/flang-rt/CMakeLists.txt similarity index 54% rename from FortranRuntime/CMakeLists.txt rename to flang-rt/CMakeLists.txt index e65cab7060cb02..bd83a51482f4af 100644 --- a/FortranRuntime/CMakeLists.txt +++ b/flang-rt/CMakeLists.txt @@ -6,23 +6,23 @@ # #===------------------------------------------------------------------------===# # -# Build instructions for the FortranRuntime library and Fortran modules required -# by programs compiled by Flang. This is file is intended to be included using -# the LLVM_ENABLE_RUNTIMES mechanism. +# Build instructions for the flang-rt library. This is file is intended to be +# included using the LLVM_ENABLE_RUNTIMES mechanism. # #===------------------------------------------------------------------------===# set(LLVM_SUBPROJECT_TITLE "Fortran Runtime") -set(FORTRANRUNTIME_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") -set(FORTRANRUNTIME_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") +set(FLANGRT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(FLANGRT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") set(FLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../flang") enable_language(Fortran) list(APPEND CMAKE_MODULE_PATH - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" + "${FLANGRT_SOURCE_DIR}/cmake/modules" + "${FLANG_SOURCE_DIR}/cmake/modules" ) -include(AddFortranRuntime) +include(AddFlangRT) include(FlangCommon) @@ -30,7 +30,7 @@ include(FlangCommon) # Build Mode Introspection # ############################ -# Setting these variables from an LLVM build is sufficient that FortranRuntime can +# Setting these variables from an LLVM build is sufficient that flang-rt can # construct the output paths, so it can behave as if it were in-tree here. set(LLVM_TREE_AVAILABLE OFF) if (LLVM_LIBRARY_OUTPUT_INTDIR AND LLVM_RUNTIME_OUTPUT_INTDIR AND PACKAGE_VERSION) @@ -42,19 +42,19 @@ if (LLVM_TREE_AVAILABLE) # Despite Clang in the name, get_clang_resource_dir does not depend on Clang being added to the build # flang-new uses the same resource dir as clang. include(GetClangResourceDir) - get_clang_resource_dir(FORTRANRUNTIME_BUILD_LIB_DIR PREFIX "${LLVM_LIBRARY_OUTPUT_INTDIR}/.." SUBDIR "lib${LLVM_LIBDIR_SUFFIX}") - get_clang_resource_dir(FORTRANRUNTIME_INSTALL_LIB_DIR SUBDIR "lib${LLVM_LIBDIR_SUFFIX}") # No prefix, CMake's install command find the install prefix itself + get_clang_resource_dir(FLANGRT_BUILD_LIB_DIR PREFIX "${LLVM_LIBRARY_OUTPUT_INTDIR}/.." SUBDIR "lib${LLVM_LIBDIR_SUFFIX}") + get_clang_resource_dir(FLANGRT_INSTALL_LIB_DIR SUBDIR "lib${LLVM_LIBDIR_SUFFIX}") # No prefix, CMake's install command find the install prefix itself else () - set(FORTRANRUNTIME_BUILD_LIB_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}") - set(FORTRANRUNTIME_INSTALL_LIB_DIR "lib${LLVM_LIBDIR_SUFFIX}") + set(FLANGRT_BUILD_LIB_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}") + set(FLANGRT_INSTALL_LIB_DIR "lib${LLVM_LIBDIR_SUFFIX}") endif () if (DEFINED WIN32) - set(FORTRANRUNTIME_BUILD_LIB_DIR "${FORTRANRUNTIME_BUILD_LIB_DIR}/windows") - set(FORTRANRUNTIME_INSTALL_LIB_DIR "${FORTRANRUNTIME_INSTALL_LIB_DIR}/windows") + set(FLANGRT_BUILD_LIB_DIR "${FLANGRT_BUILD_LIB_DIR}/windows") + set(FLANGRT_INSTALL_LIB_DIR "${FLANGRT_INSTALL_LIB_DIR}/windows") elseif (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) - set(FORTRANRUNTIME_BUILD_LIB_DIR "${FORTRANRUNTIME_BUILD_LIB_DIR}/${LLVM_TARGET_TRIPLE}") - set(FORTRANRUNTIME_INSTALL_LIB_DIR "${FORTRANRUNTIME_INSTALL_LIB_DIR}/${LLVM_TARGET_TRIPLE}") + set(FLANGRT_BUILD_LIB_DIR "${FLANGRT_BUILD_LIB_DIR}/${LLVM_TARGET_TRIPLE}") + set(FLANGRT_INSTALL_LIB_DIR "${FLANGRT_INSTALL_LIB_DIR}/${LLVM_TARGET_TRIPLE}") endif () @@ -62,26 +62,30 @@ endif () # Build Options # ################# -option(FORTRANRUNTIME_INCLUDE_TESTS "Generate build targets for the FortranRuntime unit and regression-tests." "${LLVM_INCLUDE_TESTS}") - -set(FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT "" CACHE STRING "Compile FortranRuntime with GPU support (CUDA or OpenMP)") -set_property(CACHE FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT PROPERTY STRINGS - "" - CUDA - OpenMP) -if (NOT FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT) -elseif (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA") - set(FORTRANRUNTIME_LIBCUDACXX_PATH "" CACHE PATH "Path to libcu++ package installation") - option(FORTRANRUNTIME_CUDA_RUNTIME_PTX_WITHOUT_GLOBAL_VARS "Do not compile global variables' definitions when producing PTX library" OFF) -elseif (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "OpenMP") -set(FORTRANRUNTIME_DEVICE_ARCHITECTURES "all" CACHE STRING +# Important: flang-rt user options must be prefixed with "FLANG_RT_". Variables +# with this prefix will be forwarded in bootstrap builds. + +option(FLANG_RT_INCLUDE_TESTS "Generate build targets for the flang-rt unit and regression-tests." "${LLVM_INCLUDE_TESTS}") + +set(FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT "" CACHE STRING "Compile flang-rt with GPU support (CUDA or OpenMP)") +set_property(CACHE FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT PROPERTY STRINGS + "" + CUDA + OpenMP + ) +if (NOT FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT) +elseif (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA") + set(FLANG_RT_LIBCUDACXX_PATH "" CACHE PATH "Path to libcu++ package installation") + option(FLANG_RT_CUDA_RUNTIME_PTX_WITHOUT_GLOBAL_VARS "Do not compile global variables' definitions when producing PTX library" OFF) +elseif (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "OpenMP") +set(FLANG_RT_DEVICE_ARCHITECTURES "all" CACHE STRING "List of OpenMP device architectures to be used to compile the Fortran runtime (e.g. 'gfx1103;sm_90')") else () - message(FATAL_ERROR "Invalid value '${FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT}' for FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT; must be empty, 'CUDA', or 'OpenMP'") + message(FATAL_ERROR "Invalid value '${FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT}' for FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT; must be empty, 'CUDA', or 'OpenMP'") endif () -option(FORTRANRUNTIME_ENABLE_CUF "Compile CUDA Fortran runtime sources" OFF) -if (FORTRANRUNTIME_ENABLE_CUF) +option(FLANG_RT_ENABLE_CUF "Compile CUDA Fortran runtime sources" OFF) +if (FLANG_RT_ENABLE_CUF) find_package(CUDAToolkit REQUIRED) endif() @@ -113,9 +117,9 @@ if (WIN32) ERROR_QUIET ) if (NOT CXX_COMPILER_PRINT_LIBGCC_PATH_FAILURE AND CXX_COMPILER_PRINT_LIBGCC_PATH_RESULT) - string(STRIP "${CXX_COMPILER_PRINT_LIBGCC_PATH_RESULT}" FORTRANRUNTIME_LIBCALL) + string(STRIP "${CXX_COMPILER_PRINT_LIBGCC_PATH_RESULT}" FLANGRT_LIBCALL) else () - set(FORTRANRUNTIME_LIBCALL "") + set(FLANGRT_LIBCALL "") endif () endif () @@ -124,9 +128,9 @@ endif () # Build Preparation # ##################### -if (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT AND FORTRANRUNTIME_INCLUDE_TESTS) +if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT AND FLANG_RT_INCLUDE_TESTS) # If Fortran runtime is built as CUDA library, the linking - # of targets that link FortranRuntime must be done + # of targets that link flang-rt must be done # with CUDA_RESOLVE_DEVICE_SYMBOLS. # CUDA language must be enabled for CUDA_RESOLVE_DEVICE_SYMBOLS # to take effect. @@ -134,7 +138,7 @@ if (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT AND FORTRANRUNTIME_INCLUDE_TESTS endif() -# C++17 required for FortranRuntime, user or other runtimes may override this. +# C++17 is required for flang-rt; user or other runtimes may override this. # GTest included later also requires C++17. set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to") set(CMAKE_CXX_STANDARD_REQUIRED YES) @@ -153,9 +157,9 @@ configure_file(cmake/config.h.cmake.in config.h) add_subdirectory(lib) -if (FORTRANRUNTIME_INCLUDE_TESTS) +if (FLANG_RT_INCLUDE_TESTS) add_subdirectory(unittests) add_subdirectory(test) else () - add_custom_target(check-FortranRuntime) + add_custom_target(check-flang-rt) endif() diff --git a/FortranRuntime/CODE_OWNERS.TXT b/flang-rt/CODE_OWNERS.TXT similarity index 100% rename from FortranRuntime/CODE_OWNERS.TXT rename to flang-rt/CODE_OWNERS.TXT diff --git a/FortranRuntime/LICENSE.TXT b/flang-rt/LICENSE.TXT similarity index 100% rename from FortranRuntime/LICENSE.TXT rename to flang-rt/LICENSE.TXT diff --git a/FortranRuntime/README.md b/flang-rt/README.md similarity index 76% rename from FortranRuntime/README.md rename to flang-rt/README.md index cb578507f8c96e..01836f9d8f714d 100644 --- a/FortranRuntime/README.md +++ b/flang-rt/README.md @@ -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 @@ -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 /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). @@ -61,7 +61,7 @@ cmake -S /llvm \ -DNinja \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_PROJECTS="flang;openmp" \ - -DLLVM_ENABLE_RUNTIMES="compiler-rt;FortranRuntime" \ + -DLLVM_ENABLE_RUNTIMES="compiler-rt;flang-rt" \ ... ``` @@ -74,8 +74,8 @@ cross-compilation via `flang-new --target=`, 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 ``` @@ -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 @@ -100,13 +100,13 @@ cmake -S /runtimes \ -GNinja \ -DLLVM_BINARY_DIR= \ -DCMAKE_Fortran_COMPILER=/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. @@ -117,7 +117,7 @@ cmake -S /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= \ @@ -131,13 +131,13 @@ cmake -S /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: `""`) @@ -148,20 +148,20 @@ 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_.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`). @@ -169,14 +169,14 @@ CMake itself provide. ### 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 @@ -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. diff --git a/FortranRuntime/cmake/config.h.cmake.in b/flang-rt/cmake/config.h.cmake.in similarity index 100% rename from FortranRuntime/cmake/config.h.cmake.in rename to flang-rt/cmake/config.h.cmake.in diff --git a/FortranRuntime/cmake/modules/AddFortranRuntime.cmake b/flang-rt/cmake/modules/AddFlangRT.cmake similarity index 72% rename from FortranRuntime/cmake/modules/AddFortranRuntime.cmake rename to flang-rt/cmake/modules/AddFlangRT.cmake index e9563c6e3a60b9..797eeddae32142 100644 --- a/FortranRuntime/cmake/modules/AddFortranRuntime.cmake +++ b/flang-rt/cmake/modules/AddFlangRT.cmake @@ -1,4 +1,4 @@ -#===-- 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. @@ -6,11 +6,11 @@ # #===------------------------------------------------------------------------===# -# 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 @@ -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 @@ -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 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 "$<$:-Xclang>$<$:-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 "$<$:-Xclang>$<$:-Xflang>" "--dependent-lib=${FLANGRT_LIBCALL}") endif () # Non-GTest unittests depend on LLVMSupport @@ -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) diff --git a/FortranRuntime/cmake/modules/AddFortranOffloadRuntime.cmake b/flang-rt/cmake/modules/AddFlangRTOffload.cmake similarity index 82% rename from FortranRuntime/cmake/modules/AddFortranOffloadRuntime.cmake rename to flang-rt/cmake/modules/AddFlangRTOffload.cmake index d60a26ce0f8a86..a6b94602b0456f 100644 --- a/FortranRuntime/cmake/modules/AddFortranOffloadRuntime.cmake +++ b/flang-rt/cmake/modules/AddFlangRTOffload.cmake @@ -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" @@ -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) @@ -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 @@ -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() diff --git a/flang/include/flang/Runtime/CUDA/allocator.h b/flang-rt/include/flang-rt/CufRuntime/allocator.h similarity index 85% rename from flang/include/flang/Runtime/CUDA/allocator.h rename to flang-rt/include/flang-rt/CufRuntime/allocator.h index cc88896b1f0bd6..63406e0de6d2fa 100644 --- a/flang/include/flang/Runtime/CUDA/allocator.h +++ b/flang-rt/include/flang-rt/CufRuntime/allocator.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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" @@ -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_ */ diff --git a/FortranRuntime/include/FortranRuntime/Runtime/allocator-registry.h b/flang-rt/include/flang-rt/flang_rt/allocator-registry.h similarity index 87% rename from FortranRuntime/include/FortranRuntime/Runtime/allocator-registry.h rename to flang-rt/include/flang-rt/flang_rt/allocator-registry.h index 30a583b88c083e..ecad61ab4043d7 100644 --- a/FortranRuntime/include/FortranRuntime/Runtime/allocator-registry.h +++ b/flang-rt/include/flang-rt/flang_rt/allocator-registry.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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" @@ -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_ */ diff --git a/FortranRuntime/include/FortranRuntime/Runtime/array-constructor.h b/flang-rt/include/flang-rt/flang_rt/array-constructor.h similarity index 85% rename from FortranRuntime/include/FortranRuntime/Runtime/array-constructor.h rename to flang-rt/include/flang-rt/flang_rt/array-constructor.h index 314d5e56599cd3..e8fffc762b6fbe 100644 --- a/FortranRuntime/include/FortranRuntime/Runtime/array-constructor.h +++ b/flang-rt/include/flang-rt/flang_rt/array-constructor.h @@ -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. @@ -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 @@ -45,4 +45,4 @@ struct ArrayConstructorVector { }; } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_ARRAY_CONSTRUCTOR_H_ */ +#endif /* FORTRAN_FLANG_RT_ARRAY_CONSTRUCTOR_H_ */ diff --git a/FortranRuntime/include/FortranRuntime/Runtime/descriptor.h b/flang-rt/include/flang-rt/flang_rt/descriptor.h similarity index 98% rename from FortranRuntime/include/FortranRuntime/Runtime/descriptor.h rename to flang-rt/include/flang-rt/flang_rt/descriptor.h index f79ad6b9637a4a..fea5b55c1922ce 100644 --- a/FortranRuntime/include/FortranRuntime/Runtime/descriptor.h +++ b/flang-rt/include/flang-rt/flang_rt/descriptor.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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, @@ -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 @@ -482,4 +482,4 @@ class alignas(Descriptor) StaticDescriptor { }; } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_DESCRIPTOR_H_ */ +#endif /* FORTRAN_FLANG_RT_DESCRIPTOR_H_ */ diff --git a/FortranRuntime/include/FortranRuntime/Runtime/io-api-funcs.h b/flang-rt/include/flang-rt/flang_rt/io-api-funcs.h similarity index 84% rename from FortranRuntime/include/FortranRuntime/Runtime/io-api-funcs.h rename to flang-rt/include/flang-rt/flang_rt/io-api-funcs.h index 516fe25784656c..00cb49ad015437 100644 --- a/FortranRuntime/include/FortranRuntime/Runtime/io-api-funcs.h +++ b/flang-rt/include/flang-rt/flang_rt/io-api-funcs.h @@ -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. @@ -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" @@ -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_ */ diff --git a/FortranRuntime/include/FortranRuntime/Runtime/iostat-funcs.h b/flang-rt/include/flang-rt/flang_rt/iostat-funcs.h similarity index 75% rename from FortranRuntime/include/FortranRuntime/Runtime/iostat-funcs.h rename to flang-rt/include/flang-rt/flang_rt/iostat-funcs.h index 10906afb01673c..dd24d41fbaad10 100644 --- a/FortranRuntime/include/FortranRuntime/Runtime/iostat-funcs.h +++ b/flang-rt/include/flang-rt/flang_rt/iostat-funcs.h @@ -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. @@ -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" @@ -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_ */ diff --git a/FortranRuntime/include/FortranRuntime/Runtime/memory.h b/flang-rt/include/flang-rt/flang_rt/memory.h similarity index 96% rename from FortranRuntime/include/FortranRuntime/Runtime/memory.h rename to flang-rt/include/flang-rt/flang_rt/memory.h index 3e7fd2d9ea3e3b..b97f6525d60036 100644 --- a/FortranRuntime/include/FortranRuntime/Runtime/memory.h +++ b/flang-rt/include/flang-rt/flang_rt/memory.h @@ -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. @@ -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 @@ -170,4 +170,4 @@ template struct Allocator { }; } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_MEMORY_H_ */ +#endif /* FORTRAN_FLANG_RT_MEMORY_H_ */ diff --git a/FortranRuntime/include/FortranRuntime/Runtime/type-code.h b/flang-rt/include/flang-rt/flang_rt/type-code.h similarity index 93% rename from FortranRuntime/include/FortranRuntime/Runtime/type-code.h rename to flang-rt/include/flang-rt/flang_rt/type-code.h index 92ff593410c12c..7c694a13431b13 100644 --- a/FortranRuntime/include/FortranRuntime/Runtime/type-code.h +++ b/flang-rt/include/flang-rt/flang_rt/type-code.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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" @@ -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_ */ diff --git a/FortranRuntime/lib/CMakeLists.txt b/flang-rt/lib/CMakeLists.txt similarity index 71% rename from FortranRuntime/lib/CMakeLists.txt rename to flang-rt/lib/CMakeLists.txt index 74c78b3fa3a493..f0422f5e0a58b4 100644 --- a/FortranRuntime/lib/CMakeLists.txt +++ b/flang-rt/lib/CMakeLists.txt @@ -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 () - diff --git a/FortranRuntime/lib/Runtime/CUDA/CMakeLists.txt b/flang-rt/lib/CufRuntime/CMakeLists.txt similarity index 87% rename from FortranRuntime/lib/Runtime/CUDA/CMakeLists.txt rename to flang-rt/lib/CufRuntime/CMakeLists.txt index 78b98652d60813..1eb80d9ca1d497 100644 --- a/FortranRuntime/lib/Runtime/CUDA/CMakeLists.txt +++ b/flang-rt/lib/CufRuntime/CMakeLists.txt @@ -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. @@ -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 ) @@ -25,6 +25,6 @@ endif() target_link_libraries(${CUFRT_LIBNAME} PRIVATE - FortranRuntime + flang_rt ${CUDA_RT_TARGET} ) diff --git a/FortranRuntime/lib/Runtime/CUDA/allocator.cpp b/flang-rt/lib/CufRuntime/allocator.cpp similarity index 81% rename from FortranRuntime/lib/Runtime/CUDA/allocator.cpp rename to flang-rt/lib/CufRuntime/allocator.cpp index c9d62f6ea8f3bf..8c16fb77f2ac46 100644 --- a/FortranRuntime/lib/Runtime/CUDA/allocator.cpp +++ b/flang-rt/lib/CufRuntime/allocator.cpp @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,14 +6,14 @@ // //===----------------------------------------------------------------------===// -#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" diff --git a/FortranRuntime/lib/Runtime/CUDA/descriptor.cpp b/flang-rt/lib/CufRuntime/descriptor.cpp similarity index 82% rename from FortranRuntime/lib/Runtime/CUDA/descriptor.cpp rename to flang-rt/lib/CufRuntime/descriptor.cpp index 94b5feca4ce4dc..b034fc76b67d4d 100644 --- a/FortranRuntime/lib/Runtime/CUDA/descriptor.cpp +++ b/flang-rt/lib/CufRuntime/descriptor.cpp @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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" { diff --git a/FortranRuntime/lib/Runtime/Float128Math/CMakeLists.txt b/flang-rt/lib/FortranFloat128Math/CMakeLists.txt similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/CMakeLists.txt rename to flang-rt/lib/FortranFloat128Math/CMakeLists.txt index ed65da0a5ac71c..b12dfee64af8f6 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/CMakeLists.txt +++ b/flang-rt/lib/FortranFloat128Math/CMakeLists.txt @@ -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. @@ -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) @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/acos.cpp b/flang-rt/lib/FortranFloat128Math/acos.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/acos.cpp rename to flang-rt/lib/FortranFloat128Math/acos.cpp index 7b15e4a0bfd3ae..e204c6c871f3fa 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/acos.cpp +++ b/flang-rt/lib/FortranFloat128Math/acos.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/acosh.cpp b/flang-rt/lib/FortranFloat128Math/acosh.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/acosh.cpp rename to flang-rt/lib/FortranFloat128Math/acosh.cpp index c873259b4545b8..90ff7886e6909d 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/acosh.cpp +++ b/flang-rt/lib/FortranFloat128Math/acosh.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/asin.cpp b/flang-rt/lib/FortranFloat128Math/asin.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/asin.cpp rename to flang-rt/lib/FortranFloat128Math/asin.cpp index 8866d51430197a..18368044d72b0f 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/asin.cpp +++ b/flang-rt/lib/FortranFloat128Math/asin.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/asinh.cpp b/flang-rt/lib/FortranFloat128Math/asinh.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/asinh.cpp rename to flang-rt/lib/FortranFloat128Math/asinh.cpp index 288193001ce1da..2c1f040cfc3872 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/asinh.cpp +++ b/flang-rt/lib/FortranFloat128Math/asinh.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/atan.cpp b/flang-rt/lib/FortranFloat128Math/atan.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/atan.cpp rename to flang-rt/lib/FortranFloat128Math/atan.cpp index 390c080b4d501b..8bd9a2626caf83 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/atan.cpp +++ b/flang-rt/lib/FortranFloat128Math/atan.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/atan2.cpp b/flang-rt/lib/FortranFloat128Math/atan2.cpp similarity index 91% rename from FortranRuntime/lib/Runtime/Float128Math/atan2.cpp rename to flang-rt/lib/FortranFloat128Math/atan2.cpp index 3c206b75704431..4994be699a0b67 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/atan2.cpp +++ b/flang-rt/lib/FortranFloat128Math/atan2.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/atanh.cpp b/flang-rt/lib/FortranFloat128Math/atanh.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/atanh.cpp rename to flang-rt/lib/FortranFloat128Math/atanh.cpp index 77ceb188f04e42..f5ace35ac51caa 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/atanh.cpp +++ b/flang-rt/lib/FortranFloat128Math/atanh.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/ceil.cpp b/flang-rt/lib/FortranFloat128Math/ceil.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/ceil.cpp rename to flang-rt/lib/FortranFloat128Math/ceil.cpp index 46bc253bd0922d..834da9396c071d 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/ceil.cpp +++ b/flang-rt/lib/FortranFloat128Math/ceil.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/complex-math.c b/flang-rt/lib/FortranFloat128Math/complex-math.c similarity index 96% rename from FortranRuntime/lib/Runtime/Float128Math/complex-math.c rename to flang-rt/lib/FortranFloat128Math/complex-math.c index f34ef7da76e599..493ffe942f7e31 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/complex-math.c +++ b/flang-rt/lib/FortranFloat128Math/complex-math.c @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/complex-math.h b/flang-rt/lib/FortranFloat128Math/complex-math.h similarity index 88% rename from FortranRuntime/lib/Runtime/Float128Math/complex-math.h rename to flang-rt/lib/FortranFloat128Math/complex-math.h index 6f5c7954bab035..bb67523e1bddcc 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/complex-math.h +++ b/flang-rt/lib/FortranFloat128Math/complex-math.h @@ -1,4 +1,4 @@ -/*===-- 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. @@ -6,8 +6,8 @@ * *===----------------------------------------------------------------------===*/ -#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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/Float128Math/cos.cpp b/flang-rt/lib/FortranFloat128Math/cos.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/cos.cpp rename to flang-rt/lib/FortranFloat128Math/cos.cpp index 8ce47151e2914b..2651982666118b 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/cos.cpp +++ b/flang-rt/lib/FortranFloat128Math/cos.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/cosh.cpp b/flang-rt/lib/FortranFloat128Math/cosh.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/cosh.cpp rename to flang-rt/lib/FortranFloat128Math/cosh.cpp index f1ec45bcfb479d..dda01e5abef66d 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/cosh.cpp +++ b/flang-rt/lib/FortranFloat128Math/cosh.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/erf.cpp b/flang-rt/lib/FortranFloat128Math/erf.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/erf.cpp rename to flang-rt/lib/FortranFloat128Math/erf.cpp index 010088467794d1..f5e713d93cac61 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/erf.cpp +++ b/flang-rt/lib/FortranFloat128Math/erf.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/erfc.cpp b/flang-rt/lib/FortranFloat128Math/erfc.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/erfc.cpp rename to flang-rt/lib/FortranFloat128Math/erfc.cpp index b226f8d2dc378b..3f8b78ba0e64f9 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/erfc.cpp +++ b/flang-rt/lib/FortranFloat128Math/erfc.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/exp.cpp b/flang-rt/lib/FortranFloat128Math/exp.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/exp.cpp rename to flang-rt/lib/FortranFloat128Math/exp.cpp index e22f9df3579e96..0b694b159f3621 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/exp.cpp +++ b/flang-rt/lib/FortranFloat128Math/exp.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/exponent.cpp b/flang-rt/lib/FortranFloat128Math/exponent.cpp similarity index 92% rename from FortranRuntime/lib/Runtime/Float128Math/exponent.cpp rename to flang-rt/lib/FortranFloat128Math/exponent.cpp index f07bf30bd1096f..a9c1b867e7ea37 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/exponent.cpp +++ b/flang-rt/lib/FortranFloat128Math/exponent.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/floor.cpp b/flang-rt/lib/FortranFloat128Math/floor.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/floor.cpp rename to flang-rt/lib/FortranFloat128Math/floor.cpp index 8744e6e2fec63c..27cfed2f1f9599 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/floor.cpp +++ b/flang-rt/lib/FortranFloat128Math/floor.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/fma.cpp b/flang-rt/lib/FortranFloat128Math/fma.cpp similarity index 91% rename from FortranRuntime/lib/Runtime/Float128Math/fma.cpp rename to flang-rt/lib/FortranFloat128Math/fma.cpp index 198fec5d4bc356..a9ac1581002cec 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/fma.cpp +++ b/flang-rt/lib/FortranFloat128Math/fma.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/fraction.cpp b/flang-rt/lib/FortranFloat128Math/fraction.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/fraction.cpp rename to flang-rt/lib/FortranFloat128Math/fraction.cpp index d4749bf3eb7e0e..39c59a25812abb 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/fraction.cpp +++ b/flang-rt/lib/FortranFloat128Math/fraction.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/hypot.cpp b/flang-rt/lib/FortranFloat128Math/hypot.cpp similarity index 91% rename from FortranRuntime/lib/Runtime/Float128Math/hypot.cpp rename to flang-rt/lib/FortranFloat128Math/hypot.cpp index 6542bf505060df..c130e204f9951e 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/hypot.cpp +++ b/flang-rt/lib/FortranFloat128Math/hypot.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/j0.cpp b/flang-rt/lib/FortranFloat128Math/j0.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/j0.cpp rename to flang-rt/lib/FortranFloat128Math/j0.cpp index 27e4338cdfc2b0..d6454b56c8a86b 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/j0.cpp +++ b/flang-rt/lib/FortranFloat128Math/j0.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/j1.cpp b/flang-rt/lib/FortranFloat128Math/j1.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/j1.cpp rename to flang-rt/lib/FortranFloat128Math/j1.cpp index d3f897827f9f67..2b7283aea0fe46 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/j1.cpp +++ b/flang-rt/lib/FortranFloat128Math/j1.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/jn.cpp b/flang-rt/lib/FortranFloat128Math/jn.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/jn.cpp rename to flang-rt/lib/FortranFloat128Math/jn.cpp index 681bb5b1ff3ad5..cdc9af9b3dd6a5 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/jn.cpp +++ b/flang-rt/lib/FortranFloat128Math/jn.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/lgamma.cpp b/flang-rt/lib/FortranFloat128Math/lgamma.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/lgamma.cpp rename to flang-rt/lib/FortranFloat128Math/lgamma.cpp index 0426db2e3b98d3..cecf9e90ad29ba 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/lgamma.cpp +++ b/flang-rt/lib/FortranFloat128Math/lgamma.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/llround.cpp b/flang-rt/lib/FortranFloat128Math/llround.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/llround.cpp rename to flang-rt/lib/FortranFloat128Math/llround.cpp index 4c9026cce00283..7853ac10f53e88 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/llround.cpp +++ b/flang-rt/lib/FortranFloat128Math/llround.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/log.cpp b/flang-rt/lib/FortranFloat128Math/log.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/log.cpp rename to flang-rt/lib/FortranFloat128Math/log.cpp index a5a431ae5ffbbb..d705eaf441c31f 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/log.cpp +++ b/flang-rt/lib/FortranFloat128Math/log.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/log10.cpp b/flang-rt/lib/FortranFloat128Math/log10.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/log10.cpp rename to flang-rt/lib/FortranFloat128Math/log10.cpp index 9a83f57b6c736d..af61f8762371b9 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/log10.cpp +++ b/flang-rt/lib/FortranFloat128Math/log10.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/lround.cpp b/flang-rt/lib/FortranFloat128Math/lround.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/lround.cpp rename to flang-rt/lib/FortranFloat128Math/lround.cpp index 65546881157948..24278f1040e9e3 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/lround.cpp +++ b/flang-rt/lib/FortranFloat128Math/lround.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/math-entries.h b/flang-rt/lib/FortranFloat128Math/math-entries.h similarity index 97% rename from FortranRuntime/lib/Runtime/Float128Math/math-entries.h rename to flang-rt/lib/FortranFloat128Math/math-entries.h index 1449000820f00e..9b13c10836f877 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/math-entries.h +++ b/flang-rt/lib/FortranFloat128Math/math-entries.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/Float128Math/mod-real.cpp b/flang-rt/lib/FortranFloat128Math/mod-real.cpp similarity index 91% rename from FortranRuntime/lib/Runtime/Float128Math/mod-real.cpp rename to flang-rt/lib/FortranFloat128Math/mod-real.cpp index e3b96d39e76ae6..b3c2b715b21995 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/mod-real.cpp +++ b/flang-rt/lib/FortranFloat128Math/mod-real.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/modulo-real.cpp b/flang-rt/lib/FortranFloat128Math/modulo-real.cpp similarity index 91% rename from FortranRuntime/lib/Runtime/Float128Math/modulo-real.cpp rename to flang-rt/lib/FortranFloat128Math/modulo-real.cpp index 8edf59e9f59dd4..f5e3cf8a259a73 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/modulo-real.cpp +++ b/flang-rt/lib/FortranFloat128Math/modulo-real.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/nearest.cpp b/flang-rt/lib/FortranFloat128Math/nearest.cpp similarity index 91% rename from FortranRuntime/lib/Runtime/Float128Math/nearest.cpp rename to flang-rt/lib/FortranFloat128Math/nearest.cpp index 8b9f142d79ff93..eb34c2ddb6ab48 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/nearest.cpp +++ b/flang-rt/lib/FortranFloat128Math/nearest.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/norm2.cpp b/flang-rt/lib/FortranFloat128Math/norm2.cpp similarity index 94% rename from FortranRuntime/lib/Runtime/Float128Math/norm2.cpp rename to flang-rt/lib/FortranFloat128Math/norm2.cpp index a0c26e40de0064..d000fde1bb0bea 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/norm2.cpp +++ b/flang-rt/lib/FortranFloat128Math/norm2.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/numeric-template-specs.h b/flang-rt/lib/FortranFloat128Math/numeric-template-specs.h similarity index 84% rename from FortranRuntime/lib/Runtime/Float128Math/numeric-template-specs.h rename to flang-rt/lib/FortranFloat128Math/numeric-template-specs.h index 2a843df2d1d861..f34ee5f4e3a8de 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/numeric-template-specs.h +++ b/flang-rt/lib/FortranFloat128Math/numeric-template-specs.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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" @@ -52,4 +52,4 @@ template <> struct SQRTTy { }; } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_FLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_ */ +#endif /* FORTRAN_FORTRANFLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_ */ diff --git a/FortranRuntime/lib/Runtime/Float128Math/pow.cpp b/flang-rt/lib/FortranFloat128Math/pow.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/pow.cpp rename to flang-rt/lib/FortranFloat128Math/pow.cpp index c11978ca068f23..f5deb00a556f48 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/pow.cpp +++ b/flang-rt/lib/FortranFloat128Math/pow.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/random.cpp b/flang-rt/lib/FortranFloat128Math/random.cpp similarity index 91% rename from FortranRuntime/lib/Runtime/Float128Math/random.cpp rename to flang-rt/lib/FortranFloat128Math/random.cpp index a9dc3c7a82b673..3a01c2c88b1d66 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/random.cpp +++ b/flang-rt/lib/FortranFloat128Math/random.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/round.cpp b/flang-rt/lib/FortranFloat128Math/round.cpp similarity index 92% rename from FortranRuntime/lib/Runtime/Float128Math/round.cpp rename to flang-rt/lib/FortranFloat128Math/round.cpp index 5a9366b3af4785..3453f4ea8a1a26 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/round.cpp +++ b/flang-rt/lib/FortranFloat128Math/round.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/rrspacing.cpp b/flang-rt/lib/FortranFloat128Math/rrspacing.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/rrspacing.cpp rename to flang-rt/lib/FortranFloat128Math/rrspacing.cpp index 2c501b3512c215..0809815027f859 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/rrspacing.cpp +++ b/flang-rt/lib/FortranFloat128Math/rrspacing.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/scale.cpp b/flang-rt/lib/FortranFloat128Math/scale.cpp similarity index 92% rename from FortranRuntime/lib/Runtime/Float128Math/scale.cpp rename to flang-rt/lib/FortranFloat128Math/scale.cpp index 859c955b8114e0..37528330bfb115 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/scale.cpp +++ b/flang-rt/lib/FortranFloat128Math/scale.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/set-exponent.cpp b/flang-rt/lib/FortranFloat128Math/set-exponent.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/set-exponent.cpp rename to flang-rt/lib/FortranFloat128Math/set-exponent.cpp index 52258182871a14..52f8f08f7003ef 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/set-exponent.cpp +++ b/flang-rt/lib/FortranFloat128Math/set-exponent.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/sin.cpp b/flang-rt/lib/FortranFloat128Math/sin.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/sin.cpp rename to flang-rt/lib/FortranFloat128Math/sin.cpp index 99aa4095c8cf1a..1a24e7c57ba469 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/sin.cpp +++ b/flang-rt/lib/FortranFloat128Math/sin.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/sinh.cpp b/flang-rt/lib/FortranFloat128Math/sinh.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/sinh.cpp rename to flang-rt/lib/FortranFloat128Math/sinh.cpp index a7dfe36737de43..7a4127cee970cd 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/sinh.cpp +++ b/flang-rt/lib/FortranFloat128Math/sinh.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/spacing.cpp b/flang-rt/lib/FortranFloat128Math/spacing.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/spacing.cpp rename to flang-rt/lib/FortranFloat128Math/spacing.cpp index 66a01851965840..d3ed077d5412dc 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/spacing.cpp +++ b/flang-rt/lib/FortranFloat128Math/spacing.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/sqrt.cpp b/flang-rt/lib/FortranFloat128Math/sqrt.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/sqrt.cpp rename to flang-rt/lib/FortranFloat128Math/sqrt.cpp index cbc1e503d50fd9..a9f5246f35388f 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/sqrt.cpp +++ b/flang-rt/lib/FortranFloat128Math/sqrt.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/tan.cpp b/flang-rt/lib/FortranFloat128Math/tan.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/tan.cpp rename to flang-rt/lib/FortranFloat128Math/tan.cpp index dbe4627f585f14..dc386c5be6ab74 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/tan.cpp +++ b/flang-rt/lib/FortranFloat128Math/tan.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/tanh.cpp b/flang-rt/lib/FortranFloat128Math/tanh.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/tanh.cpp rename to flang-rt/lib/FortranFloat128Math/tanh.cpp index 37e40966ced722..5f8af3f1cd8d77 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/tanh.cpp +++ b/flang-rt/lib/FortranFloat128Math/tanh.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/tgamma.cpp b/flang-rt/lib/FortranFloat128Math/tgamma.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/tgamma.cpp rename to flang-rt/lib/FortranFloat128Math/tgamma.cpp index 07a019c6d9971f..b1a42cdc5d0f41 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/tgamma.cpp +++ b/flang-rt/lib/FortranFloat128Math/tgamma.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/trunc.cpp b/flang-rt/lib/FortranFloat128Math/trunc.cpp similarity index 91% rename from FortranRuntime/lib/Runtime/Float128Math/trunc.cpp rename to flang-rt/lib/FortranFloat128Math/trunc.cpp index 9f38bdc18e73c4..455204ece3b2f6 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/trunc.cpp +++ b/flang-rt/lib/FortranFloat128Math/trunc.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/y0.cpp b/flang-rt/lib/FortranFloat128Math/y0.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/y0.cpp rename to flang-rt/lib/FortranFloat128Math/y0.cpp index 6eaa3396e7ea07..58bd71105efea6 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/y0.cpp +++ b/flang-rt/lib/FortranFloat128Math/y0.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/y1.cpp b/flang-rt/lib/FortranFloat128Math/y1.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/y1.cpp rename to flang-rt/lib/FortranFloat128Math/y1.cpp index c9f48ea0e26546..5d7b48e276b6f9 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/y1.cpp +++ b/flang-rt/lib/FortranFloat128Math/y1.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/Float128Math/yn.cpp b/flang-rt/lib/FortranFloat128Math/yn.cpp similarity index 90% rename from FortranRuntime/lib/Runtime/Float128Math/yn.cpp rename to flang-rt/lib/FortranFloat128Math/yn.cpp index 6bc5f4996a88d5..9f19861931d84c 100644 --- a/FortranRuntime/lib/Runtime/Float128Math/yn.cpp +++ b/flang-rt/lib/FortranFloat128Math/yn.cpp @@ -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. diff --git a/FortranRuntime/lib/Testing/CMakeLists.txt b/flang-rt/lib/Testing/CMakeLists.txt similarity index 89% rename from FortranRuntime/lib/Testing/CMakeLists.txt rename to flang-rt/lib/Testing/CMakeLists.txt index 41ad0d7314dd37..bdfca0ee9d3f23 100644 --- a/FortranRuntime/lib/Testing/CMakeLists.txt +++ b/flang-rt/lib/Testing/CMakeLists.txt @@ -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 diff --git a/FortranRuntime/lib/Runtime/CMakeLists.txt b/flang-rt/lib/flang_rt/CMakeLists.txt similarity index 66% rename from FortranRuntime/lib/Runtime/CMakeLists.txt rename to flang-rt/lib/flang_rt/CMakeLists.txt index 1db5520d5eaedf..860152c39c7204 100644 --- a/FortranRuntime/lib/Runtime/CMakeLists.txt +++ b/flang-rt/lib/flang_rt/CMakeLists.txt @@ -1,4 +1,4 @@ -#===-- 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. @@ -6,7 +6,7 @@ # #===------------------------------------------------------------------------===# -include(AddFortranOffloadRuntime) +include(AddFlangRTOffload) # List of files that are buildable for all devices. set(supported_sources @@ -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 @@ -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 ) @@ -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 @@ -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() diff --git a/FortranRuntime/lib/Runtime/ISO_Fortran_binding.cpp b/flang-rt/lib/flang_rt/ISO_Fortran_binding.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/ISO_Fortran_binding.cpp rename to flang-rt/lib/flang_rt/ISO_Fortran_binding.cpp index 997226b08e96a6..37bc1b9dfe426b 100644 --- a/FortranRuntime/lib/Runtime/ISO_Fortran_binding.cpp +++ b/flang-rt/lib/flang_rt/ISO_Fortran_binding.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/ISO_Fortran_util.h b/flang-rt/lib/flang_rt/ISO_Fortran_util.h similarity index 91% rename from FortranRuntime/lib/Runtime/ISO_Fortran_util.h rename to flang-rt/lib/flang_rt/ISO_Fortran_util.h index e418266dddccc7..a7bb1d21679063 100644 --- a/FortranRuntime/lib/Runtime/ISO_Fortran_util.h +++ b/flang-rt/lib/flang_rt/ISO_Fortran_util.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,13 +6,13 @@ // //===----------------------------------------------------------------------===// -#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 @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/allocatable.cpp b/flang-rt/lib/flang_rt/allocatable.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/allocatable.cpp rename to flang-rt/lib/flang_rt/allocatable.cpp index 4a3b89f4879c12..b9be74f8cb6f1b 100644 --- a/FortranRuntime/lib/Runtime/allocatable.cpp +++ b/flang-rt/lib/flang_rt/allocatable.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/allocator-registry.cpp b/flang-rt/lib/flang_rt/allocator-registry.cpp similarity index 85% rename from FortranRuntime/lib/Runtime/allocator-registry.cpp rename to flang-rt/lib/flang_rt/allocator-registry.cpp index 17883e5c54870d..a0e6fd8eadc856 100644 --- a/FortranRuntime/lib/Runtime/allocator-registry.cpp +++ b/flang-rt/lib/flang_rt/allocator-registry.cpp @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,16 +6,16 @@ // //===----------------------------------------------------------------------===// -#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) { diff --git a/FortranRuntime/lib/Runtime/array-constructor.cpp b/flang-rt/lib/flang_rt/array-constructor.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/array-constructor.cpp rename to flang-rt/lib/flang_rt/array-constructor.cpp index 002dfba2c066f5..daaa1e3b04a3b6 100644 --- a/FortranRuntime/lib/Runtime/array-constructor.cpp +++ b/flang-rt/lib/flang_rt/array-constructor.cpp @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,9 +6,9 @@ // //===----------------------------------------------------------------------===// -#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" diff --git a/FortranRuntime/lib/Runtime/assign-impl.h b/flang-rt/lib/flang_rt/assign-impl.h similarity index 100% rename from FortranRuntime/lib/Runtime/assign-impl.h rename to flang-rt/lib/flang_rt/assign-impl.h diff --git a/FortranRuntime/lib/Runtime/assign.cpp b/flang-rt/lib/flang_rt/assign.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/assign.cpp rename to flang-rt/lib/flang_rt/assign.cpp index 3a1486ace928a2..4916fc48888189 100644 --- a/FortranRuntime/lib/Runtime/assign.cpp +++ b/flang-rt/lib/flang_rt/assign.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/buffer.cpp b/flang-rt/lib/flang_rt/buffer.cpp similarity index 93% rename from FortranRuntime/lib/Runtime/buffer.cpp rename to flang-rt/lib/flang_rt/buffer.cpp index ce78fe34503c46..9913cdf2e7ec40 100644 --- a/FortranRuntime/lib/Runtime/buffer.cpp +++ b/flang-rt/lib/flang_rt/buffer.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/buffer.h b/flang-rt/lib/flang_rt/buffer.h similarity index 97% rename from FortranRuntime/lib/Runtime/buffer.h rename to flang-rt/lib/flang_rt/buffer.h index 52df0f10813c25..eb9b0712819a6c 100644 --- a/FortranRuntime/lib/Runtime/buffer.h +++ b/flang-rt/lib/flang_rt/buffer.h @@ -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. @@ -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 @@ -221,4 +221,4 @@ template class FileFrame { bool dirty_{false}; }; } // namespace Fortran::runtime::io -#endif /* FORTRAN_RUNTIME_BUFFER_H_ */ +#endif /* FORTRAN_FLANG_RT_BUFFER_H_ */ diff --git a/FortranRuntime/lib/Runtime/character.cpp b/flang-rt/lib/flang_rt/character.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/character.cpp rename to flang-rt/lib/flang_rt/character.cpp index 1f3edd6e80392e..aeb26098c399c8 100644 --- a/FortranRuntime/lib/Runtime/character.cpp +++ b/flang-rt/lib/flang_rt/character.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/command.cpp b/flang-rt/lib/flang_rt/command.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/command.cpp rename to flang-rt/lib/flang_rt/command.cpp index 64b2e62461dd58..5c7497518f3da3 100644 --- a/FortranRuntime/lib/Runtime/command.cpp +++ b/flang-rt/lib/flang_rt/command.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/complex-powi.cpp b/flang-rt/lib/flang_rt/complex-powi.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/complex-powi.cpp rename to flang-rt/lib/flang_rt/complex-powi.cpp index 2eacf56386b193..90013c117aea41 100644 --- a/FortranRuntime/lib/Runtime/complex-powi.cpp +++ b/flang-rt/lib/flang_rt/complex-powi.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/complex-reduction.c b/flang-rt/lib/flang_rt/complex-reduction.c similarity index 98% rename from FortranRuntime/lib/Runtime/complex-reduction.c rename to flang-rt/lib/flang_rt/complex-reduction.c index 138174e9122b1c..23f1edb58b2d4e 100644 --- a/FortranRuntime/lib/Runtime/complex-reduction.c +++ b/flang-rt/lib/flang_rt/complex-reduction.c @@ -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. diff --git a/FortranRuntime/lib/Runtime/complex-reduction.h b/flang-rt/lib/flang_rt/complex-reduction.h similarity index 97% rename from FortranRuntime/lib/Runtime/complex-reduction.h rename to flang-rt/lib/flang_rt/complex-reduction.h index e8e287215b7d97..b386b25cd0fff8 100644 --- a/FortranRuntime/lib/Runtime/complex-reduction.h +++ b/flang-rt/lib/flang_rt/complex-reduction.h @@ -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. @@ -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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/connection.cpp b/flang-rt/lib/flang_rt/connection.cpp similarity index 97% rename from FortranRuntime/lib/Runtime/connection.cpp rename to flang-rt/lib/flang_rt/connection.cpp index f9e91f1f193ba0..d623190f22f6f9 100644 --- a/FortranRuntime/lib/Runtime/connection.cpp +++ b/flang-rt/lib/flang_rt/connection.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/connection.h b/flang-rt/lib/flang_rt/connection.h similarity index 96% rename from FortranRuntime/lib/Runtime/connection.h rename to flang-rt/lib/flang_rt/connection.h index e078bfb9f0f7e7..f8b9b3f9debcda 100644 --- a/FortranRuntime/lib/Runtime/connection.h +++ b/flang-rt/lib/flang_rt/connection.h @@ -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. @@ -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" @@ -124,4 +124,4 @@ class SavedPosition { }; } // namespace Fortran::runtime::io -#endif /* FORTRAN_RUNTIME_CONNECTION_H_ */ +#endif /* FORTRAN_FLANG_RT_CONNECTION_H_ */ diff --git a/FortranRuntime/lib/Runtime/copy.cpp b/flang-rt/lib/flang_rt/copy.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/copy.cpp rename to flang-rt/lib/flang_rt/copy.cpp index 1049b925f68e5c..fc5c0af6b95851 100644 --- a/FortranRuntime/lib/Runtime/copy.cpp +++ b/flang-rt/lib/flang_rt/copy.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/copy.h b/flang-rt/lib/flang_rt/copy.h similarity index 78% rename from FortranRuntime/lib/Runtime/copy.h rename to flang-rt/lib/flang_rt/copy.h index 3d179d0bec91a7..8f27c3a90b7847 100644 --- a/FortranRuntime/lib/Runtime/copy.h +++ b/flang-rt/lib/flang_rt/copy.h @@ -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. @@ -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 { @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/derived-api.cpp b/flang-rt/lib/flang_rt/derived-api.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/derived-api.cpp rename to flang-rt/lib/flang_rt/derived-api.cpp index 176fc0849f25cf..faf24508981bae 100644 --- a/FortranRuntime/lib/Runtime/derived-api.cpp +++ b/flang-rt/lib/flang_rt/derived-api.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/derived.cpp b/flang-rt/lib/flang_rt/derived.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/derived.cpp rename to flang-rt/lib/flang_rt/derived.cpp index cb2dca24bb4758..9b17a0d437375c 100644 --- a/FortranRuntime/lib/Runtime/derived.cpp +++ b/flang-rt/lib/flang_rt/derived.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/derived.h b/flang-rt/lib/flang_rt/derived.h similarity index 88% rename from FortranRuntime/lib/Runtime/derived.h rename to flang-rt/lib/flang_rt/derived.h index e03e657f01cee9..3d6563f39c0663 100644 --- a/FortranRuntime/lib/Runtime/derived.h +++ b/flang-rt/lib/flang_rt/derived.h @@ -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. @@ -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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/descriptor-io.cpp b/flang-rt/lib/flang_rt/descriptor-io.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/descriptor-io.cpp rename to flang-rt/lib/flang_rt/descriptor-io.cpp index 896fad16a67e8a..c5cfa4d7fc5972 100644 --- a/FortranRuntime/lib/Runtime/descriptor-io.cpp +++ b/flang-rt/lib/flang_rt/descriptor-io.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/descriptor-io.h b/flang-rt/lib/flang_rt/descriptor-io.h similarity index 98% rename from FortranRuntime/lib/Runtime/descriptor-io.h rename to flang-rt/lib/flang_rt/descriptor-io.h index 30d1bd48457728..2e48b4a0353e2a 100644 --- a/FortranRuntime/lib/Runtime/descriptor-io.h +++ b/flang-rt/lib/flang_rt/descriptor-io.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,17 +6,17 @@ // //===----------------------------------------------------------------------===// -#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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/descriptor.cpp b/flang-rt/lib/flang_rt/descriptor.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/descriptor.cpp rename to flang-rt/lib/flang_rt/descriptor.cpp index 96fd48eb6687a9..77536e760ad1cd 100644 --- a/FortranRuntime/lib/Runtime/descriptor.cpp +++ b/flang-rt/lib/flang_rt/descriptor.cpp @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,10 +6,10 @@ // //===----------------------------------------------------------------------===// -#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" diff --git a/FortranRuntime/lib/Runtime/dot-product.cpp b/flang-rt/lib/flang_rt/dot-product.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/dot-product.cpp rename to flang-rt/lib/flang_rt/dot-product.cpp index 2992cbb1f39ad6..01e15ad331d7c4 100644 --- a/FortranRuntime/lib/Runtime/dot-product.cpp +++ b/flang-rt/lib/flang_rt/dot-product.cpp @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "float.h" #include "terminator.h" #include "tools.h" diff --git a/FortranRuntime/lib/Runtime/edit-input.cpp b/flang-rt/lib/flang_rt/edit-input.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/edit-input.cpp rename to flang-rt/lib/flang_rt/edit-input.cpp index 6ebb0e7aca4ade..9e3f102cf86684 100644 --- a/FortranRuntime/lib/Runtime/edit-input.cpp +++ b/flang-rt/lib/flang_rt/edit-input.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/edit-input.h b/flang-rt/lib/flang_rt/edit-input.h similarity index 90% rename from FortranRuntime/lib/Runtime/edit-input.h rename to flang-rt/lib/flang_rt/edit-input.h index f88f6daa47be79..59f601afa306a3 100644 --- a/FortranRuntime/lib/Runtime/edit-input.h +++ b/flang-rt/lib/flang_rt/edit-input.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/edit-output.cpp b/flang-rt/lib/flang_rt/edit-output.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/edit-output.cpp rename to flang-rt/lib/flang_rt/edit-output.cpp index ccaf8085f016fd..2e353f1ad80a21 100644 --- a/FortranRuntime/lib/Runtime/edit-output.cpp +++ b/flang-rt/lib/flang_rt/edit-output.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/edit-output.h b/flang-rt/lib/flang_rt/edit-output.h similarity index 96% rename from FortranRuntime/lib/Runtime/edit-output.h rename to flang-rt/lib/flang_rt/edit-output.h index 7e6c6cdedde3ac..325658b4a25dc6 100644 --- a/FortranRuntime/lib/Runtime/edit-output.h +++ b/flang-rt/lib/flang_rt/edit-output.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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 @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/emit-encoded.h b/flang-rt/lib/flang_rt/emit-encoded.h similarity index 94% rename from FortranRuntime/lib/Runtime/emit-encoded.h rename to flang-rt/lib/flang_rt/emit-encoded.h index 11163a41720795..87216e5808a286 100644 --- a/FortranRuntime/lib/Runtime/emit-encoded.h +++ b/flang-rt/lib/flang_rt/emit-encoded.h @@ -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. @@ -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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/environment-default-list.h b/flang-rt/lib/flang_rt/environment-default-list.h similarity index 100% rename from FortranRuntime/lib/Runtime/environment-default-list.h rename to flang-rt/lib/flang_rt/environment-default-list.h diff --git a/FortranRuntime/lib/Runtime/environment.cpp b/flang-rt/lib/flang_rt/environment.cpp similarity index 96% rename from FortranRuntime/lib/Runtime/environment.cpp rename to flang-rt/lib/flang_rt/environment.cpp index 272914877988a5..a9447815efeeaf 100644 --- a/FortranRuntime/lib/Runtime/environment.cpp +++ b/flang-rt/lib/flang_rt/environment.cpp @@ -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. @@ -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) { diff --git a/FortranRuntime/lib/Runtime/environment.h b/flang-rt/lib/flang_rt/environment.h similarity index 91% rename from FortranRuntime/lib/Runtime/environment.h rename to flang-rt/lib/flang_rt/environment.h index 7d10b3a2b934bf..125c9b39528b94 100644 --- a/FortranRuntime/lib/Runtime/environment.h +++ b/flang-rt/lib/flang_rt/environment.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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" @@ -64,4 +64,4 @@ RT_OFFLOAD_VAR_GROUP_END } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_ENVIRONMENT_H_ */ +#endif /* FORTRAN_FLANG_RT_ENVIRONMENT_H_ */ diff --git a/FortranRuntime/lib/Runtime/exceptions.cpp b/flang-rt/lib/flang_rt/exceptions.cpp similarity index 97% rename from FortranRuntime/lib/Runtime/exceptions.cpp rename to flang-rt/lib/flang_rt/exceptions.cpp index 7739130ae2346a..9ad5fe6849b076 100644 --- a/FortranRuntime/lib/Runtime/exceptions.cpp +++ b/flang-rt/lib/flang_rt/exceptions.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/execute.cpp b/flang-rt/lib/flang_rt/execute.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/execute.cpp rename to flang-rt/lib/flang_rt/execute.cpp index b333c61c8a59f4..d3d42a49737fed 100644 --- a/FortranRuntime/lib/Runtime/execute.cpp +++ b/flang-rt/lib/flang_rt/execute.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/extensions.cpp b/flang-rt/lib/flang_rt/extensions.cpp similarity index 97% rename from FortranRuntime/lib/Runtime/extensions.cpp rename to flang-rt/lib/flang_rt/extensions.cpp index bb25fe6ee9d886..4cd9791cd0e5cb 100644 --- a/FortranRuntime/lib/Runtime/extensions.cpp +++ b/flang-rt/lib/flang_rt/extensions.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/external-unit.cpp b/flang-rt/lib/flang_rt/external-unit.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/external-unit.cpp rename to flang-rt/lib/flang_rt/external-unit.cpp index f5fa2c31dafc4e..1942cc1ff4daec 100644 --- a/FortranRuntime/lib/Runtime/external-unit.cpp +++ b/flang-rt/lib/flang_rt/external-unit.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/extrema.cpp b/flang-rt/lib/flang_rt/extrema.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/extrema.cpp rename to flang-rt/lib/flang_rt/extrema.cpp index be9da63d7bd6b8..7a230afc4190c6 100644 --- a/FortranRuntime/lib/Runtime/extrema.cpp +++ b/flang-rt/lib/flang_rt/extrema.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/file.cpp b/flang-rt/lib/flang_rt/file.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/file.cpp rename to flang-rt/lib/flang_rt/file.cpp index de52dafd12df9a..d98c8afeca3514 100644 --- a/FortranRuntime/lib/Runtime/file.cpp +++ b/flang-rt/lib/flang_rt/file.cpp @@ -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. @@ -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 diff --git a/FortranRuntime/lib/Runtime/file.h b/flang-rt/lib/flang_rt/file.h similarity index 94% rename from FortranRuntime/lib/Runtime/file.h rename to flang-rt/lib/flang_rt/file.h index 60ddf2a2741610..b4068e3dce0d14 100644 --- a/FortranRuntime/lib/Runtime/file.h +++ b/flang-rt/lib/flang_rt/file.h @@ -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. @@ -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 @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/findloc.cpp b/flang-rt/lib/flang_rt/findloc.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/findloc.cpp rename to flang-rt/lib/flang_rt/findloc.cpp index da5fe0c0a0a467..8ee4c7c6cf7800 100644 --- a/FortranRuntime/lib/Runtime/findloc.cpp +++ b/flang-rt/lib/flang_rt/findloc.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/format-implementation.h b/flang-rt/lib/flang_rt/format-implementation.h similarity index 98% rename from FortranRuntime/lib/Runtime/format-implementation.h rename to flang-rt/lib/flang_rt/format-implementation.h index f17f0a2cb4bfd9..9b7ad6f2ce1fc6 100644 --- a/FortranRuntime/lib/Runtime/format-implementation.h +++ b/flang-rt/lib/flang_rt/format-implementation.h @@ -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. @@ -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" @@ -601,4 +601,4 @@ RT_API_ATTRS void FormatControl::Finish(Context &context) { } } } // namespace Fortran::runtime::io -#endif /* FORTRAN_RUNTIME_FORMAT_IMPLEMENTATION_H_ */ +#endif /* FORTRAN_FLANG_RT_FORMAT_IMPLEMENTATION_H_ */ diff --git a/FortranRuntime/lib/Runtime/format.cpp b/flang-rt/lib/flang_rt/format.cpp similarity index 93% rename from FortranRuntime/lib/Runtime/format.cpp rename to flang-rt/lib/flang_rt/format.cpp index 73a61f785c23b8..aedf04b8a40a1b 100644 --- a/FortranRuntime/lib/Runtime/format.cpp +++ b/flang-rt/lib/flang_rt/format.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/format.h b/flang-rt/lib/flang_rt/format.h similarity index 97% rename from FortranRuntime/lib/Runtime/format.h rename to flang-rt/lib/flang_rt/format.h index 098a251a04d568..b41eec9564baaa 100644 --- a/FortranRuntime/lib/Runtime/format.h +++ b/flang-rt/lib/flang_rt/format.h @@ -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. @@ -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" @@ -201,4 +201,4 @@ template class FormatControl { Iteration stack_[maxMaxHeight]; }; } // namespace Fortran::runtime::io -#endif /* FORTRAN_RUNTIME_FORMAT_H_ */ +#endif /* FORTRAN_FLANG_RT_FORMAT_H_ */ diff --git a/FortranRuntime/lib/Runtime/inquiry.cpp b/flang-rt/lib/flang_rt/inquiry.cpp similarity index 96% rename from FortranRuntime/lib/Runtime/inquiry.cpp rename to flang-rt/lib/flang_rt/inquiry.cpp index c24492754b4f43..b29ab4ee3c6663 100644 --- a/FortranRuntime/lib/Runtime/inquiry.cpp +++ b/flang-rt/lib/flang_rt/inquiry.cpp @@ -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. @@ -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 diff --git a/FortranRuntime/lib/Runtime/internal-unit.cpp b/flang-rt/lib/flang_rt/internal-unit.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/internal-unit.cpp rename to flang-rt/lib/flang_rt/internal-unit.cpp index 4494de9dddc1a1..7775ded1e86d57 100644 --- a/FortranRuntime/lib/Runtime/internal-unit.cpp +++ b/flang-rt/lib/flang_rt/internal-unit.cpp @@ -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. @@ -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 diff --git a/FortranRuntime/lib/Runtime/internal-unit.h b/flang-rt/lib/flang_rt/internal-unit.h similarity index 89% rename from FortranRuntime/lib/Runtime/internal-unit.h rename to flang-rt/lib/flang_rt/internal-unit.h index 7579016f14646d..2f7d0220b84b37 100644 --- a/FortranRuntime/lib/Runtime/internal-unit.h +++ b/flang-rt/lib/flang_rt/internal-unit.h @@ -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. @@ -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 #include @@ -56,4 +56,4 @@ template class InternalDescriptorUnit : public ConnectionState { extern template class InternalDescriptorUnit; extern template class InternalDescriptorUnit; } // namespace Fortran::runtime::io -#endif /* FORTRAN_RUNTIME_INTERNAL_UNIT_H_ */ +#endif /* FORTRAN_FLANG_RT_INTERNAL_UNIT_H_ */ diff --git a/FortranRuntime/lib/Runtime/io-api-common.h b/flang-rt/lib/flang_rt/io-api-common.h similarity index 92% rename from FortranRuntime/lib/Runtime/io-api-common.h rename to flang-rt/lib/flang_rt/io-api-common.h index fed1d11d6ce6a6..5ff1b57c73cda6 100644 --- a/FortranRuntime/lib/Runtime/io-api-common.h +++ b/flang-rt/lib/flang_rt/io-api-common.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,10 +6,10 @@ // //===----------------------------------------------------------------------===// -#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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/io-api-minimal.cpp b/flang-rt/lib/flang_rt/io-api-minimal.cpp similarity index 97% rename from FortranRuntime/lib/Runtime/io-api-minimal.cpp rename to flang-rt/lib/flang_rt/io-api-minimal.cpp index 8cde2333804572..92524430650126 100644 --- a/FortranRuntime/lib/Runtime/io-api-minimal.cpp +++ b/flang-rt/lib/flang_rt/io-api-minimal.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/io-api.cpp b/flang-rt/lib/flang_rt/io-api.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/io-api.cpp rename to flang-rt/lib/flang_rt/io-api.cpp index fa95d68a004b51..0de1e24f71dac5 100644 --- a/FortranRuntime/lib/Runtime/io-api.cpp +++ b/flang-rt/lib/flang_rt/io-api.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/io-error.cpp b/flang-rt/lib/flang_rt/io-error.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/io-error.cpp rename to flang-rt/lib/flang_rt/io-error.cpp index 053667462058de..215c839d98cc35 100644 --- a/FortranRuntime/lib/Runtime/io-error.cpp +++ b/flang-rt/lib/flang_rt/io-error.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/io-error.h b/flang-rt/lib/flang_rt/io-error.h similarity index 90% rename from FortranRuntime/lib/Runtime/io-error.h rename to flang-rt/lib/flang_rt/io-error.h index e2018cc2ea0ab1..7798d0830a1323 100644 --- a/FortranRuntime/lib/Runtime/io-error.h +++ b/flang-rt/lib/flang_rt/io-error.h @@ -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. @@ -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 @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/io-stmt.cpp b/flang-rt/lib/flang_rt/io-stmt.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/io-stmt.cpp rename to flang-rt/lib/flang_rt/io-stmt.cpp index fe02e221671665..7c243a8c934a7a 100644 --- a/FortranRuntime/lib/Runtime/io-stmt.cpp +++ b/flang-rt/lib/flang_rt/io-stmt.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/io-stmt.h b/flang-rt/lib/flang_rt/io-stmt.h similarity index 99% rename from FortranRuntime/lib/Runtime/io-stmt.h rename to flang-rt/lib/flang_rt/io-stmt.h index 21746ff1966218..78bc42502be687 100644 --- a/FortranRuntime/lib/Runtime/io-stmt.h +++ b/flang-rt/lib/flang_rt/io-stmt.h @@ -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. @@ -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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/iostat.cpp b/flang-rt/lib/flang_rt/iostat.cpp similarity index 97% rename from FortranRuntime/lib/Runtime/iostat.cpp rename to flang-rt/lib/flang_rt/iostat.cpp index 8d769a09252fd6..39f4474dcf7229 100644 --- a/FortranRuntime/lib/Runtime/iostat.cpp +++ b/flang-rt/lib/flang_rt/iostat.cpp @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/iostat-funcs.h" +#include "flang-rt/flang_rt/iostat-funcs.h" namespace Fortran::runtime::io { RT_OFFLOAD_API_GROUP_BEGIN diff --git a/FortranRuntime/lib/Runtime/lock.h b/flang-rt/lib/flang_rt/lock.h similarity index 94% rename from FortranRuntime/lib/Runtime/lock.h rename to flang-rt/lib/flang_rt/lock.h index 69ff6403736dae..955059a711c47d 100644 --- a/FortranRuntime/lib/Runtime/lock.h +++ b/flang-rt/lib/flang_rt/lock.h @@ -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. @@ -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" @@ -113,4 +113,4 @@ class CriticalSection { }; } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_LOCK_H_ */ +#endif /* FORTRAN_FLANG_RT_LOCK_H_ */ diff --git a/FortranRuntime/lib/Runtime/main.cpp b/flang-rt/lib/flang_rt/main.cpp similarity index 95% rename from FortranRuntime/lib/Runtime/main.cpp rename to flang-rt/lib/flang_rt/main.cpp index 3fe985e524548d..71ed7f8319f60f 100644 --- a/FortranRuntime/lib/Runtime/main.cpp +++ b/flang-rt/lib/flang_rt/main.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/matmul-transpose.cpp b/flang-rt/lib/flang_rt/matmul-transpose.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/matmul-transpose.cpp rename to flang-rt/lib/flang_rt/matmul-transpose.cpp index ec5388e3fca793..2c7c4a89117f04 100644 --- a/FortranRuntime/lib/Runtime/matmul-transpose.cpp +++ b/flang-rt/lib/flang_rt/matmul-transpose.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/matmul.cpp b/flang-rt/lib/flang_rt/matmul.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/matmul.cpp rename to flang-rt/lib/flang_rt/matmul.cpp index 01be7f7c75bc45..8157911f34fd38 100644 --- a/FortranRuntime/lib/Runtime/matmul.cpp +++ b/flang-rt/lib/flang_rt/matmul.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/memory.cpp b/flang-rt/lib/flang_rt/memory.cpp similarity index 92% rename from FortranRuntime/lib/Runtime/memory.cpp rename to flang-rt/lib/flang_rt/memory.cpp index a4cebf7edc6c64..66aa5be0cddc60 100644 --- a/FortranRuntime/lib/Runtime/memory.cpp +++ b/flang-rt/lib/flang_rt/memory.cpp @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/memory.h" +#include "flang-rt/flang_rt/memory.h" #include "terminator.h" #include "tools.h" #include "flang/Runtime/freestanding-tools.h" diff --git a/FortranRuntime/lib/Runtime/misc-intrinsic.cpp b/flang-rt/lib/flang_rt/misc-intrinsic.cpp similarity index 97% rename from FortranRuntime/lib/Runtime/misc-intrinsic.cpp rename to flang-rt/lib/flang_rt/misc-intrinsic.cpp index 91a3b136e009a5..00098c5b4e20b0 100644 --- a/FortranRuntime/lib/Runtime/misc-intrinsic.cpp +++ b/flang-rt/lib/flang_rt/misc-intrinsic.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/namelist.cpp b/flang-rt/lib/flang_rt/namelist.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/namelist.cpp rename to flang-rt/lib/flang_rt/namelist.cpp index 46036549bcd316..92dbd33b7f9609 100644 --- a/FortranRuntime/lib/Runtime/namelist.cpp +++ b/flang-rt/lib/flang_rt/namelist.cpp @@ -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. @@ -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 #include diff --git a/FortranRuntime/lib/Runtime/namelist.h b/flang-rt/lib/flang_rt/namelist.h similarity index 91% rename from FortranRuntime/lib/Runtime/namelist.h rename to flang-rt/lib/flang_rt/namelist.h index 04432f8a08cb97..519ec5dd2ddbc5 100644 --- a/FortranRuntime/lib/Runtime/namelist.h +++ b/flang-rt/lib/flang_rt/namelist.h @@ -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. @@ -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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/non-tbp-dio.cpp b/flang-rt/lib/flang_rt/non-tbp-dio.cpp similarity index 93% rename from FortranRuntime/lib/Runtime/non-tbp-dio.cpp rename to flang-rt/lib/flang_rt/non-tbp-dio.cpp index 9fa04397bc9610..3aade68cbb6d3e 100644 --- a/FortranRuntime/lib/Runtime/non-tbp-dio.cpp +++ b/flang-rt/lib/flang_rt/non-tbp-dio.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/non-tbp-dio.h b/flang-rt/lib/flang_rt/non-tbp-dio.h similarity index 91% rename from FortranRuntime/lib/Runtime/non-tbp-dio.h rename to flang-rt/lib/flang_rt/non-tbp-dio.h index 426d5a92fd37d4..dfc96603a8eb1c 100644 --- a/FortranRuntime/lib/Runtime/non-tbp-dio.h +++ b/flang-rt/lib/flang_rt/non-tbp-dio.h @@ -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. @@ -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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/numeric-templates.h b/flang-rt/lib/flang_rt/numeric-templates.h similarity index 98% rename from FortranRuntime/lib/Runtime/numeric-templates.h rename to flang-rt/lib/flang_rt/numeric-templates.h index 159b8b0b9579ad..0471b89f9153ad 100644 --- a/FortranRuntime/lib/Runtime/numeric-templates.h +++ b/flang-rt/lib/flang_rt/numeric-templates.h @@ -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. @@ -15,8 +15,8 @@ // for the data type corresponding to CppTypeFor // 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" @@ -465,4 +465,4 @@ template inline RT_API_ATTRS T ErfcScaled(T arg) { } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_NUMERIC_TEMPLATES_H_ */ +#endif /* FORTRAN_FLANG_RT_NUMERIC_TEMPLATES_H_ */ diff --git a/FortranRuntime/lib/Runtime/numeric.cpp b/flang-rt/lib/flang_rt/numeric.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/numeric.cpp rename to flang-rt/lib/flang_rt/numeric.cpp index b0f68a7fc81d29..4c2c0394ede188 100644 --- a/FortranRuntime/lib/Runtime/numeric.cpp +++ b/flang-rt/lib/flang_rt/numeric.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/pointer.cpp b/flang-rt/lib/flang_rt/pointer.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/pointer.cpp rename to flang-rt/lib/flang_rt/pointer.cpp index fba9e639fa37a8..7479cd780709fa 100644 --- a/FortranRuntime/lib/Runtime/pointer.cpp +++ b/flang-rt/lib/flang_rt/pointer.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/product.cpp b/flang-rt/lib/flang_rt/product.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/product.cpp rename to flang-rt/lib/flang_rt/product.cpp index e4a6e81bd0c508..cd0c4e9440ceb3 100644 --- a/FortranRuntime/lib/Runtime/product.cpp +++ b/flang-rt/lib/flang_rt/product.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/pseudo-unit.cpp b/flang-rt/lib/flang_rt/pseudo-unit.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/pseudo-unit.cpp rename to flang-rt/lib/flang_rt/pseudo-unit.cpp index 62c6b1df5071c7..9ce39ca9307c9c 100644 --- a/FortranRuntime/lib/Runtime/pseudo-unit.cpp +++ b/flang-rt/lib/flang_rt/pseudo-unit.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/ragged.cpp b/flang-rt/lib/flang_rt/ragged.cpp similarity index 97% rename from FortranRuntime/lib/Runtime/ragged.cpp rename to flang-rt/lib/flang_rt/ragged.cpp index 681a800e29dca7..df6469e9c5ba27 100644 --- a/FortranRuntime/lib/Runtime/ragged.cpp +++ b/flang-rt/lib/flang_rt/ragged.cpp @@ -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. diff --git a/FortranRuntime/lib/Runtime/random-templates.h b/flang-rt/lib/flang_rt/random-templates.h similarity index 91% rename from FortranRuntime/lib/Runtime/random-templates.h rename to flang-rt/lib/flang_rt/random-templates.h index 9faa9c7cfa7002..475c972a823226 100644 --- a/FortranRuntime/lib/Runtime/random-templates.h +++ b/flang-rt/lib/flang_rt/random-templates.h @@ -1,4 +1,4 @@ -//===-- 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. @@ -6,10 +6,10 @@ // //===----------------------------------------------------------------------===// -#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" @@ -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_ */ diff --git a/FortranRuntime/lib/Runtime/random.cpp b/flang-rt/lib/flang_rt/random.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/random.cpp rename to flang-rt/lib/flang_rt/random.cpp index 911b59b508eb4f..9922ae87b084a8 100644 --- a/FortranRuntime/lib/Runtime/random.cpp +++ b/flang-rt/lib/flang_rt/random.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/reduce.cpp b/flang-rt/lib/flang_rt/reduce.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/reduce.cpp rename to flang-rt/lib/flang_rt/reduce.cpp index a020ffef6fe6a5..6997d4c63065b9 100644 --- a/FortranRuntime/lib/Runtime/reduce.cpp +++ b/flang-rt/lib/flang_rt/reduce.cpp @@ -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. @@ -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" diff --git a/FortranRuntime/lib/Runtime/reduction-templates.h b/flang-rt/lib/flang_rt/reduction-templates.h similarity index 98% rename from FortranRuntime/lib/Runtime/reduction-templates.h rename to flang-rt/lib/flang_rt/reduction-templates.h index 714584ec613ba3..774b6f3c99850f 100644 --- a/FortranRuntime/lib/Runtime/reduction-templates.h +++ b/flang-rt/lib/flang_rt/reduction-templates.h @@ -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. @@ -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" @@ -412,4 +412,4 @@ template struct Norm2Helper { }; } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_REDUCTION_TEMPLATES_H_ */ +#endif /* FORTRAN_FLANG_RT_REDUCTION_TEMPLATES_H_ */ diff --git a/FortranRuntime/lib/Runtime/reduction.cpp b/flang-rt/lib/flang_rt/reduction.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/reduction.cpp rename to flang-rt/lib/flang_rt/reduction.cpp index 21930fee07ead7..f9d5f442e8928f 100644 --- a/FortranRuntime/lib/Runtime/reduction.cpp +++ b/flang-rt/lib/flang_rt/reduction.cpp @@ -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. @@ -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 diff --git a/FortranRuntime/lib/Runtime/stack.h b/flang-rt/lib/flang_rt/stack.h similarity index 94% rename from FortranRuntime/lib/Runtime/stack.h rename to flang-rt/lib/flang_rt/stack.h index 36e2d0a103a887..4c1ab4e85ed71f 100644 --- a/FortranRuntime/lib/Runtime/stack.h +++ b/flang-rt/lib/flang_rt/stack.h @@ -1,4 +1,4 @@ -//===-- lib/Runtime/stack.h -------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/stack.h ------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -10,10 +10,10 @@ // It is a list based stack with dynamic allocation/deallocation // of the list nodes. -#ifndef FORTRAN_RUNTIME_STACK_H_ -#define FORTRAN_RUNTIME_STACK_H_ +#ifndef FORTRAN_FLANG_RT_STACK_H_ +#define FORTRAN_FLANG_RT_STACK_H_ -#include "FortranRuntime/Runtime/memory.h" +#include "flang-rt/flang_rt/memory.h" #include "terminator.h" namespace Fortran::runtime { @@ -133,4 +133,4 @@ template class Stack : public StackStorage { Terminator &terminator_; }; } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_STACK_H_ */ +#endif /* FORTRAN_FLANG_RT_STACK_H_ */ diff --git a/FortranRuntime/lib/Runtime/stat.cpp b/flang-rt/lib/flang_rt/stat.cpp similarity index 96% rename from FortranRuntime/lib/Runtime/stat.cpp rename to flang-rt/lib/flang_rt/stat.cpp index 1af6c43102518b..77eefe3d1ac518 100644 --- a/FortranRuntime/lib/Runtime/stat.cpp +++ b/flang-rt/lib/flang_rt/stat.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/stat.cpp ------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/stat.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. @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "stat.h" -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "terminator.h" #include "tools.h" diff --git a/FortranRuntime/lib/Runtime/stat.h b/flang-rt/lib/flang_rt/stat.h similarity index 93% rename from FortranRuntime/lib/Runtime/stat.h rename to flang-rt/lib/flang_rt/stat.h index eccd69024d726b..dbab381001d7d8 100644 --- a/FortranRuntime/lib/Runtime/stat.h +++ b/flang-rt/lib/flang_rt/stat.h @@ -1,4 +1,4 @@ -//===-- lib/Runtime/stat.h --------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/stat.h -------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -9,8 +9,8 @@ // Defines the values returned by the runtime for STAT= specifiers // on executable statements. -#ifndef FORTRAN_RUNTIME_STAT_H_ -#define FORTRAN_RUNTIME_STAT_H_ +#ifndef FORTRAN_FLANG_RT_STAT_H_ +#define FORTRAN_FLANG_RT_STAT_H_ #include "flang/Common/ISO_Fortran_binding_wrapper.h" #include "flang/Common/api-attrs.h" #include "flang/Runtime/magic-numbers.h" @@ -60,4 +60,4 @@ RT_API_ATTRS int ToErrmsg(const Descriptor *errmsg, int stat); // returns stat RT_API_ATTRS int ReturnError(Terminator &, int stat, const Descriptor *errmsg = nullptr, bool hasStat = false); } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_STAT_H_ */ +#endif /* FORTRAN_FLANG_RT_STAT_H_ */ diff --git a/FortranRuntime/lib/Runtime/stop.cpp b/flang-rt/lib/flang_rt/stop.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/stop.cpp rename to flang-rt/lib/flang_rt/stop.cpp index 8465a53168e551..ea50d1ba4747ff 100644 --- a/FortranRuntime/lib/Runtime/stop.cpp +++ b/flang-rt/lib/flang_rt/stop.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/stop.cpp ------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/stop.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. diff --git a/FortranRuntime/lib/Runtime/sum.cpp b/flang-rt/lib/flang_rt/sum.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/sum.cpp rename to flang-rt/lib/flang_rt/sum.cpp index 64982b9fd53690..3c225efe8a2788 100644 --- a/FortranRuntime/lib/Runtime/sum.cpp +++ b/flang-rt/lib/flang_rt/sum.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/sum.cpp -------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/sum.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. diff --git a/FortranRuntime/lib/Runtime/support.cpp b/flang-rt/lib/flang_rt/support.cpp similarity index 93% rename from FortranRuntime/lib/Runtime/support.cpp rename to flang-rt/lib/flang_rt/support.cpp index 798d502ba248e2..436ae6f87ae692 100644 --- a/FortranRuntime/lib/Runtime/support.cpp +++ b/flang-rt/lib/flang_rt/support.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/support.cpp ---------------------------------*- C++ -*-===// +//===-- lib/flang_rt/support.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. @@ -7,8 +7,8 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/support.h" -#include "FortranRuntime/Runtime/descriptor.h" #include "ISO_Fortran_util.h" +#include "flang-rt/flang_rt/descriptor.h" #include "type-info.h" namespace Fortran::runtime { diff --git a/FortranRuntime/lib/Runtime/temporary-stack.cpp b/flang-rt/lib/flang_rt/temporary-stack.cpp similarity index 97% rename from FortranRuntime/lib/Runtime/temporary-stack.cpp rename to flang-rt/lib/flang_rt/temporary-stack.cpp index d8ff08e51cc211..f566e6d8a086ff 100644 --- a/FortranRuntime/lib/Runtime/temporary-stack.cpp +++ b/flang-rt/lib/flang_rt/temporary-stack.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/temporary-stack.cpp -------------------------*- C++ -*-===// +//===-- lib/flang_rt/temporary-stack.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. @@ -10,8 +10,8 @@ // temporaries. For use in HLFIR lowering. #include "flang/Runtime/temporary-stack.h" -#include "FortranRuntime/Runtime/descriptor.h" -#include "FortranRuntime/Runtime/memory.h" +#include "flang-rt/flang_rt/descriptor.h" +#include "flang-rt/flang_rt/memory.h" #include "terminator.h" #include "flang/Common/ISO_Fortran_binding_wrapper.h" #include "flang/Runtime/assign.h" diff --git a/FortranRuntime/lib/Runtime/terminator.cpp b/flang-rt/lib/flang_rt/terminator.cpp similarity index 97% rename from FortranRuntime/lib/Runtime/terminator.cpp rename to flang-rt/lib/flang_rt/terminator.cpp index 4146e28235511f..2e8d895a9025a6 100644 --- a/FortranRuntime/lib/Runtime/terminator.cpp +++ b/flang-rt/lib/flang_rt/terminator.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/terminator.cpp ------------------------------*- C++ -*-===// +//===-- lib/flang_rt/terminator.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. diff --git a/FortranRuntime/lib/Runtime/terminator.h b/flang-rt/lib/flang_rt/terminator.h similarity index 95% rename from FortranRuntime/lib/Runtime/terminator.h rename to flang-rt/lib/flang_rt/terminator.h index f475658b0eab3d..61c6452a282d12 100644 --- a/FortranRuntime/lib/Runtime/terminator.h +++ b/flang-rt/lib/flang_rt/terminator.h @@ -1,4 +1,4 @@ -//===-- lib/Runtime/terminator.h --------------------------------*- C++ -*-===// +//===-- lib/flang_rt/terminator.h -------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -8,8 +8,8 @@ // Termination of the image -#ifndef FORTRAN_RUNTIME_TERMINATOR_H_ -#define FORTRAN_RUNTIME_TERMINATOR_H_ +#ifndef FORTRAN_FLANG_RT_TERMINATOR_H_ +#define FORTRAN_FLANG_RT_TERMINATOR_H_ #include "flang/Common/api-attrs.h" #include @@ -121,4 +121,4 @@ namespace Fortran::runtime::io { RT_API_ATTRS void FlushOutputOnCrash(const Terminator &); } -#endif /* FORTRAN_RUNTIME_TERMINATOR_H_ */ +#endif /* FORTRAN_FLANG_RT_TERMINATOR_H_ */ diff --git a/FortranRuntime/lib/Runtime/time-intrinsic.cpp b/flang-rt/lib/flang_rt/time-intrinsic.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/time-intrinsic.cpp rename to flang-rt/lib/flang_rt/time-intrinsic.cpp index 15c42077c0afd5..6e2befbc30e9fa 100644 --- a/FortranRuntime/lib/Runtime/time-intrinsic.cpp +++ b/flang-rt/lib/flang_rt/time-intrinsic.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/time-intrinsic.cpp --------------------------*- C++ -*-===// +//===-- lib/flang_rt/time-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. @@ -9,7 +9,7 @@ // Implements time-related intrinsic subroutines. #include "flang/Runtime/time-intrinsic.h" -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "terminator.h" #include "tools.h" #include "flang/Runtime/cpp-type.h" @@ -62,7 +62,7 @@ template double GetCpuTime(fallback_implementation) { #if defined __MINGW32__ // clock_gettime is implemented in the pthread library for MinGW. -// Using it here would mean that all programs that link libFortranRuntime are +// Using it here would mean that all programs that link libflang_rt are // required to also link to pthread. Instead, don't use the function. #undef CLOCKID_CPU_TIME #undef CLOCKID_ELAPSED_TIME diff --git a/FortranRuntime/lib/Runtime/tools.cpp b/flang-rt/lib/flang_rt/tools.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/tools.cpp rename to flang-rt/lib/flang_rt/tools.cpp index d5c113a31fc501..228b781b207ddd 100644 --- a/FortranRuntime/lib/Runtime/tools.cpp +++ b/flang-rt/lib/flang_rt/tools.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/tools.cpp -----------------------------------*- C++ -*-===// +//===-- lib/flang_rt/tools.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. diff --git a/FortranRuntime/lib/Runtime/tools.h b/flang-rt/lib/flang_rt/tools.h similarity index 98% rename from FortranRuntime/lib/Runtime/tools.h rename to flang-rt/lib/flang_rt/tools.h index 332ffac77f2595..9880d0e93f5a82 100644 --- a/FortranRuntime/lib/Runtime/tools.h +++ b/flang-rt/lib/flang_rt/tools.h @@ -1,4 +1,4 @@ -//===-- lib/Runtime/tools.h -------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/tools.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. @@ -6,11 +6,11 @@ // //===----------------------------------------------------------------------===// -#ifndef FORTRAN_RUNTIME_TOOLS_H_ -#define FORTRAN_RUNTIME_TOOLS_H_ +#ifndef FORTRAN_FLANG_RT_TOOLS_H_ +#define FORTRAN_FLANG_RT_TOOLS_H_ -#include "FortranRuntime/Runtime/descriptor.h" -#include "FortranRuntime/Runtime/memory.h" +#include "flang-rt/flang_rt/descriptor.h" +#include "flang-rt/flang_rt/memory.h" #include "stat.h" #include "terminator.h" #include "flang/Common/optional.h" @@ -535,4 +535,4 @@ RT_API_ATTRS void CreatePartialReductionResult(Descriptor &result, const char *intrinsic, TypeCode); } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_TOOLS_H_ */ +#endif /* FORTRAN_FLANG_RT_TOOLS_H_ */ diff --git a/FortranRuntime/lib/Runtime/transformational.cpp b/flang-rt/lib/flang_rt/transformational.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/transformational.cpp rename to flang-rt/lib/flang_rt/transformational.cpp index 28dd02a28036de..f21c63fbfd7a1b 100644 --- a/FortranRuntime/lib/Runtime/transformational.cpp +++ b/flang-rt/lib/flang_rt/transformational.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/transformational.cpp ------------------------*- C++ -*-===// +//===-- lib/flang_rt/transformational.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. @@ -17,8 +17,8 @@ // of the standard but it more likely to conform with its intent. #include "flang/Runtime/transformational.h" -#include "FortranRuntime/Runtime/descriptor.h" #include "copy.h" +#include "flang-rt/flang_rt/descriptor.h" #include "terminator.h" #include "tools.h" #include "flang/Common/float128.h" diff --git a/FortranRuntime/lib/Runtime/type-code.cpp b/flang-rt/lib/flang_rt/type-code.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/type-code.cpp rename to flang-rt/lib/flang_rt/type-code.cpp index 16f5497bc7a709..96fabf7ec7698f 100644 --- a/FortranRuntime/lib/Runtime/type-code.cpp +++ b/flang-rt/lib/flang_rt/type-code.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/type-code.cpp -------------------------------*- C++ -*-===// +//===-- lib/flang_rt/type-code.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. @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/type-code.h" +#include "flang-rt/flang_rt/type-code.h" #include namespace Fortran::runtime { diff --git a/FortranRuntime/lib/Runtime/type-info.cpp b/flang-rt/lib/flang_rt/type-info.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/type-info.cpp rename to flang-rt/lib/flang_rt/type-info.cpp index 19e9211fc063f4..031721833ddebc 100644 --- a/FortranRuntime/lib/Runtime/type-info.cpp +++ b/flang-rt/lib/flang_rt/type-info.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/type-info.cpp -------------------------------*- C++ -*-===// +//===-- lib/flang_rt/type-info.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. diff --git a/FortranRuntime/lib/Runtime/type-info.h b/flang-rt/lib/flang_rt/type-info.h similarity index 98% rename from FortranRuntime/lib/Runtime/type-info.h rename to flang-rt/lib/flang_rt/type-info.h index 150942547c2ee8..3b0b193d63379c 100644 --- a/FortranRuntime/lib/Runtime/type-info.h +++ b/flang-rt/lib/flang_rt/type-info.h @@ -1,4 +1,4 @@ -//===-- lib/Runtime/type-info.h ---------------------------------*- C++ -*-===// +//===-- lib/flang_rt/type-info.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. @@ -6,13 +6,13 @@ // //===----------------------------------------------------------------------===// -#ifndef FORTRAN_RUNTIME_TYPE_INFO_H_ -#define FORTRAN_RUNTIME_TYPE_INFO_H_ +#ifndef FORTRAN_FLANG_RT_TYPE_INFO_H_ +#define FORTRAN_FLANG_RT_TYPE_INFO_H_ // A C++ perspective of the derived type description schemata in // flang/module/__fortran_type_info.f90. -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "terminator.h" #include "flang/Common/Fortran-consts.h" #include "flang/Common/bit-population-count.h" @@ -321,4 +321,4 @@ class DerivedType { }; } // namespace Fortran::runtime::typeInfo -#endif /* FORTRAN_RUNTIME_TYPE_INFO_H_ */ +#endif /* FORTRAN_FLANG_RT_TYPE_INFO_H_ */ diff --git a/FortranRuntime/lib/Runtime/unit-map.cpp b/flang-rt/lib/flang_rt/unit-map.cpp similarity index 98% rename from FortranRuntime/lib/Runtime/unit-map.cpp rename to flang-rt/lib/flang_rt/unit-map.cpp index 93958be8df7ea5..0fda53ac071b27 100644 --- a/FortranRuntime/lib/Runtime/unit-map.cpp +++ b/flang-rt/lib/flang_rt/unit-map.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/unit-map.cpp --------------------------------*- C++ -*-===// +//===-- lib/flang_rt/unit-map.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. diff --git a/FortranRuntime/lib/Runtime/unit-map.h b/flang-rt/lib/flang_rt/unit-map.h similarity index 93% rename from FortranRuntime/lib/Runtime/unit-map.h rename to flang-rt/lib/flang_rt/unit-map.h index f37e2df7f3b15a..7215a5677f006b 100644 --- a/FortranRuntime/lib/Runtime/unit-map.h +++ b/flang-rt/lib/flang_rt/unit-map.h @@ -1,4 +1,4 @@ -//===-- lib/Runtime/unit-map.h ----------------------------------*- C++ -*-===// +//===-- lib/flang_rt/unit-map.h ---------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -9,10 +9,10 @@ // Maps Fortran unit numbers to their ExternalFileUnit instances. // A simple hash table with forward-linked chains per bucket. -#ifndef FORTRAN_RUNTIME_UNIT_MAP_H_ -#define FORTRAN_RUNTIME_UNIT_MAP_H_ +#ifndef FORTRAN_FLANG_RT_UNIT_MAP_H_ +#define FORTRAN_FLANG_RT_UNIT_MAP_H_ -#include "FortranRuntime/Runtime/memory.h" +#include "flang-rt/flang_rt/memory.h" #include "lock.h" #include "unit.h" #include "flang/Common/fast-int-set.h" @@ -100,4 +100,4 @@ class UnitMap { int emergencyNewUnit_{maxNewUnits_}; // not recycled }; } // namespace Fortran::runtime::io -#endif /* FORTRAN_RUNTIME_UNIT_MAP_H_ */ +#endif /* FORTRAN_FLANG_RT_UNIT_MAP_H_ */ diff --git a/FortranRuntime/lib/Runtime/unit.cpp b/flang-rt/lib/flang_rt/unit.cpp similarity index 99% rename from FortranRuntime/lib/Runtime/unit.cpp rename to flang-rt/lib/flang_rt/unit.cpp index 496679ee8ce5f4..b5a4282faf22e5 100644 --- a/FortranRuntime/lib/Runtime/unit.cpp +++ b/flang-rt/lib/flang_rt/unit.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/unit.cpp ------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/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. @@ -19,13 +19,13 @@ namespace Fortran::runtime::io { -#ifndef FLANG_RUNTIME_NO_GLOBAL_VAR_DEFS +#ifndef FLANGRT_NO_GLOBAL_VAR_DEFS RT_OFFLOAD_VAR_GROUP_BEGIN RT_VAR_ATTRS ExternalFileUnit *defaultInput{nullptr}; // unit 5 RT_VAR_ATTRS ExternalFileUnit *defaultOutput{nullptr}; // unit 6 RT_VAR_ATTRS ExternalFileUnit *errorOutput{nullptr}; // unit 0 extension RT_OFFLOAD_VAR_GROUP_END -#endif // FLANG_RUNTIME_NO_GLOBAL_VAR_DEFS +#endif // FLANGRT_NO_GLOBAL_VAR_DEFS RT_OFFLOAD_API_GROUP_BEGIN diff --git a/FortranRuntime/lib/Runtime/unit.h b/flang-rt/lib/flang_rt/unit.h similarity index 98% rename from FortranRuntime/lib/Runtime/unit.h rename to flang-rt/lib/flang_rt/unit.h index 4a7444aedbe5b6..077a34833734ac 100644 --- a/FortranRuntime/lib/Runtime/unit.h +++ b/flang-rt/lib/flang_rt/unit.h @@ -1,4 +1,4 @@ -//===-- lib/Runtime/unit.h --------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/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. @@ -8,14 +8,14 @@ // Fortran external I/O units -#ifndef FORTRAN_RUNTIME_UNIT_H_ -#define FORTRAN_RUNTIME_UNIT_H_ +#ifndef FORTRAN_FLANG_RT_UNIT_H_ +#define FORTRAN_FLANG_RT_UNIT_H_ -#include "FortranRuntime/Runtime/memory.h" #include "buffer.h" #include "connection.h" #include "environment.h" #include "file.h" +#include "flang-rt/flang_rt/memory.h" #include "format.h" #include "io-error.h" #include "io-stmt.h" @@ -291,4 +291,4 @@ class ChildIo { }; } // namespace Fortran::runtime::io -#endif /* FORTRAN_RUNTIME_UNIT_H_ */ +#endif /* FORTRAN_FLANG_RT_UNIT_H_ */ diff --git a/FortranRuntime/lib/Runtime/utf.cpp b/flang-rt/lib/flang_rt/utf.cpp similarity index 96% rename from FortranRuntime/lib/Runtime/utf.cpp rename to flang-rt/lib/flang_rt/utf.cpp index 635451153d39a6..860db5f2367d38 100644 --- a/FortranRuntime/lib/Runtime/utf.cpp +++ b/flang-rt/lib/flang_rt/utf.cpp @@ -1,4 +1,4 @@ -//===-- lib/Runtime/utf.cpp -------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/utf.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. @@ -10,7 +10,7 @@ namespace Fortran::runtime { -#ifndef FLANG_RUNTIME_NO_GLOBAL_VAR_DEFS +#ifndef FLANGRT_NO_GLOBAL_VAR_DEFS // clang-format off RT_OFFLOAD_VAR_GROUP_BEGIN const RT_CONST_VAR_ATTRS std::uint8_t UTF8FirstByteTable[256]{ @@ -41,7 +41,7 @@ const RT_CONST_VAR_ATTRS std::uint8_t UTF8FirstByteTable[256]{ }; RT_OFFLOAD_VAR_GROUP_END // clang-format on -#endif // FLANG_RUNTIME_NO_GLOBAL_VAR_DEFS +#endif // FLANGRT_NO_GLOBAL_VAR_DEFS RT_OFFLOAD_API_GROUP_BEGIN diff --git a/FortranRuntime/lib/Runtime/utf.h b/flang-rt/lib/flang_rt/utf.h similarity index 94% rename from FortranRuntime/lib/Runtime/utf.h rename to flang-rt/lib/flang_rt/utf.h index 35c03fd4cdded5..71dc7b05a77513 100644 --- a/FortranRuntime/lib/Runtime/utf.h +++ b/flang-rt/lib/flang_rt/utf.h @@ -1,4 +1,4 @@ -//===-- lib/Runtime/utf.h ---------------------------------------*- C++ -*-===// +//===-- lib/flang_rt/utf.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. @@ -38,8 +38,8 @@ // standard maximum. However, we support extended forms up to 32 bits so that // CHARACTER(KIND=4) can be abused to hold arbitrary 32-bit data. -#ifndef FORTRAN_RUNTIME_UTF_H_ -#define FORTRAN_RUNTIME_UTF_H_ +#ifndef FORTRAN_FLANG_RT_UTF_H_ +#define FORTRAN_FLANG_RT_UTF_H_ #include "flang/Common/optional.h" #include @@ -70,4 +70,4 @@ RT_API_ATTRS Fortran::common::optional DecodeUTF8(const char *); RT_API_ATTRS std::size_t EncodeUTF8(char *, char32_t); } // namespace Fortran::runtime -#endif /* FORTRAN_RUNTIME_UTF_H_ */ +#endif /* FORTRAN_FLANG_RT_UTF_H_ */ diff --git a/FortranRuntime/test/CMakeLists.txt b/flang-rt/test/CMakeLists.txt similarity index 57% rename from FortranRuntime/test/CMakeLists.txt rename to flang-rt/test/CMakeLists.txt index c10c487d48c410..be42717b2834f3 100644 --- a/FortranRuntime/test/CMakeLists.txt +++ b/flang-rt/test/CMakeLists.txt @@ -25,7 +25,7 @@ configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py ) -if (TARGET FortranRuntimeUnitTests) +if (TARGET FlangRTUnitTests) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py @@ -41,29 +41,21 @@ if (TARGET FortranRuntimeUnitTests) ) endif () -set(FORTRANRUNTIME_TEST_DEPENDS - FortranRuntimeUnitTests - FortranRuntime.static +set(FLANGRT_TEST_DEPENDS + FlangRTUnitTests + flang_rt.unittest ) -add_custom_target(FortranRuntime-test-depends) -set_target_properties(FortranRuntime-test-depends PROPERTIES FOLDER "Fortran Runtime/Meta") -add_dependencies(FortranRuntime-test-depends ${FORTRANRUNTIME_TEST_DEPENDS}) +add_custom_target(flang-rt-test-depends) +set_target_properties(flang-rt-test-depends PROPERTIES FOLDER "Fortran Runtime/Meta") +add_dependencies(flang-rt-test-depends ${FLANGRT_TEST_DEPENDS}) -add_lit_testsuite(check-FortranRuntime "Running the FortranRuntime regression tests" +add_lit_testsuite(check-flang-rt "Running the flang-rt regression tests" ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${FORTRANRUNTIME_TEST_DEPENDS} + DEPENDS ${FLANGRT_TEST_DEPENDS} ) -set_target_properties(check-FortranRuntime PROPERTIES FOLDER "Fortran Runtime/Meta") +set_target_properties(check-flang-rt PROPERTIES FOLDER "Fortran Runtime/Meta") -add_lit_testsuites(FORTRANRUNTIME ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${FORTRANRUNTIME_TEST_DEPENDS}) - -# To modify the default target triple for flang tests. -if (DEFINED FLANG_TEST_TARGET_TRIPLE) - if (NOT DEFINED LLVM_TARGET_TRIPLE_ENV OR LLVM_TARGET_TRIPLE_ENV STREQUAL "") - message(FATAL_ERROR "LLVM_TARGET_TRIPLE_ENV must also be defined in order " - "to use FLANG_TEST_TARGET_TRIPLE.") - endif() -endif() +add_lit_testsuites(flang-rt ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${FLANGRT_TEST_DEPENDS}) diff --git a/FortranRuntime/test/Driver/ctofortran.f90 b/flang-rt/test/Driver/ctofortran.f90 similarity index 100% rename from FortranRuntime/test/Driver/ctofortran.f90 rename to flang-rt/test/Driver/ctofortran.f90 diff --git a/FortranRuntime/test/Driver/exec.f90 b/flang-rt/test/Driver/exec.f90 similarity index 100% rename from FortranRuntime/test/Driver/exec.f90 rename to flang-rt/test/Driver/exec.f90 diff --git a/FortranRuntime/test/NonGtestUnit/lit.cfg.py b/flang-rt/test/NonGtestUnit/lit.cfg.py similarity index 75% rename from FortranRuntime/test/NonGtestUnit/lit.cfg.py rename to flang-rt/test/NonGtestUnit/lit.cfg.py index f807f2825a1bc7..20e28b0d3b55fd 100644 --- a/FortranRuntime/test/NonGtestUnit/lit.cfg.py +++ b/flang-rt/test/NonGtestUnit/lit.cfg.py @@ -5,18 +5,18 @@ import lit.formats # name: The name of this test suite. -config.name = "FortranRuntime-OldUnit" +config.name = "flang-rt-OldUnit" # suffixes: A list of file extensions to treat as test files. # On Windows, ".exe" also matches the GTests and will execited redundantly. config.suffixes = [".test", ".exe"] # test_source_root: The root path where unit test binaries are located. -config.test_source_root = os.path.join(config.fortranruntime_binary_dir, "unittests") +config.test_source_root = os.path.join(config.flangrt_binary_dir, "unittests") # test_exec_root: The root path where tests should be run. # lit writes a '.lit_test_times.txt' file into this directory. -config.test_exec_root = config.fortranruntime_binary_test_dir +config.test_exec_root = config.flangrt_binary_test_dir # testFormat: The test format to use to interpret tests. config.test_format = lit.formats.ExecutableTest() diff --git a/flang-rt/test/NonGtestUnit/lit.site.cfg.py.in b/flang-rt/test/NonGtestUnit/lit.site.cfg.py.in new file mode 100644 index 00000000000000..9dc4d2d5a1513f --- /dev/null +++ b/flang-rt/test/NonGtestUnit/lit.site.cfg.py.in @@ -0,0 +1,14 @@ +@LIT_SITE_CFG_IN_HEADER@ + +import os + +config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.flangrt_source_dir = "@FLANGRT_SOURCE_DIR@" +config.flangrt_binary_dir = "@FLANGRT_BINARY_DIR@" +config.flangrt_binary_test_dir = os.path.dirname(__file__) + +import lit.llvm +lit.llvm.initialize(lit_config, config) + +# Let the main config do the real work. +lit_config.load_config(config, os.path.join(config.flangrt_source_dir, 'test', 'NonGtestUnit', 'lit.cfg.py')) diff --git a/FortranRuntime/test/Runtime/no-cpp-dep.c b/flang-rt/test/Runtime/no-cpp-dep.c similarity index 87% rename from FortranRuntime/test/Runtime/no-cpp-dep.c rename to flang-rt/test/Runtime/no-cpp-dep.c index 2cc5669a60d3a2..510816a07967ab 100644 --- a/FortranRuntime/test/Runtime/no-cpp-dep.c +++ b/flang-rt/test/Runtime/no-cpp-dep.c @@ -1,12 +1,12 @@ /* This test makes sure that flang's runtime does not depend on the C++ runtime -library. It tries to link this simple file against libFortranRuntime.a with +library. It tries to link this simple file against libflang_rt.a with a C compiler. UNSUPPORTED: system-windows -FIXME: This currently fails with CUDA-enabled FortranRuntime because it needs - to link libcuda_rt. +FIXME: This currently fails with CUDA-enabled flang-rt because it needs + to link libcudart. RUN: %if system-aix %{ export OBJECT_MODE=64 %} RUN: %cc -std=c99 %s -I%include %libruntime -lm \ diff --git a/FortranRuntime/test/Unit/lit.cfg.py b/flang-rt/test/Unit/lit.cfg.py similarity index 73% rename from FortranRuntime/test/Unit/lit.cfg.py rename to flang-rt/test/Unit/lit.cfg.py index 888fb3981916c8..e46a78584c0425 100644 --- a/FortranRuntime/test/Unit/lit.cfg.py +++ b/flang-rt/test/Unit/lit.cfg.py @@ -5,17 +5,17 @@ import lit.formats # name: The name of this test suite. -config.name = "FortranRuntime-Unit" +config.name = "flang-rt-Unit" # suffixes: A list of file extensions to treat as test files. config.suffixes = [] # test_source_root: The root path where unit test binaries are located. -config.test_source_root = os.path.join(config.fortranruntime_binary_dir, "unittests") +config.test_source_root = os.path.join(config.flangrt_binary_dir, "unittests") # test_exec_root: The root path where tests should be run. # lit writes a '.lit_test_times.txt' file into this directory. -config.test_exec_root = config.fortranruntime_binary_test_dir +config.test_exec_root = config.flangrt_binary_test_dir # testFormat: The test format to use to interpret tests. config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, "Tests") diff --git a/flang-rt/test/Unit/lit.site.cfg.py.in b/flang-rt/test/Unit/lit.site.cfg.py.in new file mode 100644 index 00000000000000..f6ed1e758d9374 --- /dev/null +++ b/flang-rt/test/Unit/lit.site.cfg.py.in @@ -0,0 +1,15 @@ +@LIT_SITE_CFG_IN_HEADER@ + +import os + +config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.flangrt_source_dir = "@FLANGRT_SOURCE_DIR@" +config.flangrt_binary_dir = "@FLANGRT_BINARY_DIR@" +config.flangrt_binary_test_dir = os.path.dirname(__file__) + +import lit.llvm +lit.llvm.initialize(lit_config, config) + +# Let the main config do the real work. +lit_config.load_config(config, os.path.join(config.flangrt_source_dir, 'test', 'Unit', 'lit.cfg.py')) diff --git a/FortranRuntime/test/lit.cfg.py b/flang-rt/test/lit.cfg.py similarity index 89% rename from FortranRuntime/test/lit.cfg.py rename to flang-rt/test/lit.cfg.py index 1b9041111b72e8..1c3a08b3ae75b7 100644 --- a/FortranRuntime/test/lit.cfg.py +++ b/flang-rt/test/lit.cfg.py @@ -8,7 +8,7 @@ # Configuration file for the 'lit' test runner. # name: The name of this test suite. -config.name = "FortranRuntime" +config.name = "flang-rt" # testFormat: The test format to use to interpret tests. # @@ -54,7 +54,7 @@ # test_exec_root: The root path where tests should be run. # lit writes a '.lit_test_times.txt' file into this directory. -config.test_exec_root = config.fortranruntime_binary_test_dir +config.test_exec_root = config.flangrt_binary_test_dir # On MacOS, -isysroot is needed to build binaries. isysroot_flag = [] @@ -72,7 +72,7 @@ # Define some variables to help us test that the flang runtime doesn't depend on # the C++ runtime libraries. For this we need a C compiler. -libruntime = os.path.join(config.fortranruntime_build_lib_dir, "libFortranRuntime.a") +libruntime = os.path.join(config.flangrt_build_lib_dir, "libflang_rt.a") include = os.path.join(config.flang_source_dir, "include") tools.append( ToolSubst("%cc", command=config.cc, extra_args=isysroot_flag, unresolved="fatal") @@ -80,7 +80,7 @@ tools.append(ToolSubst("%libruntime", command=libruntime, unresolved="fatal")) tools.append(ToolSubst("%include", command=include, unresolved="fatal")) -# Lwt tests find LLVM's standard tools (FileCheck, split-file, not, ...) +# Let tests find LLVM's standard tools (FileCheck, split-file, not, ...) llvm_config.with_environment("PATH", config.llvm_tools_dir, append_path=True) llvm_config.add_tool_substitutions(tools) diff --git a/flang-rt/test/lit.site.cfg.py.in b/flang-rt/test/lit.site.cfg.py.in new file mode 100644 index 00000000000000..630f7dfcd508c7 --- /dev/null +++ b/flang-rt/test/lit.site.cfg.py.in @@ -0,0 +1,17 @@ +@LIT_SITE_CFG_IN_HEADER@ + +import sys + +config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.flang_source_dir = "@FLANG_SOURCE_DIR@" +config.flangrt_source_dir = "@FLANGRT_SOURCE_DIR@" +config.flangrt_binary_test_dir = os.path.dirname(__file__) +config.flangrt_build_lib_dir = "@FLANGRT_BUILD_LIB_DIR@" +config.cc = "@CMAKE_C_COMPILER@" +config.osx_sysroot = path(r"@CMAKE_OSX_SYSROOT@") + +import lit.llvm +lit.llvm.initialize(lit_config, config) + +# Let the main config do the real work. +lit_config.load_config(config, os.path.join(config.flangrt_source_dir, 'test', 'lit.cfg.py')) diff --git a/FortranRuntime/unittests/CMakeLists.txt b/flang-rt/unittests/CMakeLists.txt similarity index 72% rename from FortranRuntime/unittests/CMakeLists.txt rename to flang-rt/unittests/CMakeLists.txt index 592f2ef7ce42ab..d6ed84c9f72bf0 100644 --- a/FortranRuntime/unittests/CMakeLists.txt +++ b/flang-rt/unittests/CMakeLists.txt @@ -26,13 +26,13 @@ endif() # Target that depends on all unittests -add_custom_target(FortranRuntimeUnitTests) -set_target_properties(FortranRuntimeUnitTests PROPERTIES FOLDER "Fortran Runtime/Meta") +add_custom_target(FlangRTUnitTests) +set_target_properties(FlangRTUnitTests PROPERTIES FOLDER "Fortran Runtime/Meta") -function(add_fortranruntime_unittest_offload_properties target) +function(add_flangrt_unittest_offload_properties target) # Set CUDA_RESOLVE_DEVICE_SYMBOLS. - if (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA") + if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA") set_target_properties(${target} PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON ) @@ -43,7 +43,7 @@ function(add_fortranruntime_unittest_offload_properties target) # # FIXME: replace 'native' in --offload-arch option with the list # of targets that Fortran Runtime was built for. - if (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "OpenMP") + if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "OpenMP") set_target_properties(${target} PROPERTIES LINK_OPTIONS "-fopenmp;--offload-arch=native" @@ -52,22 +52,22 @@ function(add_fortranruntime_unittest_offload_properties target) endfunction() -function(add_fortranruntime_unittest test_dirname) +function(add_flangrt_unittest test_dirname) cmake_parse_arguments(ARG "" "" "LINK_LIBS" ${ARGN}) - add_unittest(FortranRuntimeUnitTests ${test_dirname} ${ARG_UNPARSED_ARGUMENTS}) + add_unittest(FlangRTUnitTests ${test_dirname} ${ARG_UNPARSED_ARGUMENTS}) - target_include_directories(${test_dirname} PRIVATE "${FORTRANRUNTIME_SOURCE_DIR}/include") + target_include_directories(${test_dirname} PRIVATE "${FLANGRT_SOURCE_DIR}/include") target_include_directories(${test_dirname} PRIVATE "${FLANG_SOURCE_DIR}/include") target_link_libraries(${test_dirname} PRIVATE ${ARG_LINK_LIBS}) - add_fortranruntime_unittest_offload_properties(${test_dirname}) + add_flangrt_unittest_offload_properties(${test_dirname}) endfunction() -function(add_fortranruntime_nongtest_unittest test_name) +function(add_flangrt_nongtest_unittest test_name) cmake_parse_arguments(ARG "SLOW_TEST" "" @@ -83,15 +83,15 @@ function(add_fortranruntime_nongtest_unittest test_name) add_executable(${test_name}${suffix} ${ARG_UNPARSED_ARGUMENTS}) set_target_properties(${test_name}${suffix} PROPERTIES FOLDER "Fortran Runtime/Tests/Unit") - target_include_directories(${test_name}${suffix} PRIVATE "${FORTRANRUNTIME_SOURCE_DIR}/include") + target_include_directories(${test_name}${suffix} PRIVATE "${FLANGRT_SOURCE_DIR}/include") target_include_directories(${test_name}${suffix} PRIVATE "${FLANG_SOURCE_DIR}/include") target_link_libraries(${test_name}${suffix} PRIVATE NonGTestTesting ${ARG_LINK_LIBS}) if(NOT ARG_SLOW_TEST) - add_dependencies(FortranRuntimeUnitTests ${test_name}${suffix}) + add_dependencies(FlangRTUnitTests ${test_name}${suffix}) endif() - add_fortranruntime_unittest_offload_properties(${test_name}${suffix}) + add_flangrt_unittest_offload_properties(${test_name}${suffix}) endfunction() add_subdirectory(Evaluate) diff --git a/FortranRuntime/unittests/Evaluate/CMakeLists.txt b/flang-rt/unittests/Evaluate/CMakeLists.txt similarity index 73% rename from FortranRuntime/unittests/Evaluate/CMakeLists.txt rename to flang-rt/unittests/Evaluate/CMakeLists.txt index fd3a5755dd1227..dd4b729f698cf6 100644 --- a/FortranRuntime/unittests/Evaluate/CMakeLists.txt +++ b/flang-rt/unittests/Evaluate/CMakeLists.txt @@ -6,14 +6,14 @@ # #===------------------------------------------------------------------------===# -add_fortranruntime_nongtest_unittest(reshape +add_flangrt_nongtest_unittest(reshape reshape.cpp LINK_LIBS - FortranRuntime.unittest + flang_rt.unittest ) -add_fortranruntime_nongtest_unittest(ISO-Fortran-binding +add_flangrt_nongtest_unittest(ISO-Fortran-binding ISO-Fortran-binding.cpp LINK_LIBS - FortranRuntime.unittest + flang_rt.unittest ) diff --git a/FortranRuntime/unittests/Evaluate/ISO-Fortran-binding.cpp b/flang-rt/unittests/Evaluate/ISO-Fortran-binding.cpp similarity index 99% rename from FortranRuntime/unittests/Evaluate/ISO-Fortran-binding.cpp rename to flang-rt/unittests/Evaluate/ISO-Fortran-binding.cpp index b68dfbcbd5b335..03cc59291787aa 100644 --- a/FortranRuntime/unittests/Evaluate/ISO-Fortran-binding.cpp +++ b/flang-rt/unittests/Evaluate/ISO-Fortran-binding.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "flang/Common/ISO_Fortran_binding_wrapper.h" #include "flang/Testing/testing.h" #include "llvm/Support/raw_ostream.h" diff --git a/FortranRuntime/unittests/Evaluate/reshape.cpp b/flang-rt/unittests/Evaluate/reshape.cpp similarity index 98% rename from FortranRuntime/unittests/Evaluate/reshape.cpp rename to flang-rt/unittests/Evaluate/reshape.cpp index 0233ab37e25c6e..c9ead4fe744f91 100644 --- a/FortranRuntime/unittests/Evaluate/reshape.cpp +++ b/flang-rt/unittests/Evaluate/reshape.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "flang/Runtime/transformational.h" #include "flang/Testing/testing.h" #include diff --git a/FortranRuntime/unittests/Runtime/AccessTest.cpp b/flang-rt/unittests/Runtime/AccessTest.cpp similarity index 100% rename from FortranRuntime/unittests/Runtime/AccessTest.cpp rename to flang-rt/unittests/Runtime/AccessTest.cpp diff --git a/FortranRuntime/unittests/Runtime/Allocatable.cpp b/flang-rt/unittests/Runtime/Allocatable.cpp similarity index 100% rename from FortranRuntime/unittests/Runtime/Allocatable.cpp rename to flang-rt/unittests/Runtime/Allocatable.cpp diff --git a/FortranRuntime/unittests/Runtime/ArrayConstructor.cpp b/flang-rt/unittests/Runtime/ArrayConstructor.cpp similarity index 97% rename from FortranRuntime/unittests/Runtime/ArrayConstructor.cpp rename to flang-rt/unittests/Runtime/ArrayConstructor.cpp index 9d9a4ddae8689f..c52ce8e4ea54fd 100644 --- a/FortranRuntime/unittests/Runtime/ArrayConstructor.cpp +++ b/flang-rt/unittests/Runtime/ArrayConstructor.cpp @@ -6,9 +6,9 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/array-constructor.h" -#include "FortranRuntime/Runtime/descriptor.h" -#include "FortranRuntime/Runtime/type-code.h" +#include "flang-rt/flang_rt/array-constructor.h" +#include "flang-rt/flang_rt/descriptor.h" +#include "flang-rt/flang_rt/type-code.h" #include "gtest/gtest.h" #include "tools.h" #include "flang/Runtime/allocatable.h" diff --git a/FortranRuntime/unittests/Runtime/BufferTest.cpp b/flang-rt/unittests/Runtime/BufferTest.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/BufferTest.cpp rename to flang-rt/unittests/Runtime/BufferTest.cpp index 9a7dd86d0c1dc6..41c660e638e712 100644 --- a/FortranRuntime/unittests/Runtime/BufferTest.cpp +++ b/flang-rt/unittests/Runtime/BufferTest.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "../../lib/Runtime/buffer.h" +#include "../../lib/flang_rt/buffer.h" #include "CrashHandlerFixture.h" #include "gtest/gtest.h" #include diff --git a/FortranRuntime/unittests/Runtime/CMakeLists.txt b/flang-rt/unittests/Runtime/CMakeLists.txt similarity index 90% rename from FortranRuntime/unittests/Runtime/CMakeLists.txt rename to flang-rt/unittests/Runtime/CMakeLists.txt index e4439dcc8b3c7e..ce15fe5ef74f96 100644 --- a/FortranRuntime/unittests/Runtime/CMakeLists.txt +++ b/flang-rt/unittests/Runtime/CMakeLists.txt @@ -6,7 +6,7 @@ # #===------------------------------------------------------------------------===# -add_fortranruntime_unittest(FlangRuntimeTests +add_flangrt_unittest(RuntimeTests AccessTest.cpp Allocatable.cpp ArrayConstructor.cpp @@ -38,9 +38,9 @@ add_fortranruntime_unittest(FlangRuntimeTests TemporaryStack.cpp Transformational.cpp LINK_LIBS - FortranRuntime.unittest + flang_rt.unittest ) -if (FORTRANRUNTIME_ENABLE_CUF) +if (FLANG_RT_ENABLE_CUF) add_subdirectory(CUDA) endif () diff --git a/FortranRuntime/unittests/Runtime/CUDA/AllocatorCUF.cpp b/flang-rt/unittests/Runtime/CUDA/AllocatorCUF.cpp similarity index 90% rename from FortranRuntime/unittests/Runtime/CUDA/AllocatorCUF.cpp rename to flang-rt/unittests/Runtime/CUDA/AllocatorCUF.cpp index d2a2e5a11abf80..46461a863c0696 100644 --- a/FortranRuntime/unittests/Runtime/CUDA/AllocatorCUF.cpp +++ b/flang-rt/unittests/Runtime/CUDA/AllocatorCUF.cpp @@ -6,16 +6,16 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/CUDA/allocator.h" -#include "FortranRuntime/Runtime/CUDA/descriptor.h" -#include "FortranRuntime/Runtime/allocatable.h" -#include "FortranRuntime/Runtime/allocator-registry.h" +#include "cuda_runtime.h" +#include "flang-rt/flang_rt/allocator-registry.h" +#include "flang-rt/flang_rt/descriptor.h" #include "gtest/gtest.h" -#include "../../../runtime/terminator.h" +#include "../../../lib/flang_rt/terminator.h" +#include "flang-rt/CufRuntime/allocator.h" +#include "flang/Runtime/CUDA/descriptor.h" +#include "flang/Runtime/allocatable.h" #include "flang/Support/Fortran.h" -#include "cuda_runtime.h" - using namespace Fortran::runtime; using namespace Fortran::runtime::cuda; diff --git a/FortranRuntime/unittests/Runtime/CUDA/CMakeLists.txt b/flang-rt/unittests/Runtime/CUDA/CMakeLists.txt similarity index 89% rename from FortranRuntime/unittests/Runtime/CUDA/CMakeLists.txt rename to flang-rt/unittests/Runtime/CUDA/CMakeLists.txt index 04321e65d733ad..829ae9250f345e 100644 --- a/FortranRuntime/unittests/Runtime/CUDA/CMakeLists.txt +++ b/flang-rt/unittests/Runtime/CUDA/CMakeLists.txt @@ -6,14 +6,14 @@ # #===------------------------------------------------------------------------===# -add_fortranruntime_unittest(FlangCufRuntimeTests +add_flangrt_unittest(FlangCufRuntimeTests AllocatorCUF.cpp ) target_link_libraries(FlangCufRuntimeTests PRIVATE CufRuntime_cuda_${CUDAToolkit_VERSION_MAJOR} - FortranRuntime + flang_rt ) target_include_directories(FlangCufRuntimeTests PRIVATE ${CUDAToolkit_INCLUDE_DIRS}) diff --git a/FortranRuntime/unittests/Runtime/CharacterTest.cpp b/flang-rt/unittests/Runtime/CharacterTest.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/CharacterTest.cpp rename to flang-rt/unittests/Runtime/CharacterTest.cpp index 610061e2122cd5..3a4b5706e53849 100644 --- a/FortranRuntime/unittests/Runtime/CharacterTest.cpp +++ b/flang-rt/unittests/Runtime/CharacterTest.cpp @@ -10,7 +10,7 @@ // in Fortran. #include "flang/Runtime/character.h" -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "gtest/gtest.h" #include #include diff --git a/FortranRuntime/unittests/Runtime/CommandTest.cpp b/flang-rt/unittests/Runtime/CommandTest.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/CommandTest.cpp rename to flang-rt/unittests/Runtime/CommandTest.cpp index a7d68508c5abca..15b2ed2e42bba1 100644 --- a/FortranRuntime/unittests/Runtime/CommandTest.cpp +++ b/flang-rt/unittests/Runtime/CommandTest.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/command.h" -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "gmock/gmock.h" #include "gtest/gtest.h" #include "flang/Runtime/execute.h" diff --git a/FortranRuntime/unittests/Runtime/Complex.cpp b/flang-rt/unittests/Runtime/Complex.cpp similarity index 100% rename from FortranRuntime/unittests/Runtime/Complex.cpp rename to flang-rt/unittests/Runtime/Complex.cpp diff --git a/FortranRuntime/unittests/Runtime/CrashHandlerFixture.cpp b/flang-rt/unittests/Runtime/CrashHandlerFixture.cpp similarity index 96% rename from FortranRuntime/unittests/Runtime/CrashHandlerFixture.cpp rename to flang-rt/unittests/Runtime/CrashHandlerFixture.cpp index 5e0b746c7e974a..3959b0d4b78809 100644 --- a/FortranRuntime/unittests/Runtime/CrashHandlerFixture.cpp +++ b/flang-rt/unittests/Runtime/CrashHandlerFixture.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// #include "CrashHandlerFixture.h" -#include "../../lib/Runtime/terminator.h" +#include "../../lib/flang_rt/terminator.h" #include #include diff --git a/FortranRuntime/unittests/Runtime/CrashHandlerFixture.h b/flang-rt/unittests/Runtime/CrashHandlerFixture.h similarity index 100% rename from FortranRuntime/unittests/Runtime/CrashHandlerFixture.h rename to flang-rt/unittests/Runtime/CrashHandlerFixture.h diff --git a/FortranRuntime/unittests/Runtime/Derived.cpp b/flang-rt/unittests/Runtime/Derived.cpp similarity index 98% rename from FortranRuntime/unittests/Runtime/Derived.cpp rename to flang-rt/unittests/Runtime/Derived.cpp index 22361352fdf5d9..055174a3b5a907 100644 --- a/FortranRuntime/unittests/Runtime/Derived.cpp +++ b/flang-rt/unittests/Runtime/Derived.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "gtest/gtest.h" #include "tools.h" #include "flang/Runtime/derived-api.h" diff --git a/FortranRuntime/unittests/Runtime/ExternalIOTest.cpp b/flang-rt/unittests/Runtime/ExternalIOTest.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/ExternalIOTest.cpp rename to flang-rt/unittests/Runtime/ExternalIOTest.cpp index 7ff4aa3c14bdc5..a93ee97da8f5f7 100644 --- a/FortranRuntime/unittests/Runtime/ExternalIOTest.cpp +++ b/flang-rt/unittests/Runtime/ExternalIOTest.cpp @@ -11,8 +11,8 @@ //===----------------------------------------------------------------------===// #include "CrashHandlerFixture.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 "gtest/gtest.h" #include "flang/Runtime/main.h" #include "flang/Runtime/stop.h" diff --git a/FortranRuntime/unittests/Runtime/Format.cpp b/flang-rt/unittests/Runtime/Format.cpp similarity index 97% rename from FortranRuntime/unittests/Runtime/Format.cpp rename to flang-rt/unittests/Runtime/Format.cpp index f1447608917f2d..3012806a8eacc1 100644 --- a/FortranRuntime/unittests/Runtime/Format.cpp +++ b/flang-rt/unittests/Runtime/Format.cpp @@ -7,9 +7,9 @@ //===----------------------------------------------------------------------===// #include "CrashHandlerFixture.h" -#include "../../lib/Runtime/connection.h" -#include "../../lib/Runtime/format-implementation.h" -#include "../../lib/Runtime/io-error.h" +#include "../../lib/flang_rt/connection.h" +#include "../../lib/flang_rt/format-implementation.h" +#include "../../lib/flang_rt/io-error.h" #include #include #include diff --git a/FortranRuntime/unittests/Runtime/Inquiry.cpp b/flang-rt/unittests/Runtime/Inquiry.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/Inquiry.cpp rename to flang-rt/unittests/Runtime/Inquiry.cpp index 3e5f0037177f1c..0bda07aaef295c 100644 --- a/FortranRuntime/unittests/Runtime/Inquiry.cpp +++ b/flang-rt/unittests/Runtime/Inquiry.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/inquiry.h" -#include "FortranRuntime/Runtime/type-code.h" +#include "flang-rt/flang_rt/type-code.h" #include "gtest/gtest.h" #include "tools.h" diff --git a/FortranRuntime/unittests/Runtime/ListInputTest.cpp b/flang-rt/unittests/Runtime/ListInputTest.cpp similarity index 98% rename from FortranRuntime/unittests/Runtime/ListInputTest.cpp rename to flang-rt/unittests/Runtime/ListInputTest.cpp index e0fe4dfeac3949..7e04ab834eb247 100644 --- a/FortranRuntime/unittests/Runtime/ListInputTest.cpp +++ b/flang-rt/unittests/Runtime/ListInputTest.cpp @@ -7,9 +7,9 @@ //===----------------------------------------------------------------------===// #include "CrashHandlerFixture.h" -#include "FortranRuntime/Runtime/descriptor.h" -#include "FortranRuntime/Runtime/io-api-funcs.h" -#include "../../lib/Runtime/io-error.h" +#include "flang-rt/flang_rt/descriptor.h" +#include "flang-rt/flang_rt/io-api-funcs.h" +#include "../../lib/flang_rt/io-error.h" using namespace Fortran::runtime; using namespace Fortran::runtime::io; diff --git a/FortranRuntime/unittests/Runtime/LogicalFormatTest.cpp b/flang-rt/unittests/Runtime/LogicalFormatTest.cpp similarity index 95% rename from FortranRuntime/unittests/Runtime/LogicalFormatTest.cpp rename to flang-rt/unittests/Runtime/LogicalFormatTest.cpp index 9fa0c2f4260edb..b5a9e2d317841f 100644 --- a/FortranRuntime/unittests/Runtime/LogicalFormatTest.cpp +++ b/flang-rt/unittests/Runtime/LogicalFormatTest.cpp @@ -7,8 +7,8 @@ //===----------------------------------------------------------------------===// #include "CrashHandlerFixture.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 #include #include diff --git a/FortranRuntime/unittests/Runtime/Matmul.cpp b/flang-rt/unittests/Runtime/Matmul.cpp similarity index 98% rename from FortranRuntime/unittests/Runtime/Matmul.cpp rename to flang-rt/unittests/Runtime/Matmul.cpp index 6eb4012e785ff1..e833b3861badac 100644 --- a/FortranRuntime/unittests/Runtime/Matmul.cpp +++ b/flang-rt/unittests/Runtime/Matmul.cpp @@ -7,8 +7,8 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/matmul.h" -#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 "gtest/gtest.h" #include "tools.h" #include "flang/Runtime/allocatable.h" diff --git a/FortranRuntime/unittests/Runtime/MatmulTranspose.cpp b/flang-rt/unittests/Runtime/MatmulTranspose.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/MatmulTranspose.cpp rename to flang-rt/unittests/Runtime/MatmulTranspose.cpp index 199062f820c303..560f62935e35bc 100644 --- a/FortranRuntime/unittests/Runtime/MatmulTranspose.cpp +++ b/flang-rt/unittests/Runtime/MatmulTranspose.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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 "gtest/gtest.h" #include "tools.h" #include "flang/Runtime/allocatable.h" diff --git a/FortranRuntime/unittests/Runtime/MiscIntrinsic.cpp b/flang-rt/unittests/Runtime/MiscIntrinsic.cpp similarity index 98% rename from FortranRuntime/unittests/Runtime/MiscIntrinsic.cpp rename to flang-rt/unittests/Runtime/MiscIntrinsic.cpp index 1033dda9d636f7..ca3a3e4fd3b839 100644 --- a/FortranRuntime/unittests/Runtime/MiscIntrinsic.cpp +++ b/flang-rt/unittests/Runtime/MiscIntrinsic.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "gtest/gtest.h" #include "tools.h" #include "flang/Runtime/allocatable.h" diff --git a/FortranRuntime/unittests/Runtime/Namelist.cpp b/flang-rt/unittests/Runtime/Namelist.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/Namelist.cpp rename to flang-rt/unittests/Runtime/Namelist.cpp index 544ab85234fd65..d30625f23bfc1c 100644 --- a/FortranRuntime/unittests/Runtime/Namelist.cpp +++ b/flang-rt/unittests/Runtime/Namelist.cpp @@ -6,10 +6,10 @@ // //===----------------------------------------------------------------------===// -#include "../../lib/Runtime/namelist.h" +#include "../../lib/flang_rt/namelist.h" #include "CrashHandlerFixture.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 "tools.h" #include #include diff --git a/FortranRuntime/unittests/Runtime/Numeric.cpp b/flang-rt/unittests/Runtime/Numeric.cpp similarity index 100% rename from FortranRuntime/unittests/Runtime/Numeric.cpp rename to flang-rt/unittests/Runtime/Numeric.cpp diff --git a/FortranRuntime/unittests/Runtime/NumericalFormatTest.cpp b/flang-rt/unittests/Runtime/NumericalFormatTest.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/NumericalFormatTest.cpp rename to flang-rt/unittests/Runtime/NumericalFormatTest.cpp index c588c739686bed..6c11bb0d4a49d6 100644 --- a/FortranRuntime/unittests/Runtime/NumericalFormatTest.cpp +++ b/flang-rt/unittests/Runtime/NumericalFormatTest.cpp @@ -7,8 +7,8 @@ //===----------------------------------------------------------------------===// #include "CrashHandlerFixture.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 #include #include diff --git a/FortranRuntime/unittests/Runtime/Pointer.cpp b/flang-rt/unittests/Runtime/Pointer.cpp similarity index 98% rename from FortranRuntime/unittests/Runtime/Pointer.cpp rename to flang-rt/unittests/Runtime/Pointer.cpp index 733cd42232875f..c787ed9e71eee9 100644 --- a/FortranRuntime/unittests/Runtime/Pointer.cpp +++ b/flang-rt/unittests/Runtime/Pointer.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/pointer.h" -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "gtest/gtest.h" #include "tools.h" diff --git a/FortranRuntime/unittests/Runtime/Ragged.cpp b/flang-rt/unittests/Runtime/Ragged.cpp similarity index 100% rename from FortranRuntime/unittests/Runtime/Ragged.cpp rename to flang-rt/unittests/Runtime/Ragged.cpp diff --git a/FortranRuntime/unittests/Runtime/Random.cpp b/flang-rt/unittests/Runtime/Random.cpp similarity index 95% rename from FortranRuntime/unittests/Runtime/Random.cpp rename to flang-rt/unittests/Runtime/Random.cpp index 81497a682660a8..bd4fcfd5e87975 100644 --- a/FortranRuntime/unittests/Runtime/Random.cpp +++ b/flang-rt/unittests/Runtime/Random.cpp @@ -7,8 +7,8 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/random.h" -#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 "gtest/gtest.h" #include diff --git a/FortranRuntime/unittests/Runtime/Reduction.cpp b/flang-rt/unittests/Runtime/Reduction.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/Reduction.cpp rename to flang-rt/unittests/Runtime/Reduction.cpp index a382f4b7a71770..0f3789b017c6f6 100644 --- a/FortranRuntime/unittests/Runtime/Reduction.cpp +++ b/flang-rt/unittests/Runtime/Reduction.cpp @@ -7,8 +7,8 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/reduction.h" -#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 "gtest/gtest.h" #include "tools.h" #include "flang/Common/float128.h" diff --git a/FortranRuntime/unittests/Runtime/RuntimeCrashTest.cpp b/flang-rt/unittests/Runtime/RuntimeCrashTest.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/RuntimeCrashTest.cpp rename to flang-rt/unittests/Runtime/RuntimeCrashTest.cpp index 7ce1ee796d739b..f1ea6c897d515e 100644 --- a/FortranRuntime/unittests/Runtime/RuntimeCrashTest.cpp +++ b/flang-rt/unittests/Runtime/RuntimeCrashTest.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "CrashHandlerFixture.h" #include "tools.h" -#include "../../lib/Runtime/terminator.h" +#include "../../lib/flang_rt/terminator.h" #include "flang/Runtime/io-api.h" #include "flang/Runtime/transformational.h" #include diff --git a/FortranRuntime/unittests/Runtime/Stop.cpp b/flang-rt/unittests/Runtime/Stop.cpp similarity index 98% rename from FortranRuntime/unittests/Runtime/Stop.cpp rename to flang-rt/unittests/Runtime/Stop.cpp index c12ec097068438..9aaabc2e6c6384 100644 --- a/FortranRuntime/unittests/Runtime/Stop.cpp +++ b/flang-rt/unittests/Runtime/Stop.cpp @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/stop.h" #include "CrashHandlerFixture.h" -#include "../../lib/Runtime/environment.h" +#include "../../lib/flang_rt/environment.h" #include #include diff --git a/FortranRuntime/unittests/Runtime/Support.cpp b/flang-rt/unittests/Runtime/Support.cpp similarity index 98% rename from FortranRuntime/unittests/Runtime/Support.cpp rename to flang-rt/unittests/Runtime/Support.cpp index 05328e6baa411c..d37369df025f45 100644 --- a/FortranRuntime/unittests/Runtime/Support.cpp +++ b/flang-rt/unittests/Runtime/Support.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/support.h" -#include "FortranRuntime/Runtime/descriptor.h" +#include "flang-rt/flang_rt/descriptor.h" #include "gtest/gtest.h" #include "tools.h" diff --git a/FortranRuntime/unittests/Runtime/TemporaryStack.cpp b/flang-rt/unittests/Runtime/TemporaryStack.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/TemporaryStack.cpp rename to flang-rt/unittests/Runtime/TemporaryStack.cpp index b0b1041f0f09e7..8a9f2dfe6d22f1 100644 --- a/FortranRuntime/unittests/Runtime/TemporaryStack.cpp +++ b/flang-rt/unittests/Runtime/TemporaryStack.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#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 "gtest/gtest.h" #include "tools.h" #include "flang/Common/ISO_Fortran_binding_wrapper.h" diff --git a/FortranRuntime/unittests/Runtime/Time.cpp b/flang-rt/unittests/Runtime/Time.cpp similarity index 100% rename from FortranRuntime/unittests/Runtime/Time.cpp rename to flang-rt/unittests/Runtime/Time.cpp diff --git a/FortranRuntime/unittests/Runtime/Transformational.cpp b/flang-rt/unittests/Runtime/Transformational.cpp similarity index 99% rename from FortranRuntime/unittests/Runtime/Transformational.cpp rename to flang-rt/unittests/Runtime/Transformational.cpp index 6b8903750d0aec..e8981e9b122eb7 100644 --- a/FortranRuntime/unittests/Runtime/Transformational.cpp +++ b/flang-rt/unittests/Runtime/Transformational.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "flang/Runtime/transformational.h" -#include "FortranRuntime/Runtime/type-code.h" +#include "flang-rt/flang_rt/type-code.h" #include "gtest/gtest.h" #include "tools.h" #include "flang/Common/float128.h" diff --git a/FortranRuntime/unittests/Runtime/tools.h b/flang-rt/unittests/Runtime/tools.h similarity index 95% rename from FortranRuntime/unittests/Runtime/tools.h rename to flang-rt/unittests/Runtime/tools.h index 8000d83fc0c394..7edeff7f7eb579 100644 --- a/FortranRuntime/unittests/Runtime/tools.h +++ b/flang-rt/unittests/Runtime/tools.h @@ -9,8 +9,8 @@ #ifndef FORTRAN_UNITTESTS_RUNTIME_TOOLS_H_ #define FORTRAN_UNITTESTS_RUNTIME_TOOLS_H_ -#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 "gtest/gtest.h" #include "flang/Runtime/allocatable.h" #include "flang/Runtime/cpp-type.h" diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt index ac189de2386b16..34c5661c963a80 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -23,7 +23,6 @@ if (LLVM_ENABLE_EH) endif() set(FLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -set(FORTRANRUNTIME_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../FortranRuntime") if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE) message(FATAL_ERROR "In-source builds are not allowed. \ @@ -247,13 +246,11 @@ set(LLVM_BUILD_TOOLS ON) include_directories(BEFORE ${FLANG_BINARY_DIR}/include - ${FLANG_SOURCE_DIR}/include - ${FORTRANRUNTIME_SOURCE_DIR}/include) + ${FLANG_SOURCE_DIR}/include) # Add Flang-centric modules to cmake path. list(INSERT CMAKE_MODULE_PATH 0 "${FLANG_SOURCE_DIR}/cmake/modules" - "${FORTRANRUNTIME_SOURCE_DIR}/cmake/modules" "${LLVM_COMMON_CMAKE_UTILS}/Modules" ) include(AddFlang) @@ -271,7 +268,7 @@ set(FLANG_DEFAULT_LINKER "" CACHE STRING "Default linker to use (linker name or absolute path, empty for platform default)") set(FLANG_DEFAULT_RTLIB "" CACHE STRING - "Default Fortran runtime library to use (\"libFortranRuntime\"), leave empty for platform default.") + "Default Fortran runtime library to use (\"libflang_rt\"), leave empty for platform default.") if (NOT(FLANG_DEFAULT_RTLIB STREQUAL "")) message(WARNING "Resetting Flang's default runtime library to use platform default.") diff --git a/FortranRuntime/cmake/modules/FlangCommon.cmake b/flang/cmake/modules/FlangCommon.cmake similarity index 93% rename from FortranRuntime/cmake/modules/FlangCommon.cmake rename to flang/cmake/modules/FlangCommon.cmake index d7194ad4d7ef56..1b8606843b2240 100644 --- a/FortranRuntime/cmake/modules/FlangCommon.cmake +++ b/flang/cmake/modules/FlangCommon.cmake @@ -1,43 +1,43 @@ -#===-- cmake/modules/FlangCommon.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 -# -#===------------------------------------------------------------------------===# -# -# CMake definitions shared betwween Flang and FortranRuntime -# -#===------------------------------------------------------------------------===# - -# The out of tree builds of the compiler and the Fortran runtime -# must use the same setting of FLANG_RUNTIME_F128_MATH_LIB -# to be composable. Failure to synchronize this setting may result -# in linking errors or fatal failures in F128 runtime functions. -set(FLANG_RUNTIME_F128_MATH_LIB "" CACHE STRING - "Specifies the target library used for implementing IEEE-754 128-bit float \ - math in F18 runtime, e.g. it might be libquadmath for targets where \ - REAL(16) is mapped to __float128, or libm for targets where REAL(16) \ - is mapped to long double, etc." - ) -if (FLANG_RUNTIME_F128_MATH_LIB) - add_compile_definitions(FLANG_RUNTIME_F128_MATH_LIB="${FLANG_RUNTIME_F128_MATH_LIB}") -endif() - -# Check if 128-bit float computations can be done via long double -check_cxx_source_compiles( - "#include - #if LDBL_MANT_DIG != 113 - #error LDBL_MANT_DIG != 113 - #endif - int main() { return 0; } - " - HAVE_LDBL_MANT_DIG_113) - -include(TestBigEndian) -test_big_endian(IS_BIGENDIAN) -if (IS_BIGENDIAN) - add_compile_definitions(FLANG_BIG_ENDIAN=1) -else () - add_compile_definitions(FLANG_LITTLE_ENDIAN=1) -endif () +#===-- cmake/modules/FlangCommon.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 +# +#===------------------------------------------------------------------------===# +# +# CMake definitions shared between Flang and Flang-RT +# +#===------------------------------------------------------------------------===# + +# The out of tree builds of the compiler and the Fortran runtime +# must use the same setting of FLANG_RUNTIME_F128_MATH_LIB +# to be composable. Failure to synchronize this setting may result +# in linking errors or fatal failures in F128 runtime functions. +set(FLANG_RUNTIME_F128_MATH_LIB "" CACHE STRING + "Specifies the target library used for implementing IEEE-754 128-bit float \ + math in F18 runtime, e.g. it might be libquadmath for targets where \ + REAL(16) is mapped to __float128, or libm for targets where REAL(16) \ + is mapped to long double, etc." + ) +if (FLANG_RUNTIME_F128_MATH_LIB) + add_compile_definitions(FLANG_RUNTIME_F128_MATH_LIB="${FLANG_RUNTIME_F128_MATH_LIB}") +endif() + +# Check if 128-bit float computations can be done via long double +check_cxx_source_compiles( + "#include + #if LDBL_MANT_DIG != 113 + #error LDBL_MANT_DIG != 113 + #endif + int main() { return 0; } + " + HAVE_LDBL_MANT_DIG_113) + +include(TestBigEndian) +test_big_endian(IS_BIGENDIAN) +if (IS_BIGENDIAN) + add_compile_definitions(FLANG_BIG_ENDIAN=1) +else () + add_compile_definitions(FLANG_LITTLE_ENDIAN=1) +endif () diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md index 98611ee338e706..5165ac6c323ac2 100644 --- a/flang/docs/FlangDriver.md +++ b/flang/docs/FlangDriver.md @@ -179,18 +179,18 @@ like this: ``` $ flang -v -o example example.o -"/usr/bin/ld" [...] example.o [...] "-lFortranRuntime" [...] +"/usr/bin/ld" [...] example.o [...] "-lflang_rt" [...] ``` The automatically added libraries are: -* `FortranRuntime`: Provides most of the Flang runtime library. +* `flang_rt`: Provides most of the Flang runtime library. If the code is C/C++ based and invokes Fortran routines, one can either use Clang or Flang as the linker driver. If Clang is used, it will automatically all required runtime libraries needed by C++ (e.g., for STL) to the linker invocation. -In this case, one has to explicitly provide the Fortran runtime libraries -`FortranRuntime`. An alternative is to use Flang to link. +In this case, one has to explicitly provide the Fortran runtime library +`flang_ty`. An alternative is to use Flang to link. In this case, it may be required to explicitly supply C++ runtime libraries. On Darwin, the logical root where the system libraries are located (sysroot) diff --git a/flang/docs/GettingStarted.md b/flang/docs/GettingStarted.md index eb9049ad607570..9061a00c2de250 100644 --- a/flang/docs/GettingStarted.md +++ b/flang/docs/GettingStarted.md @@ -32,8 +32,8 @@ tool. ### Building flang in tree (bootstrap build) Building flang in tree means building flang along with all of the projects on -which it depends. These projects include mlir, clang, flang, openmp, -compiler-rt, and FortranRuntime. Note that compiler-rt is only needed to access libraries that +which it depends. These projects include mlir, clang, flang, openmp, and +compiler-rt. Note that compiler-rt is only needed to access libraries that support 16 bit floating point numbers. It's not needed to run the automated tests. You can use several different C++ compilers for most of the build, includig GNU and clang. But building compiler-rt requres using the clang @@ -82,7 +82,7 @@ cmake \ -DLLVM_TARGETS_TO_BUILD=host \ -DLLVM_LIT_ARGS=-v \ -DLLVM_ENABLE_PROJECTS="clang;mlir;flang;openmp" \ - -DLLVM_ENABLE_RUNTIMES="compiler-rt;FortranRuntime" \ + -DLLVM_ENABLE_RUNTIMES="compiler-rt;flang_rt" \ ../llvm-project/llvm ninja @@ -209,15 +209,15 @@ mkdir build_flang_runtime cd build_flang_runtime cmake \ - -DLLVM_ENABLE_RUNTIMES=FortranRuntime \ - -DFORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA \ + -DLLVM_ENABLE_RUNTIMES=flang_rt \ + -DFLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA \ -DCMAKE_CUDA_ARCHITECTURES=80 \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_CUDA_COMPILER=clang \ -DCMAKE_CUDA_HOST_COMPILER=clang++ \ ../runtimes/ -make -j`nprocs` FortranRuntime +make -j`nprocs` flang_rt ``` Note that the used version of `clang` must [support](https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#cuda-support) @@ -232,8 +232,8 @@ mkdir build_flang_runtime cd build_flang_runtime cmake \ - -DLLVM_ENABLE_RUNTIMES=FortranRuntime \ - -DFORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA \ + -DLLVM_ENABLE_RUNTIMES=flang_rt \ + -DFLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA \ -DCMAKE_CUDA_ARCHITECTURES=80 \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ @@ -241,7 +241,7 @@ cmake \ -DCMAKE_CUDA_HOST_COMPILER=clang++ \ ../runtimes/ -make -j`nprocs` FortranRuntime +make -j`nprocs` flang_rt ``` Note that `nvcc` might limit support to certain @@ -260,8 +260,8 @@ build config: For example: ```bash - -DLLVM_ENABLE_RUNTIMES=FortranRuntime \ - -DFORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA \ + -DLLVM_ENABLE_RUNTIMES=flang_rt \ + -DFLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA \ -DCMAKE_CUDA_ARCHITECTURES=80 \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ @@ -272,8 +272,8 @@ For example: Or: ```bash - -DLLVM_ENABLE_RUNTIMES=FortranRuntime \ - -DFORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA \ + -DLLVM_ENABLE_RUNTIMES=flang_rt \ + -DFLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA \ -DCMAKE_CUDA_ARCHITECTURES=80 \ -DCMAKE_C_COMPILER=gcc \ -DCMAKE_CXX_COMPILER=g++ \ @@ -295,14 +295,14 @@ mkdir build_flang_runtime cd build_flang_runtime cmake \ - -DLLVM_ENABLE_RUNTIMES=FortranRuntime \ - -DFORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT="OpenMP" \ + -DLLVM_ENABLE_RUNTIMES=flang_rt \ + -DFLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT="OpenMP" \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ - -DFORTRANRUNTIME_DEVICE_ARCHITECTURES="all" \ + -DFLANG_RT_DEVICE_ARCHITECTURES="all" \ ../runtimes/ -make -j`nprocs` FortranRuntime +make -j`nprocs` flang_rt ``` The result of the build is a "device-only" library, i.e. the host diff --git a/flang/docs/OpenACC-descriptor-management.md b/flang/docs/OpenACC-descriptor-management.md index 0b5103000d8e7c..215643086fb7d1 100644 --- a/flang/docs/OpenACC-descriptor-management.md +++ b/flang/docs/OpenACC-descriptor-management.md @@ -427,7 +427,7 @@ The implementation's behavior may be described as (OpenACC 2.7.2): All the "is-present" checks and the data actions for the auxiliary pointers must be performed atomically with regards to the present counters bookkeeping. -The API relies on the primitives provided by `liboffload`, so it is provided by a new F18 runtime library, e.g. `FortranOffloadRuntime`, that depends on `FortranRuntime` and `liboffload`. The F18 driver adds `FortranOffloadRuntime` for linking under `-fopenacc`/`-fopenmp` (and maybe additional switches like `-fopenmp-targets`). +The API relies on the primitives provided by `liboffload`, so it is provided by a new F18 runtime library, e.g. `FortranOffloadRuntime`, that depends on `flang_rt` and `liboffload`. The F18 driver adds `FortranOffloadRuntime` for linking under `-fopenacc`/`-fopenmp` (and maybe additional switches like `-fopenmp-targets`). ## TODOs: diff --git a/flang/docs/ReleaseNotes.md b/flang/docs/ReleaseNotes.md index 80ebbb5481ba50..347f470452b247 100644 --- a/flang/docs/ReleaseNotes.md +++ b/flang/docs/ReleaseNotes.md @@ -36,12 +36,13 @@ page](https://llvm.org/releases/). ## Build System Changes - * The Fortran Runtime library (libFortranRuntime) has been move to a new - top-level directory named "FortranRuntime". It now supports the - LLVM_ENABLE_RUNTIMES mechanism to build libFortranRuntime for multiple target - triples. libFortranRuntime.a will now be emitted into Clang's per-target - resource directory (next to libclang_rt) where it is also found by Flang's - driver. + * The Fortran Runtime library has been move to a new top-level directory + named "flang-rt". The library was also renamed from `libFortranRuntime.a` to + `libflang_rt.a`. It now supports the + LLVM_ENABLE_RUNTIMES mechanism to build flang-rt for multiple target + triples. libflang_rt.a will now be emitted into Clang's per-target + resource directory (next to libclang_rt.*.*) where it is also found by + Flang's driver. ## New Issues Found diff --git a/flang/examples/ExternalHelloWorld/CMakeLists.txt b/flang/examples/ExternalHelloWorld/CMakeLists.txt index 042d4b6238ba45..213fc462ac2b1a 100644 --- a/flang/examples/ExternalHelloWorld/CMakeLists.txt +++ b/flang/examples/ExternalHelloWorld/CMakeLists.txt @@ -5,5 +5,5 @@ add_llvm_example(external-hello-world target_link_libraries(external-hello-world PRIVATE - FortranRuntime + flang_rt ) diff --git a/flang/include/flang/Common/README.md b/flang/include/flang/Common/README.md index a722732fb76407..5203465f7f2fa9 100644 --- a/flang/include/flang/Common/README.md +++ b/flang/include/flang/Common/README.md @@ -1,8 +1,8 @@ -Files in this directory are used by Flang (the compiler) and FortranRuntime +Files in this directory are used by Flang (the compiler) and flang-rt (the runtime library for Flang-compiled programs). They must be compatible by both. For definitions used only by Flang, consider `flang/{lib,include/flang}/Support` instead. For definitions used only by -FortranRuntime, consider `FortranRuntime/{lib,include/FortranRuntime}/Runtime`. +the runtime, consider `flang-rt/{lib,include/flang-rt}/flang_rt`. The requirements for common code include: @@ -23,3 +23,5 @@ The requirements for common code include: * Global declarations may need to be annotated using definitions from `api-attrs.h`. + + * The `Runtime` component is header-only. diff --git a/flang/include/flang/ISO_Fortran_binding.h b/flang/include/flang/ISO_Fortran_binding.h index 89a10ce69a2ba2..b211bcd98af868 100644 --- a/flang/include/flang/ISO_Fortran_binding.h +++ b/flang/include/flang/ISO_Fortran_binding.h @@ -1,3 +1,11 @@ +//===-- include/flang/ISO_Fortran_binding.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 +// +//===----------------------------------------------------------------------===// + /*===-- include/flang/ISO_Fortran_binding.h -----------------------*- C++ -*-=== * * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. @@ -7,14 +15,14 @@ * ===-----------------------------------------------------------------------=== */ -#ifndef CFI_ISO_FORTRAN_BINDING_H_ -#define CFI_ISO_FORTRAN_BINDING_H_ +#ifndef FORTRAN_ISO_FORTRAN_BINDING_H_ +#define FORTRAN_ISO_FORTRAN_BINDING_H_ /* When this header is included into the compiler and runtime implementations, * it does so by means of a wrapper header that establishes namespaces and * a macro for extra function attributes (RT_API_ATTRS). */ -#ifndef FORTRAN_ISO_FORTRAN_BINDING_WRAPPER_H_ +#ifndef FORTRAN_COMMON_ISO_FORTRAN_BINDING_WRAPPER_H_ #include #define FORTRAN_ISO_NAMESPACE_ #endif @@ -207,4 +215,4 @@ RT_API_ATTRS int CFI_setpointer( } // extern "C" #endif -#endif /* CFI_ISO_FORTRAN_BINDING_H_ */ +#endif /* FORTRAN_ISO_FORTRAN_BINDING_H_ */ diff --git a/flang/include/flang/Runtime/README.md b/flang/include/flang/Runtime/README.md index a13a7e23162e98..5203465f7f2fa9 100644 --- a/flang/include/flang/Runtime/README.md +++ b/flang/include/flang/Runtime/README.md @@ -1,8 +1,8 @@ -Files in this directory are used by Flang (the compiler) and FortranRuntime +Files in this directory are used by Flang (the compiler) and flang-rt (the runtime library for Flang-compiled programs). They must be compatible by both. For definitions used only by Flang, consider `flang/{lib,include/flang}/Support` instead. For definitions used only by -FortranRuntime, consider `FortranRuntime/{lib,include/FortranRuntime}/Runtime`. +the runtime, consider `flang-rt/{lib,include/flang-rt}/flang_rt`. The requirements for common code include: diff --git a/flang/include/flang/Testing/README.md b/flang/include/flang/Testing/README.md index a722732fb76407..5203465f7f2fa9 100644 --- a/flang/include/flang/Testing/README.md +++ b/flang/include/flang/Testing/README.md @@ -1,8 +1,8 @@ -Files in this directory are used by Flang (the compiler) and FortranRuntime +Files in this directory are used by Flang (the compiler) and flang-rt (the runtime library for Flang-compiled programs). They must be compatible by both. For definitions used only by Flang, consider `flang/{lib,include/flang}/Support` instead. For definitions used only by -FortranRuntime, consider `FortranRuntime/{lib,include/FortranRuntime}/Runtime`. +the runtime, consider `flang-rt/{lib,include/flang-rt}/flang_rt`. The requirements for common code include: @@ -23,3 +23,5 @@ The requirements for common code include: * Global declarations may need to be annotated using definitions from `api-attrs.h`. + + * The `Runtime` component is header-only. diff --git a/flang/lib/Common/README.md b/flang/lib/Common/README.md index a722732fb76407..5203465f7f2fa9 100644 --- a/flang/lib/Common/README.md +++ b/flang/lib/Common/README.md @@ -1,8 +1,8 @@ -Files in this directory are used by Flang (the compiler) and FortranRuntime +Files in this directory are used by Flang (the compiler) and flang-rt (the runtime library for Flang-compiled programs). They must be compatible by both. For definitions used only by Flang, consider `flang/{lib,include/flang}/Support` instead. For definitions used only by -FortranRuntime, consider `FortranRuntime/{lib,include/FortranRuntime}/Runtime`. +the runtime, consider `flang-rt/{lib,include/flang-rt}/flang_rt`. The requirements for common code include: @@ -23,3 +23,5 @@ The requirements for common code include: * Global declarations may need to be annotated using definitions from `api-attrs.h`. + + * The `Runtime` component is header-only. diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp index b98ab3e6999655..44c8fba5ee3c66 100644 --- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp +++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp @@ -751,7 +751,7 @@ prettyPrintIntrinsicName(fir::FirOpBuilder &builder, mlir::Location loc, // Generate a call to the Fortran runtime library providing // support for 128-bit float math. // On 'LDBL_MANT_DIG == 113' targets the implementation -// is provided by FortranRuntime, otherwise, it is done via +// is provided by flang-rt, otherwise, it is done via // FortranFloat128Math library. In the latter case the compiler // has to be built with FLANG_RUNTIME_F128_MATH_LIB to guarantee // proper linking actions in the driver. diff --git a/flang/lib/Optimizer/Transforms/CufOpConversion.cpp b/flang/lib/Optimizer/Transforms/CufOpConversion.cpp index d7d321c6b9af3f..68ce3ab7045505 100644 --- a/flang/lib/Optimizer/Transforms/CufOpConversion.cpp +++ b/flang/lib/Optimizer/Transforms/CufOpConversion.cpp @@ -1,4 +1,4 @@ -//===-- CufOpConversion.cpp -----------------------------------------------===// +//===-- lib/Optimizer/Transforms/CufOpConversion.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. diff --git a/flang/lib/Testing/CMakeLists.txt b/flang/lib/Testing/CMakeLists.txt deleted file mode 100644 index d5caada3fb68e8..00000000000000 --- a/flang/lib/Testing/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -#===-- lib/Testing/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 -# -#===------------------------------------------------------------------------===# - -set(public_headers "") -file(GLOB_RECURSE public_headers - "${FLANGRUNTIME_SOURCE_DIR}/lib/Testing/*.h" -) - -add_fortranruntime_library(NonGTestTesting EXCLUDE_FROM_ALL LINK_TO_LLVM - testing.cpp - fp-testing.cpp - ADDITIONAL_HEADERS - ${public_headers} -) - diff --git a/flang/lib/Testing/README.md b/flang/lib/Testing/README.md index a722732fb76407..5203465f7f2fa9 100644 --- a/flang/lib/Testing/README.md +++ b/flang/lib/Testing/README.md @@ -1,8 +1,8 @@ -Files in this directory are used by Flang (the compiler) and FortranRuntime +Files in this directory are used by Flang (the compiler) and flang-rt (the runtime library for Flang-compiled programs). They must be compatible by both. For definitions used only by Flang, consider `flang/{lib,include/flang}/Support` instead. For definitions used only by -FortranRuntime, consider `FortranRuntime/{lib,include/FortranRuntime}/Runtime`. +the runtime, consider `flang-rt/{lib,include/flang-rt}/flang_rt`. The requirements for common code include: @@ -23,3 +23,5 @@ The requirements for common code include: * Global declarations may need to be annotated using definitions from `api-attrs.h`. + + * The `Runtime` component is header-only. diff --git a/FortranRuntime/lib/Runtime/iso_fortran_env_impl.f90 b/flang/module/iso_fortran_env_impl.f90 similarity index 97% rename from FortranRuntime/lib/Runtime/iso_fortran_env_impl.f90 rename to flang/module/iso_fortran_env_impl.f90 index 1a4da69266c55b..782be81791af2e 100644 --- a/FortranRuntime/lib/Runtime/iso_fortran_env_impl.f90 +++ b/flang/module/iso_fortran_env_impl.f90 @@ -1,4 +1,4 @@ -!===-- lib/Runtime/iso_fortran_env_impl.f90 --------------------------------===! +!===-- module/iso_fortran_env_impl.f90 --=--------------------------------===! ! ! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. ! See https://llvm.org/LICENSE.txt for license information. @@ -8,7 +8,7 @@ ! This MODULE implements part of the ISO_FORTRAN_ENV module file, which ! partially requires linkable symbols for some entities defined -! (e.g., real_kinds). +! (e.g., real_kinds). Hence, this file is also used by Flang-RT. module iso_fortran_env_impl implicit none diff --git a/flang/test/Driver/gcc-toolchain-install-dir.f90 b/flang/test/Driver/gcc-toolchain-install-dir.f90 index 5a073b0c517122..d9160e1971250f 100644 --- a/flang/test/Driver/gcc-toolchain-install-dir.f90 +++ b/flang/test/Driver/gcc-toolchain-install-dir.f90 @@ -1,5 +1,5 @@ !! Test that --gcc-toolchain and --gcc-install-dir options are working as expected. -!! It does not test cross-compiling (--sysroot), so crtbegin.o, libgcc/compiler-rt, libc, libFortranRuntime, etc. are not supposed to be affected. +!! It does not test cross-compiling (--sysroot), so crtbegin.o, libgcc/compiler-rt, libc, libflang_rt, etc. are not supposed to be affected. !! PREFIX is captured twice because the driver escapes backslashes (occuring in Windows paths) in the -### output, but not on the "Selected GCC installation:" line. ! RUN: %flang 2>&1 -### -v -o %t %s -no-integrated-as -fuse-ld=ld --target=i386-unknown-linux-gnu --gcc-install-dir=%S/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/10.2.0 | FileCheck %s --check-prefix=CHECK-I386 diff --git a/flang/test/Driver/linker-flags.f90 b/flang/test/Driver/linker-flags.f90 index fdeb95e4dd97c6..5dc89fe45c8cc0 100644 --- a/flang/test/Driver/linker-flags.f90 +++ b/flang/test/Driver/linker-flags.f90 @@ -33,26 +33,26 @@ ! SOLARIS-F128NONE-NOT: FortranFloat128Math ! UNIX-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed" ! SOLARIS-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "-z" "ignore" "-lquadmath" "-z" "record" -! UNIX-SAME: "-lFortranRuntime" "-lm" +! UNIX-SAME: "-lflang_rt" "-lm" ! COMPILER-RT: "{{.*}}{{\\|/}}libclang_rt.builtins.a" ! DARWIN-LABEL: "{{.*}}ld{{(\.exe)?}}" ! DARWIN-SAME: "[[object_file]]" ! DARWIN-F128NONE-NOT: FortranFloat128Math ! DARWIN-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed" -! DARWIN-SAME: -lFortranRuntime +! DARWIN-SAME: -lflang_rt ! HAIKU-LABEL: "{{.*}}ld{{(\.exe)?}}" ! HAIKU-SAME: "[[object_file]]" ! HAIKU-F128NONE-NOT: FortranFloat128Math ! HAIKU-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed" -! HAIKU-SAME: "-lFortranRuntime" +! HAIKU-SAME: "-lflang_rt" ! MINGW-LABEL: "{{.*}}ld{{(\.exe)?}}" ! MINGW-SAME: "[[object_file]]" ! MINGW-F128NONE-NOT: FortranFloat128Math ! MINGW-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed" -! MINGW-SAME: -lFortranRuntime +! MINGW-SAME: -lflang_rt ! NOTE: This also matches lld-link (when CLANG_DEFAULT_LINKER=lld) and ! any .exe suffix that is added when resolving to the full path of diff --git a/flang/test/Driver/msvc-dependent-lib-flags.f90 b/flang/test/Driver/msvc-dependent-lib-flags.f90 index e7fa63548fa840..5e4e6d5952efda 100644 --- a/flang/test/Driver/msvc-dependent-lib-flags.f90 +++ b/flang/test/Driver/msvc-dependent-lib-flags.f90 @@ -6,23 +6,23 @@ ! MSVC: -fc1 ! MSVC-SAME: -D_MT ! MSVC-SAME: --dependent-lib=libcmt -! MSVC-SAME: --dependent-lib=FortranRuntime.static.lib +! MSVC-SAME: --dependent-lib=flang_rt.static.lib ! MSVC-DEBUG: -fc1 ! MSVC-DEBUG-SAME: -D_MT ! MSVC-DEBUG-SAME: -D_DEBUG ! MSVC-DEBUG-SAME: --dependent-lib=libcmtd -! MSVC-DEBUG-SAME: --dependent-lib=FortranRuntime.static_dbg.lib +! MSVC-DEBUG-SAME: --dependent-lib=flang_rt.static_dbg.lib ! MSVC-DLL: -fc1 ! MSVC-DLL-SAME: -D_MT ! MSVC-DLL-SAME: -D_DLL ! MSVC-DLL-SAME: --dependent-lib=msvcrt -! MSVC-DLL-SAME: --dependent-lib=FortranRuntime.dynamic.lib +! MSVC-DLL-SAME: --dependent-lib=flang_rt.dynamic.lib ! MSVC-DLL-DEBUG: -fc1 ! MSVC-DLL-DEBUG-SAME: -D_MT ! MSVC-DLL-DEBUG-SAME: -D_DEBUG ! MSVC-DLL-DEBUG-SAME: -D_DLL ! MSVC-DLL-DEBUG-SAME: --dependent-lib=msvcrtd -! MSVC-DLL-DEBUG-SAME: --dependent-lib=FortranRuntime.dynamic_dbg.lib +! MSVC-DLL-DEBUG-SAME: --dependent-lib=flang_rt.dynamic_dbg.lib diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt index 401c7cc2bdef79..ada258fae8f7a2 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -54,8 +54,6 @@ if (NOT CMAKE_CROSSCOMPILING) foreach(filename ${MODULES}) set(depends "") set(opts "") - set(sourcepath "${FLANG_SOURCE_DIR}/module/${filename}.f90") - set(modpath "${FLANG_INTRINSIC_MODULES_DIR}/${filename}.mod") if(${filename} STREQUAL "__fortran_builtins" OR ${filename} STREQUAL "__ppc_types") elseif(${filename} STREQUAL "__ppc_intrinsics" OR @@ -66,9 +64,6 @@ if (NOT CMAKE_CROSSCOMPILING) set(depends ${FLANG_INTRINSIC_MODULES_DIR}/__cuda_builtins.mod) else() set(depends ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_builtins.mod) - if(${filename} STREQUAL "iso_fortran_env_impl") - set(sourcepath "${FORTRANRUNTIME_SOURCE_DIR}/lib/Runtime/${filename}.f90") - endif() if(${filename} STREQUAL "iso_fortran_env") set(depends ${depends} ${FLANG_INTRINSIC_MODULES_DIR}/iso_fortran_env_impl.mod) endif() @@ -97,27 +92,20 @@ if (NOT CMAKE_CROSSCOMPILING) set(decls "-DFLANG_SUPPORT_R16") endif() - # Some modules have an implementation part that needs to be added to the - # FortranRuntime library. set(compile_with "-fsyntax-only") set(object_output "") set(include_in_link FALSE) + set(base ${FLANG_INTRINSIC_MODULES_DIR}/${filename}) # TODO: We may need to flag this with conditional, in case Flang is built w/o OpenMP support - add_custom_command(OUTPUT ${modpath} ${object_output} + add_custom_command(OUTPUT ${base}.mod ${object_output} COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} COMMAND flang-new ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR} - ${sourcepath} - DEPENDS flang-new ${sourcepath} ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} + ${FLANG_SOURCE_DIR}/module/${filename}.f90 + DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends} ) - list(APPEND MODULE_FILES "${modpath}") - install(FILES "${modpath}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang") - - # If a module has been compiled into an object file, add the file to - # the link line for the FortranRuntime library. - if(include_in_link) - list(APPEND module_objects ${object_output}) - endif() + list(APPEND MODULE_FILES ${base}.mod) + install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang") endforeach() # Special case for omp_lib.mod, because its source comes from openmp/runtime/src/include. diff --git a/flang/unittests/Common/CMakeLists.txt b/flang/unittests/Common/CMakeLists.txt index 5b3aebaf5f654a..709a02f5c789c7 100644 --- a/flang/unittests/Common/CMakeLists.txt +++ b/flang/unittests/Common/CMakeLists.txt @@ -6,8 +6,8 @@ # #===------------------------------------------------------------------------===# -add_fortranruntime_unittest(FlangCommonTests +add_flangrt_unittest(FlangCommonTests FastIntSetTest.cpp LINK_LIBS - FortranRuntime.unittest + flang_rt.unittest ) diff --git a/flang/unittests/Decimal/CMakeLists.txt b/flang/unittests/Decimal/CMakeLists.txt index 033773049680f6..aaa3210aade7e3 100644 --- a/flang/unittests/Decimal/CMakeLists.txt +++ b/flang/unittests/Decimal/CMakeLists.txt @@ -6,15 +6,15 @@ # #===------------------------------------------------------------------------===# -add_fortranruntime_nongtest_unittest(quick-sanity-test +add_flangrt_nongtest_unittest(quick-sanity-test quick-sanity-test.cpp LINK_LIBS - FortranRuntime.unittest + flang_rt.unittest ) # This test is not run by default as it takes a long time to execute. -add_fortranruntime_nongtest_unittest(thorough-test SLOW_TEST +add_flangrt_nongtest_unittest(thorough-test SLOW_TEST thorough-test.cpp LINK_LIBS - FortranRuntime.unittest + flang_rt.unittest ) diff --git a/lld/COFF/MinGW.cpp b/lld/COFF/MinGW.cpp index 74d1ae0615fa6a..ae51bd5fcae62e 100644 --- a/lld/COFF/MinGW.cpp +++ b/lld/COFF/MinGW.cpp @@ -50,11 +50,11 @@ AutoExporter::AutoExporter( "libclang_rt.profile-x86_64", "libc++", "libc++abi", - "libFortranRuntime", - "libFortranRuntime.static", - "libFortranRuntime.dynamic", - "libFortranRuntime.static_dbg", - "libFortranRuntime.dynamic_dbg", + "libflang_rt", + "libflang_rt.static", + "libflang_rt.dynamic", + "libflang_rtstatic_dbg", + "libflang_rt.dynamic_dbg", "libunwind", "libmsvcrt", "libucrtbase", diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 70f6f50ee5e11a..60daeaae6613e9 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -149,7 +149,7 @@ endif() # As we migrate runtimes to using the bootstrapping build, the set of default runtimes # should grow as we remove those runtimes from LLVM_ENABLE_PROJECTS above. set(LLVM_DEFAULT_RUNTIMES "libcxx;libcxxabi;libunwind") -set(LLVM_SUPPORTED_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc;offload;FortranRuntime") +set(LLVM_SUPPORTED_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc;offload;flang-rt") set(LLVM_ENABLE_RUNTIMES "" CACHE STRING "Semicolon-separated list of runtimes to build, or \"all\" (${LLVM_DEFAULT_RUNTIMES}). Supported runtimes are ${LLVM_SUPPORTED_RUNTIMES}.") if(LLVM_ENABLE_RUNTIMES STREQUAL "all") diff --git a/llvm/projects/CMakeLists.txt b/llvm/projects/CMakeLists.txt index d8808bc79f0129..f254cf10806d75 100644 --- a/llvm/projects/CMakeLists.txt +++ b/llvm/projects/CMakeLists.txt @@ -12,7 +12,7 @@ foreach(entry ${entries}) (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/test-suite) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/openmp) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/cross-project-tests) AND - (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/FortranRuntime)) + (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/flang-rt)) get_filename_component(entry_name "${entry}" NAME) add_llvm_external_project(${entry_name}) endif() @@ -38,7 +38,7 @@ if(${LLVM_BUILD_RUNTIME}) if(NOT LLVM_BUILD_EXTERNAL_COMPILER_RT) add_llvm_external_project(compiler-rt) endif() - add_llvm_external_project(FortranRuntime) + add_llvm_external_project(flang-rt) endif() add_llvm_external_project(dragonegg) diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index 80f1cf5d6b6ea6..79abe65b4c17d6 100644 --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -280,8 +280,8 @@ function(runtime_default_target) ${ARG_CMAKE_ARGS} PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES LLVM_USE_LINKER - CUDA # For runtimes that may look for the CUDA SDK (libc, offload) - FLANG_RUNTIME # Shared between Flang and FortranRuntime + CUDA # For runtimes that may look for the CUDA SDK (libc, offload, flang-rt) + FLANG_RUNTIME # Shared between Flang and Flang-RT ${ARG_PREFIXES} EXTRA_TARGETS ${extra_targets} ${test_targets} @@ -573,7 +573,7 @@ if(build_runtimes) if(LLVM_LIBC_FULL_BUILD) list(APPEND extra_cmake_args "-DLLVM_LIBC_FULL_BUILD=ON") endif() - if("FortranRuntime" IN_LIST LLVM_ENABLE_RUNTIMES) + if("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES) set(enable_fortran ENABLE_FORTRAN) endif () diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index 2a7798fd60af42..1dc42ddc27d2d0 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -23,8 +23,8 @@ list(INSERT CMAKE_MODULE_PATH 0 # We order libraries to mirror roughly how they are layered, except that compiler-rt can depend # on libc++, so we put it after. -set(LLVM_DEFAULT_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;offload;FortranRuntime") -set(LLVM_SUPPORTED_RUNTIMES "${LLVM_DEFAULT_RUNTIMES};llvm-libgcc") +set(LLVM_DEFAULT_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;offload") +set(LLVM_SUPPORTED_RUNTIMES "${LLVM_DEFAULT_RUNTIMES};llvm-libgcc;flang-rt") set(LLVM_ENABLE_RUNTIMES "" CACHE STRING "Semicolon-separated list of runtimes to build, or \"all\" (${LLVM_DEFAULT_RUNTIMES}). Supported runtimes are ${LLVM_SUPPORTED_RUNTIMES}.") if(LLVM_ENABLE_RUNTIMES STREQUAL "all" )