Skip to content

Commit d49157d

Browse files
committed
Move Module sources back to Flang
Build fix f90 relative paths update copyright headers Test experimental CUDA build
1 parent 2216bfe commit d49157d

35 files changed

+68
-20
lines changed

FortranRuntime/include/flang/Common/ISO_Fortran_binding_wrapper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace Fortran {
2828
namespace ISO {
2929
#define FORTRAN_ISO_NAMESPACE_ ::Fortran::ISO
3030
#endif /* __cplusplus */
31-
#include "ISO_Fortran_binding.h"
31+
#include "flang/ISO_Fortran_binding.h"
3232
#ifdef __cplusplus
3333
} // namespace ISO
3434
} // namespace Fortran

FortranRuntime/include/flang/Runtime/io-api.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
#ifndef FORTRAN_RUNTIME_IO_API_H_
1212
#define FORTRAN_RUNTIME_IO_API_H_
1313

14+
#include "flang/Common/magic-numbers.h"
1415
#include "flang/Common/uint128.h"
1516
#include "flang/Runtime/entry-names.h"
1617
#include "flang/Runtime/iostat.h"
17-
#include "flang/Runtime/magic-numbers.h"
1818
#include <cinttypes>
1919
#include <cstddef>
2020

FortranRuntime/include/flang/Runtime/iostat.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef FORTRAN_RUNTIME_IOSTAT_H_
1313
#define FORTRAN_RUNTIME_IOSTAT_H_
1414
#include "flang/Common/api-attrs.h"
15-
#include "flang/Runtime/magic-numbers.h"
15+
#include "flang/Common/magic-numbers.h"
1616
namespace Fortran::runtime::io {
1717

1818
// The value of IOSTAT= is zero when no error, end-of-record,

FortranRuntime/lib/Runtime/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#===-- runtime/CMakeLists.txt ----------------------------------------------===#
1+
#===-- lib/Runtime/CMakeLists.txt ------------------------------------------===#
22
#
33
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
# See https://llvm.org/LICENSE.txt for license information.
@@ -15,7 +15,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1515
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
1616
set(CMAKE_CXX_EXTENSIONS OFF)
1717

18-
set(FLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
18+
set(FLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../flang")
1919

2020
set(LLVM_COMMON_CMAKE_UTILS "${FLANG_SOURCE_DIR}/../cmake")
2121
set(LLVM_CMAKE_UTILS "${FLANG_SOURCE_DIR}/../llvm/cmake")

FortranRuntime/lib/Runtime/CUDA/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#===-- runtime/CUDA/CMakeLists.txt -----------------------------------------===#
1+
#===-- lib/Runtime/CUDA/CMakeLists.txt -------------------------------------===#
22
#
33
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
# See https://llvm.org/LICENSE.txt for license information.

FortranRuntime/lib/Runtime/Float128Math/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#===-- runtime/Float128Math/CMakeLists.txt ---------------------------------===#
1+
#===-- lib/Runtime/Float128Math/CMakeLists.txt -----------------------------===#
22
#
33
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
# See https://llvm.org/LICENSE.txt for license information.

FortranRuntime/lib/Runtime/file.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "file.h"
10-
#include "flang/Runtime/magic-numbers.h"
11-
#include "flang/Runtime/memory.h"
1210
#include "tools.h"
11+
#include "flang/Common/magic-numbers.h"
12+
#include "flang/Runtime/memory.h"
1313
#include <algorithm>
1414
#include <cerrno>
1515
#include <cstring>

FortranRuntime/lib/Runtime/io-error.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "io-error.h"
1010
#include "config.h"
11-
#include "flang/Runtime/magic-numbers.h"
1211
#include "tools.h"
12+
#include "flang/Common/magic-numbers.h"
1313
#include <cerrno>
1414
#include <cstdarg>
1515
#include <cstdio>

FortranRuntime/lib/Runtime/stat.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define FORTRAN_RUNTIME_STAT_H_
1414
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
1515
#include "flang/Common/api-attrs.h"
16-
#include "flang/Runtime/magic-numbers.h"
16+
#include "flang/Common/magic-numbers.h"
1717
namespace Fortran::runtime {
1818

1919
class Descriptor;

FortranRuntime/lib/Testing/fp-testing.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
//===-- lib/Testing/fp-testing.cpp ------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
19
#include "flang/Testing/fp-testing.h"
210
#include "llvm/Support/Errno.h"
311
#include <cstdio>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#===-- unittests/Common/CMakeLists.txt -------------------------------------===#
2+
#
3+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
#
7+
#===------------------------------------------------------------------------===#
8+
19
add_flang_unittest(FlangCommonTests
210
FastIntSetTest.cpp
311
)

FortranRuntime/unittests/Decimal/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#===-- unittests/Decimal/CMakeLists.txt ------------------------------------===#
2+
#
3+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
#
7+
#===------------------------------------------------------------------------===#
8+
19
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
210
add_flang_nongtest_unittest(quick-sanity-test
311
FortranDecimal

FortranRuntime/unittests/Evaluate/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#===-- unittests/Evaluate/CMakeLists.txt -----------------------------------===#
2+
#
3+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
#
7+
#===------------------------------------------------------------------------===#
8+
19
add_flang_nongtest_unittest(reshape
210
FortranEvaluateTesting
311
FortranSemantics

FortranRuntime/unittests/Runtime/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#===-- unittests/Runtime/CMakeLists.txt ------------------------------------===#
2+
#
3+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
#
7+
#===------------------------------------------------------------------------===#
8+
19
add_flang_unittest(FlangRuntimeTests
210
AccessTest.cpp
311
Allocatable.cpp

FortranRuntime/unittests/Runtime/CUDA/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#===-- unittests/Runtime/CUDA/CMakeLists.txt -------------------------------===#
2+
#
3+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
#
7+
#===------------------------------------------------------------------------===#
8+
19
if (FLANG_CUF_RUNTIME)
210

311
add_flang_unittest(FlangCufRuntimeTests

FortranRuntime/unittests/Runtime/Complex.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- flang/unittests/Runtime/Complex.cpp ---------------------*- C++ -*-===//
1+
//===-- unittests/Runtime/Complex.cpp ---------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

flang/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ endif()
538538
include(GetClangResourceDir)
539539
get_clang_resource_dir(HEADER_BINARY_DIR PREFIX ${LLVM_LIBRARY_OUTPUT_INTDIR}/.. SUBDIR include)
540540
configure_file(
541-
../FortranRuntime/include/flang/Common/ISO_Fortran_binding.h
541+
${FLANG_SOURCE_DIR}/include/flang/ISO_Fortran_binding.h
542542
${HEADER_BINARY_DIR}/ISO_Fortran_binding.h)
543543

544544
# And also install it into the install area

flang/lib/Evaluate/fold-logical.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include "fold-implementation.h"
1010
#include "fold-matmul.h"
1111
#include "fold-reduction.h"
12+
#include "flang/Common/magic-numbers.h"
1213
#include "flang/Evaluate/check-expression.h"
13-
#include "flang/Runtime/magic-numbers.h"
1414

1515
namespace Fortran::evaluate {
1616

File renamed without changes.

FortranRuntime/module/__fortran_builtins.f90 renamed to flang/module/__fortran_builtins.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
!
77
!===------------------------------------------------------------------------===!
88

9-
#include '../include/flang/Runtime/magic-numbers.h'
9+
#include '../../FortranRuntime/include/flang/Common/magic-numbers.h'
1010

1111
! These naming shenanigans prevent names from Fortran intrinsic modules
1212
! from being usable on INTRINSIC statements, and force the program

FortranRuntime/module/__fortran_ieee_exceptions.f90 renamed to flang/module/__fortran_ieee_exceptions.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
! here under another name so that IEEE_ARITHMETIC can USE it and export its
1212
! declarations without clashing with a non-intrinsic module in a program.
1313

14-
#include '../include/flang/Runtime/magic-numbers.h'
14+
#include '../../FortranRuntime/include/flang/Common/magic-numbers.h'
1515

1616
module __fortran_ieee_exceptions
1717
use __fortran_builtins, only: &
File renamed without changes.
File renamed without changes.

FortranRuntime/module/ieee_arithmetic.f90 renamed to flang/module/ieee_arithmetic.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
! Fortran 2018 Clause 17
1010

11-
#include '../include/flang/Runtime/magic-numbers.h'
11+
#include '../../FortranRuntime/include/flang/Common/magic-numbers.h'
1212

1313
module ieee_arithmetic
1414
! F18 Clause 17.1p1:

FortranRuntime/module/iso_fortran_env.f90 renamed to flang/module/iso_fortran_env.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
! See Fortran 2023, subclause 16.10.2
1010

11-
#include '../include/flang/Runtime/magic-numbers.h'
11+
#include '../../FortranRuntime/include/flang/Common/magic-numbers.h'
1212

1313
module iso_fortran_env
1414

File renamed without changes.

flang/tools/f18/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ if (NOT CMAKE_CROSSCOMPILING)
105105
set(compile_with "-fsyntax-only")
106106
set(object_output "")
107107
set(include_in_link FALSE)
108-
set(fullpath "${FLANG_SOURCE_DIR}/../FortranRuntime/module/${filename}.f90")
108+
set(fullpath "${FLANG_SOURCE_DIR}/module/${filename}.f90")
109109
if(${filename} IN_LIST MODULES_WITH_IMPLEMENTATION)
110110
set(object_output "${CMAKE_CURRENT_BINARY_DIR}/${filename}${CMAKE_CXX_OUTPUT_EXTENSION}")
111111
set(compile_with -c -o ${object_output})
@@ -119,7 +119,7 @@ if (NOT CMAKE_CROSSCOMPILING)
119119
COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR}
120120
COMMAND flang-new ${opts} ${decls} -cpp ${compile_with} -module-dir ${FLANG_INTRINSIC_MODULES_DIR}
121121
${fullpath}
122-
DEPENDS flang-new ${fullpath} ${FLANG_SOURCE_DIR}/../FortranRuntime/module/__fortran_builtins.f90 ${depends}
122+
DEPENDS flang-new ${fullpath} ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends}
123123
)
124124
list(APPEND MODULE_FILES ${base}.mod)
125125
install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang")

0 commit comments

Comments
 (0)