Skip to content

Commit 05d8121

Browse files
committed
Merge branch 'users/meinersbur/flang_runtime' into users/meinersbur/flang_runtime_shared
2 parents 9d34202 + 5e5ec22 commit 05d8121

File tree

127 files changed

+1249
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1249
-243
lines changed

flang-rt/.clang-format

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ AlignOperands: false
99
AlignTrailingComments: false
1010
IncludeCategories:
1111
- Regex: '^<'
12-
Priority: 4
12+
Priority: 6
1313
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
14+
Priority: 5
15+
- Regex: '^"flang/' # Headers shared with Flang
16+
Priority: 4
17+
- Regex: '^"flang-rt/' # Public Flang-RT headers
1418
Priority: 3
15-
- Regex: '^"(flang|\.\.)/'
16-
Priority: 2
17-
- Regex: '.*'
19+
- Regex: '^[^/]*$' # Private header from same library
1820
Priority: 1
21+
- Regex: '.*' # Private headers from sibling libraries
22+
Priority: 2
1923
...
2024

2125
# vim:set filetype=yaml:

flang-rt/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ include(GetToolchainDirs)
6868
include(FlangCommon)
6969
include(HandleCompilerRT)
7070
include(ExtendPath)
71-
include(GNUInstallDirs)
7271

7372

7473
############################
@@ -110,9 +109,9 @@ else ()
110109
# be installed there using the same prefix. This is to not have a difference
111110
# between bootstrap and standalone runtimes builds.
112111
set(FLANG_RT_OUTPUT_RESOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
113-
set(FLANG_RT_INSTALL_RESOURCE_PATH "${CMAKE_INSTALL_LIBDIR}/clang/${LLVM_VERSION_MAJOR}")
112+
set(FLANG_RT_INSTALL_RESOURCE_PATH "lib/clang/${LLVM_VERSION_MAJOR}")
114113

115-
extend_path(FLANG_RT_OUTPUT_RESOURCE_LIB_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR}" "${CMAKE_INSTALL_LIBDIR}")
114+
extend_path(FLANG_RT_OUTPUT_RESOURCE_LIB_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR}" "lib")
116115
endif ()
117116
extend_path(FLANG_RT_INSTALL_RESOURCE_LIB_PATH "${FLANG_RT_INSTALL_RESOURCE_PATH}" "${toolchain_lib_subdir}")
118117
cmake_path(NORMAL_PATH FLANG_RT_OUTPUT_RESOURCE_DIR)

flang-rt/cmake/modules/GetToolchainDirs.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#
77
#===------------------------------------------------------------------------===#
88

9-
include(GNUInstallDirs)
10-
119

1210
# Determine the subdirectory relative to Clang's resource dir/sysroot where to
1311
# install target-specific libraries, to be found by Clang/Flang driver. This was
@@ -35,15 +33,15 @@ include(GNUInstallDirs)
3533
# ToolChain::getArchSpecificLibPaths(...).
3634
function (get_toolchain_library_subdir outvar)
3735
if (NOT APPLE)
38-
set(outval "${CMAKE_INSTALL_LIBDIR}")
36+
set(outval "lib")
3937
else ()
4038
# Required to be "darwin" for MachO toolchain.
4139
get_toolchain_os_dirname(os_dirname)
42-
set(outval "${CMAKE_INSTALL_LIBDIR}/${os_dirname}")
40+
set(outval "lib/${os_dirname}")
4341
endif ()
4442

4543
get_toolchain_arch_dirname(arch_dirname)
46-
set(outval "${CMAKE_INSTALL_LIBDIR}/${arch_dirname}")
44+
set(outval "lib/${arch_dirname}")
4745

4846
set(${outvar} "${outval}" PARENT_SCOPE)
4947
endfunction ()

flang-rt/lib/FortranFloat128Math/math-entries.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
#ifndef FLANG_RT_FORTRANFLOAT128MATH_MATH_ENTRIES_H_
1010
#define FLANG_RT_FORTRANFLOAT128MATH_MATH_ENTRIES_H_
11-
#include "terminator.h"
12-
#include "tools.h"
11+
12+
#include "../flang_rt/terminator.h"
13+
#include "../flang_rt/tools.h"
1314
#include "flang/Common/float128.h"
1415
#include "flang/Runtime/entry-names.h"
1516
#include <cfloat>

flang-rt/lib/FortranFloat128Math/norm2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "math-entries.h"
1010
#include "numeric-template-specs.h"
11-
#include "reduction-templates.h"
11+
#include "../flang_rt/reduction-templates.h"
1212

1313
namespace Fortran::runtime {
1414
extern "C" {

flang-rt/lib/FortranFloat128Math/numeric-template-specs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define FLANG_RT_FORTRANFLOAT128MATH_NUMERIC_TEMPLATE_SPECS_H_
1111

1212
#include "math-entries.h"
13-
#include "numeric-templates.h"
13+
#include "../flang_rt/numeric-templates.h"
1414

1515
namespace Fortran::runtime {
1616
using F128Type = CppTypeFor<TypeCategory::Real, 16>;

flang-rt/lib/FortranFloat128Math/random.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "math-entries.h"
1010
#include "numeric-template-specs.h"
11-
#include "random-templates.h"
11+
#include "../flang_rt/random-templates.h"
1212

1313
using namespace Fortran::runtime::random;
1414
extern "C" {

flang-rt/lib/flang_rt/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ set(BACKTRACE_HEADER ${Backtrace_HEADER})
1515

1616
# List of files that are buildable for all devices.
1717
set(supported_sources
18-
${FLANG_SOURCE_DIR}/lib/Common/binary-to-decimal.cpp
19-
${FLANG_SOURCE_DIR}/lib/Common/decimal-to-binary.cpp
18+
${FLANG_SOURCE_DIR}/lib/Decimal/binary-to-decimal.cpp
19+
${FLANG_SOURCE_DIR}/lib/Decimal/decimal-to-binary.cpp
2020
ISO_Fortran_binding.cpp
2121
allocator-registry.cpp
2222
allocatable.cpp
@@ -72,15 +72,13 @@ set(supported_sources
7272

7373
# List of source not used for GPU offloading.
7474
set(host_sources
75-
${FLANG_SOURCE_DIR}/lib/Common/binary-to-decimal.cpp
76-
${FLANG_SOURCE_DIR}/lib/Common/decimal-to-binary.cpp
75+
${FLANG_SOURCE_DIR}/module/iso_fortran_env_impl.f90
7776
command.cpp
7877
complex-powi.cpp
7978
complex-reduction.c
8079
exceptions.cpp
8180
execute.cpp
8281
extensions.cpp
83-
${FLANG_SOURCE_DIR}/module/iso_fortran_env_impl.f90
8482
main.cpp
8583
random.cpp
8684
reduce.cpp

flang-rt/lib/flang_rt/CUDA/allocatable.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "flang/Runtime/CUDA/allocatable.h"
10-
#include "flang-rt/descriptor.h"
1110
#include "../assign-impl.h"
1211
#include "../stat.h"
1312
#include "../terminator.h"
13+
#include "flang-rt/descriptor.h"
1414
#include "flang/Runtime/CUDA/common.h"
1515
#include "flang/Runtime/CUDA/descriptor.h"
1616
#include "flang/Runtime/CUDA/memmove-function.h"
1717
#include "flang/Runtime/allocatable.h"
18-
#include "flang/Runtime/descriptor.h"
1918

2019
#include "cuda_runtime.h"
2120

flang-rt/lib/flang_rt/CUDA/allocator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "flang-rt/CUDA/allocator.h"
10-
#include "flang-rt/allocator-registry.h"
1110
#include "../derived.h"
1211
#include "../stat.h"
1312
#include "../terminator.h"
1413
#include "../type-info.h"
14+
#include "flang-rt/allocator-registry.h"
1515
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
1616
#include "flang/Runtime/CUDA/common.h"
1717
#include "flang/Support/Fortran.h"
18-
#include "flang/Support/Fortran.h"
1918

2019
#include "cuda_runtime.h"
2120

0 commit comments

Comments
 (0)