Skip to content
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
72e3c5d
[Flang] Introduce FortranSupport
Meinersbur Jan 24, 2025
71015c8
[Flang] Promote FortranEvaluateTesting library
Meinersbur Jan 24, 2025
2e50a1f
[Flang] Don't use FortranDecimal for runtime
Meinersbur Jan 24, 2025
4c676f4
users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME
Meinersbur Jan 24, 2025
875607f
[Flang] Rename libFortranRuntime.a to libflang_rt.a
Meinersbur Jan 24, 2025
24fb760
Sort files alphabetically
Meinersbur Jan 27, 2025
0810293
Merge branch 'main' into users/meinersbur/flang_runtime_FortranSupport
Meinersbur Jan 27, 2025
a7cd5b2
Merge branch 'users/meinersbur/flang_runtime_FortranSupport' into use…
Meinersbur Jan 27, 2025
962958a
Merge branch 'users/meinersbur/flang_runtime_Testing' into users/mein…
Meinersbur Jan 27, 2025
70326fe
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Jan 27, 2025
a2a68ba
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Jan 27, 2025
b9ab00d
Move files back to Common
Meinersbur Jan 29, 2025
f3e9c15
add missing includes
Meinersbur Jan 29, 2025
8349624
Merge branch 'users/meinersbur/flang_runtime_FortranSupport' into use…
Meinersbur Jan 29, 2025
e5f2532
Merge branch 'users/meinersbur/flang_runtime_Testing' into users/mein…
Meinersbur Jan 29, 2025
9e8a785
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Jan 29, 2025
c3924da
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Jan 29, 2025
6a7bd03
Use C++style comments for header guards
Meinersbur Jan 29, 2025
db749b9
Use C++style comments for header guards II
Meinersbur Jan 29, 2025
d3c1b9a
Merge branch 'main' into users/meinersbur/flang_runtime_FortranSupport
Meinersbur Jan 30, 2025
d9023dd
Merge branch 'users/meinersbur/flang_runtime_FortranSupport' into use…
Meinersbur Jan 30, 2025
eda88d9
Merge branch 'users/meinersbur/flang_runtime_Testing' into users/mein…
Meinersbur Jan 30, 2025
aa1770b
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Jan 30, 2025
1b988f0
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Jan 30, 2025
f4729e6
Conditionalize runtime example
Meinersbur Feb 3, 2025
6bb9de2
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Feb 3, 2025
4303d5a
Rename to libflang_rt.<component>.(a|so)
Meinersbur Feb 3, 2025
8fae565
forgotten change
Meinersbur Feb 3, 2025
7dc5f20
Merge branch 'main' into users/meinersbur/flang_runtime_FortranSupport
Meinersbur Feb 4, 2025
88ecb82
Merge branch 'users/meinersbur/flang_runtime_FortranSupport' into use…
Meinersbur Feb 4, 2025
993564a
Merge branch 'users/meinersbur/flang_runtime_Testing' into users/mein…
Meinersbur Feb 4, 2025
7875cff
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Feb 4, 2025
4498646
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Feb 4, 2025
0a4dfcc
Merge branch 'main' into users/meinersbur/flang_runtime_FortranSupport
Meinersbur Feb 4, 2025
0a9c5fd
Merge branch 'users/meinersbur/flang_runtime_FortranSupport' into use…
Meinersbur Feb 4, 2025
d509bef
Merge branch 'users/meinersbur/flang_runtime_Testing' into users/mein…
Meinersbur Feb 4, 2025
8e3ddbf
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Feb 4, 2025
b2a6556
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Feb 4, 2025
7158e15
Merge remote-tracking branch 'official/main' into users/meinersbur/fl…
Meinersbur Feb 5, 2025
b286a88
clang-format includes
Meinersbur Feb 6, 2025
40b2f71
Merge branch 'users/meinersbur/flang_runtime_FortranSupport' into use…
Meinersbur Feb 6, 2025
080f30c
Merge commit 'b815a3942a0b0a9e7aab6b269ffdb0e93abc4368' into users/me…
Meinersbur Feb 6, 2025
919919f
Merge branch 'users/meinersbur/flang_runtime_FortranSupport' into use…
Meinersbur Feb 6, 2025
8096d45
Merge branch 'users/meinersbur/flang_runtime_Testing' into users/mein…
Meinersbur Feb 6, 2025
d35bea0
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Feb 6, 2025
a446bad
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Feb 6, 2025
778f516
Adapt BSD test
Meinersbur Feb 6, 2025
4c9e378
Merge branch 'main' into users/meinersbur/flang_runtime_FortranSupport
Meinersbur Feb 6, 2025
08a7bbc
Merge branch 'users/meinersbur/flang_runtime_FortranSupport' into use…
Meinersbur Feb 6, 2025
3f99cd5
Merge branch 'users/meinersbur/flang_runtime_Testing' into users/mein…
Meinersbur Feb 6, 2025
1fbd2c5
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Feb 6, 2025
b45a08d
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Feb 6, 2025
8ce70e5
Adapt BSD test for rename
Meinersbur Feb 6, 2025
f258e0e
Use C++ header guards III
Meinersbur Feb 6, 2025
d222eee
Merge commit '02fa340711d9b990b50a0daf65eb850404884137' into users/me…
Meinersbur Feb 6, 2025
06a81de
Merge branch 'users/meinersbur/flang_runtime_Testing' into users/mein…
Meinersbur Feb 6, 2025
0edd103
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Feb 6, 2025
f9a1569
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Feb 6, 2025
2f30a9a
Merge commit '8fb1b3f4b23ecc2fc39f1a1c07244304565cfb21' into users/me…
Meinersbur Feb 7, 2025
ed4c3a6
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Feb 7, 2025
3a996b3
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Feb 7, 2025
9262520
Merge commit '98e118ca435d280ff1c3540eb5e9b4140b44a1b4' into users/me…
Meinersbur Feb 7, 2025
d4909ad
Merge branch 'users/meinersbur/flang_runtime_FortranDecimal' into use…
Meinersbur Feb 7, 2025
51f424e
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Feb 7, 2025
8b7be99
Merge branch 'main' (early part) into users/meinersbur/flang_runtime_…
Meinersbur Feb 8, 2025
9c5e121
Merge branch 'main' into users/meinersbur/flang_runtime_FLANG_INCLUDE…
Meinersbur Feb 8, 2025
6f2d9c9
Merge branch 'users/meinersbur/flang_runtime_FLANG_INCLUDE_RUNTIME' i…
Meinersbur Feb 8, 2025
6b46210
Specifically refer to flang_rt.runtime in comments
Meinersbur Feb 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions clang/lib/Driver/ToolChains/CommonArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,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 and FortranDecimal
// Link flang_rt.runtime
// 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.
Expand All @@ -1330,15 +1330,14 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
F128LibName.consume_front_insensitive("lib");
if (!F128LibName.empty()) {
bool AsNeeded = !TC.getTriple().isOSAIX();
CmdArgs.push_back("-lFortranFloat128Math");
CmdArgs.push_back("-lflang_rt.quadmath");
if (AsNeeded)
addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/true);
CmdArgs.push_back(Args.MakeArgString("-l" + F128LibName));
if (AsNeeded)
addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false);
}
CmdArgs.push_back("-lFortranRuntime");
CmdArgs.push_back("-lFortranDecimal");
CmdArgs.push_back("-lflang_rt.runtime");
addArchSpecificRPath(TC, Args, CmdArgs);
}

Expand Down
26 changes: 13 additions & 13 deletions clang/lib/Driver/ToolChains/Flang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,15 @@ static void processVSRuntimeLibrary(const ToolChain &TC, const ArgList &Args,
ArgStringList &CmdArgs) {
assert(TC.getTriple().isKnownWindowsMSVCEnvironment() &&
"can only add VS runtime library on Windows!");
// if -fno-fortran-main has been passed, skip linking Fortran_main.a
if (TC.getTriple().isKnownWindowsMSVCEnvironment()) {
CmdArgs.push_back(Args.MakeArgString(
"--dependent-lib=" + TC.getCompilerRTBasename(Args, "builtins")));
}

// 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 in some cases like 128-bit integer math (__udivti3, __modti3,
// __fixsfti, __floattidf, ...) that msvc does not support. We are injecting a
// dependency to Compiler-RT's builtin library where these are implemented.
CmdArgs.push_back(Args.MakeArgString(
"--dependent-lib=" + TC.getCompilerRTBasename(Args, "builtins")));

unsigned RTOptionID = options::OPT__SLASH_MT;
if (auto *rtl = Args.getLastArg(options::OPT_fms_runtime_lib_EQ)) {
RTOptionID = llvm::StringSwitch<unsigned>(rtl->getValue())
Expand All @@ -363,30 +367,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=FortranDecimal.static.lib");
CmdArgs.push_back("--dependent-lib=flang_rt.runtime.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=FortranDecimal.static_dbg.lib");
CmdArgs.push_back("--dependent-lib=flang_rt.runtime.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=FortranDecimal.dynamic.lib");
CmdArgs.push_back("--dependent-lib=flang_rt.runtime.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=FortranDecimal.dynamic_dbg.lib");
CmdArgs.push_back("--dependent-lib=flang_rt.runtime.dynamic_dbg.lib");
break;
}
}
Expand Down
8 changes: 6 additions & 2 deletions flang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ else()
include_directories(SYSTEM ${MLIR_TABLEGEN_OUTPUT_DIR})
endif()

option(FLANG_INCLUDE_RUNTIME "Build the runtime in-tree (deprecated; to be replaced with LLVM_ENABLE_RUNTIMES=flang-rt)" ON)

set(FLANG_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
"Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
mark_as_advanced(FLANG_TOOLS_INSTALL_DIR)
Expand Down Expand Up @@ -299,7 +301,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.")
Expand Down Expand Up @@ -487,7 +489,9 @@ if (FLANG_BUILD_TOOLS)
add_subdirectory(tools)
endif()

add_subdirectory(runtime)
if (FLANG_INCLUDE_RUNTIME)
add_subdirectory(runtime)
endif ()

if (LLVM_INCLUDE_EXAMPLES)
add_subdirectory(examples)
Expand Down
2 changes: 1 addition & 1 deletion flang/cmake/modules/AddFlang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function(add_flang_library name)
set(LIBTYPE SHARED)
elseif(ARG_STATIC)
# If BUILD_SHARED_LIBS and ARG_STATIC are both set, llvm_add_library prioritizes STATIC.
# This is required behavior for libFortranFloat128Math.
# This is required behavior for libflang_rt.quadmath.
set(LIBTYPE STATIC)
else()
# Let llvm_add_library decide, taking BUILD_SHARED_LIBS into account.
Expand Down
9 changes: 4 additions & 5 deletions flang/docs/FlangDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,18 @@ like this:

```
$ flang -v -o example example.o
"/usr/bin/ld" [...] example.o [...] "-lFortranRuntime" "-lFortranDecimal" [...]
"/usr/bin/ld" [...] example.o [...] "-lflang_rt.runtime" [...]
```

The automatically added libraries are:

* `FortranRuntime`: Provides most of the Flang runtime library.
* `FortranDecimal`: Provides operations for decimal numbers.
* `flang_rt.runtime`: 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` and/or `FortranDecimal`. An alternative is to use Flang to link.
In this case, one has to explicitly provide the Fortran runtime library
`flang_rt.runtime`. 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)
Expand Down
8 changes: 4 additions & 4 deletions flang/docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ cmake \
-DCMAKE_CUDA_COMPILER=clang \
-DCMAKE_CUDA_HOST_COMPILER=clang++ \
../runtime/
make -j FortranRuntime
make -j 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)
Expand All @@ -239,7 +239,7 @@ cmake \
-DCMAKE_CUDA_HOST_COMPILER=clang++ \
../runtime/

make -j FortranRuntime
make -j flang-rt
```

Note that `nvcc` might limit support to certain
Expand Down Expand Up @@ -294,7 +294,7 @@ cmake \
-DFLANG_OMP_DEVICE_ARCHITECTURES="all" \
../runtime/

make -j FortranRuntime
make -j flang-rt
```

The result of the build is a "device-only" library, i.e. the host
Expand All @@ -309,7 +309,7 @@ The same set of CMake variables works for Flang in-tree build.
One may provide optional CMake variables to customize the build. Available options:

* `-DFLANG_RUNTIME_F128_MATH_LIB=libquadmath`: enables build of
`FortranFloat128Math` library that provides `REAL(16)` math APIs
`flang_rt.quadmath` library that provides `REAL(16)` math APIs
for intrinsics such as `SIN`, `COS`, etc. GCC `libquadmath`'s header file
`quadmath.h` must be available to the build compiler.
[More details](Real16MathSupport.md).
Expand Down
2 changes: 1 addition & 1 deletion flang/docs/OpenACC-descriptor-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.runtime` and `liboffload`. The F18 driver adds `FortranOffloadRuntime` for linking under `-fopenacc`/`-fopenmp` (and maybe additional switches like `-fopenmp-targets`).

## TODOs:

Expand Down
4 changes: 2 additions & 2 deletions flang/docs/Real16MathSupport.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ To support most `REAL(16)` (i.e. 128-bit float) math intrinsics Flang relies
on third-party libraries providing the implementation.

`-DFLANG_RUNTIME_F128_MATH_LIB=libquadmath` CMake option can be used
to build `FortranFloat128Math` library that has unresolved references
to build `libflang_rt.quadmath` library that has unresolved references
to GCC `libquadmath` library. A Flang driver built with this option
will automatically link `FortranFloat128Math` and `libquadmath` libraries
will automatically link `libflang_rt.quadmath` and `libquadmath` libraries
to any Fortran program. This implies that `libquadmath` library
has to be available in the standard library paths, so that linker
can find it. The `libquadmath` library installation into Flang project
Expand Down
7 changes: 7 additions & 0 deletions flang/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ page](https://llvm.org/releases/).

## Build System Changes

* The FortranRuntime library has been renamed to `flang_rt.runtime`.

* The FortranFloat128Math library has been renamed to `flang_rt.quadmath`.

* The CufRuntime_cuda_${version} library has been renamed to
`flang_rt.cuda_${version}`.

## New Issues Found


Expand Down
4 changes: 3 additions & 1 deletion flang/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_subdirectory(ExternalHelloWorld)
if (FLANG_INCLUDE_RUNTIME)
add_subdirectory(ExternalHelloWorld)
endif ()
add_subdirectory(PrintFlangFunctionNames)
add_subdirectory(FlangOmpReport)
add_subdirectory(FeatureList)
2 changes: 1 addition & 1 deletion flang/examples/ExternalHelloWorld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ add_llvm_example(external-hello-world

target_link_libraries(external-hello-world
PRIVATE
FortranRuntime
flang_rt.runtime
)
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/*===-- include/flang/ISO_Fortran_binding_wrapper.h ---------------*- C++ -*-===
/*===-- include/flang/Common/ISO_Fortran_binding_wrapper.h ----------*- C -*-===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
* See https://llvm.org/LICENSE.txt for license information.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*
* ===-----------------------------------------------------------------------===
*/
*===----------------------------------------------------------------------===*/

#ifndef FORTRAN_ISO_FORTRAN_BINDING_WRAPPER_H_
#define FORTRAN_ISO_FORTRAN_BINDING_WRAPPER_H_
#ifndef FORTRAN_COMMON_ISO_FORTRAN_BINDING_WRAPPER_H_
#define FORTRAN_COMMON_ISO_FORTRAN_BINDING_WRAPPER_H_

/* A thin wrapper around flang/include/ISO_Fortran_binding.h
* This header file must be included when ISO_Fortran_binding.h
Expand All @@ -23,17 +22,17 @@

/* clang-format off */
#include <stddef.h>
#include "Common/api-attrs.h"
#include "api-attrs.h"
#ifdef __cplusplus
namespace Fortran {
namespace ISO {
#define FORTRAN_ISO_NAMESPACE_ ::Fortran::ISO
#endif /* __cplusplus */
#include "ISO_Fortran_binding.h"
#include "flang/ISO_Fortran_binding.h"
#ifdef __cplusplus
} // namespace ISO
} // namespace Fortran
#endif /* __cplusplus */
/* clang-format on */

#endif /* FORTRAN_ISO_FORTRAN_BINDING_WRAPPER_H_ */
#endif /* FORTRAN_COMMON_ISO_FORTRAN_BINDING_WRAPPER_H_ */
3 changes: 3 additions & 0 deletions flang/include/flang/Common/erfc-scaled.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#ifndef FORTRAN_COMMON_ERFC_SCALED_H_
#define FORTRAN_COMMON_ERFC_SCALED_H_

#include <cmath>
#include <limits>

namespace Fortran::common {
template <typename T> inline T ErfcScaled(T arg) {
// Coefficients for approximation to erfc in the first interval.
Expand Down
6 changes: 3 additions & 3 deletions flang/include/flang/Common/fast-int-set.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef FORTRAN_COMMON_FAST_INT_SET_H_
#define FORTRAN_COMMON_FAST_INT_SET_H_

#include <optional>
#include "optional.h"

namespace Fortran::common {

Expand Down Expand Up @@ -83,9 +83,9 @@ template <int N> class FastIntSet {
}
}

std::optional<int> PopValue() {
optional<int> PopValue() {
if (IsEmpty()) {
return std::nullopt;
return nullopt;
} else {
return value_[--size_];
}
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Common/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#ifndef FORTRAN_COMMON_FORMAT_H_
#define FORTRAN_COMMON_FORMAT_H_

#include "Fortran-consts.h"
#include "enum-set.h"
#include "flang/Common/Fortran-consts.h"
#include <cstring>

// Define a FormatValidator class template to validate a format expression
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Common/optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#ifndef FORTRAN_COMMON_OPTIONAL_H
#define FORTRAN_COMMON_OPTIONAL_H

#include "flang/Common/api-attrs.h"
#include "api-attrs.h"
#include <optional>
#include <type_traits>

Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Common/real.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// The various representations are distinguished by their binary precisions
// (number of explicit significand bits and any implicit MSB in the fraction).

#include "flang/Common/api-attrs.h"
#include "api-attrs.h"
#include <cinttypes>

namespace Fortran::common {
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Common/reference-wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#ifndef FORTRAN_COMMON_REFERENCE_WRAPPER_H
#define FORTRAN_COMMON_REFERENCE_WRAPPER_H

#include "flang/Common/api-attrs.h"
#include "api-attrs.h"
#include <functional>
#include <type_traits>

Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Common/restorer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#ifndef FORTRAN_COMMON_RESTORER_H_
#define FORTRAN_COMMON_RESTORER_H_
#include "api-attrs.h"
#include "idioms.h"
#include "flang/Common/api-attrs.h"
namespace Fortran::common {
template <typename A> class Restorer {
public:
Expand Down
4 changes: 2 additions & 2 deletions flang/include/flang/Common/target-rounding.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#ifndef FORTRAN_COMMON_TARGET_ROUNDING_H_
#define FORTRAN_COMMON_TARGET_ROUNDING_H_

#include "flang/Common/Fortran-consts.h"
#include "flang/Common/enum-set.h"
#include "Fortran-consts.h"
#include "enum-set.h"

namespace Fortran::common {

Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Common/template.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#ifndef FORTRAN_COMMON_TEMPLATE_H_
#define FORTRAN_COMMON_TEMPLATE_H_

#include "idioms.h"
#include "variant.h"
#include "flang/Common/idioms.h"
#include <functional>
#include <optional>
#include <tuple>
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Common/uint128.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#define AVOID_NATIVE_UINT128_T 0
#endif

#include "api-attrs.h"
#include "leading-zero-bit-count.h"
#include "flang/Common/api-attrs.h"
#include <cstdint>
#include <type_traits>

Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Common/visit.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#ifndef FORTRAN_COMMON_VISIT_H_
#define FORTRAN_COMMON_VISIT_H_

#include "api-attrs.h"
#include "variant.h"
#include "flang/Common/api-attrs.h"
#include <type_traits>

namespace Fortran::common {
Expand Down
Loading