8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/descriptor-io.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_FLANG_RT_DESCRIPTOR_IO_H_
#define FORTRAN_FLANG_RT_DESCRIPTOR_IO_H_
#ifndef FLANGRT_DESCRIPTOR_IO_H_
#define FLANGRT_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;
Expand All @@ -16,7 +16,7 @@

#include "edit-input.h"
#include "edit-output.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "io-stmt.h"
#include "namelist.h"
#include "terminator.h"
Expand Down Expand Up @@ -608,4 +608,4 @@ static RT_API_ATTRS bool DescriptorIO(IoStatementState &io,
return false;
}
} // namespace Fortran::runtime::io::descr
#endif /* FORTRAN_FLANG_RT_DESCRIPTOR_IO_H_ */
#endif /* FLANGRT_DESCRIPTOR_IO_H_ */
4 changes: 2 additions & 2 deletions flang-rt/lib/flang_rt/descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "ISO_Fortran_util.h"
#include "derived.h"
#include "flang-rt/flang_rt/allocator-registry.h"
#include "flang-rt/allocator-registry.h"
#include "memory.h"
#include "stat.h"
#include "terminator.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/dot-product.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "float.h"
#include "terminator.h"
#include "tools.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "flang/Runtime/execute.h"
#include "environment.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "stat.h"
#include "terminator.h"
#include "tools.h"
Expand Down
4 changes: 2 additions & 2 deletions flang-rt/lib/flang_rt/extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// extensions that will eventually be implemented in Fortran.

#include "flang/Runtime/extensions.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/io-api-funcs.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Runtime/command.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "file.h"
#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/memory.h"
#include "tools.h"
#include "flang/Runtime/magic-numbers.h"
#include <algorithm>
Expand Down
8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

// Raw system I/O wrappers

#ifndef FORTRAN_FLANG_RT_FILE_H_
#define FORTRAN_FLANG_RT_FILE_H_
#ifndef FLANGRT_FILE_H_
#define FLANGRT_FILE_H_

#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/memory.h"
#include "io-error.h"
#include "flang/Common/optional.h"
#include <cinttypes>
Expand Down Expand Up @@ -113,4 +113,4 @@ RT_API_ATTRS bool MayWrite(const char *path);
RT_API_ATTRS bool MayReadAndWrite(const char *path);
RT_API_ATTRS std::int64_t SizeInBytes(const char *path);
} // namespace Fortran::runtime::io
#endif /* FORTRAN_FLANG_RT_FILE_H_ */
#endif /* FLANGRT_FILE_H_ */
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/inquiry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "flang/Runtime/inquiry.h"
#include "copy.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/internal-unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "internal-unit.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "io-error.h"
#include "flang/Runtime/freestanding-tools.h"
#include <algorithm>
Expand Down
8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/internal-unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

// Fortran internal I/O "units"

#ifndef FORTRAN_FLANG_RT_INTERNAL_UNIT_H_
#define FORTRAN_FLANG_RT_INTERNAL_UNIT_H_
#ifndef FLANGRT_INTERNAL_UNIT_H_
#define FLANGRT_INTERNAL_UNIT_H_

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

Expand Down Expand Up @@ -56,4 +56,4 @@ template <Direction DIR> class InternalDescriptorUnit : public ConnectionState {
extern template class InternalDescriptorUnit<Direction::Output>;
extern template class InternalDescriptorUnit<Direction::Input>;
} // namespace Fortran::runtime::io
#endif /* FORTRAN_FLANG_RT_INTERNAL_UNIT_H_ */
#endif /* FLANGRT_INTERNAL_UNIT_H_ */
8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/io-api-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_FLANG_RT_IO_API_COMMON_H_
#define FORTRAN_FLANG_RT_IO_API_COMMON_H_
#ifndef FLANGRT_IO_API_COMMON_H_
#define FLANGRT_IO_API_COMMON_H_

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

} // namespace Fortran::runtime::io
#endif /* FORTRAN_FLANG_RT_IO_API_COMMON_H_ */
#endif /* FLANGRT_IO_API_COMMON_H_ */
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/io-api-minimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// list-directed output (PRINT *) of intrinsic types.

#include "edit-output.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "flang-rt/io-api-funcs.h"
#include "format.h"
#include "io-api-common.h"
#include "io-stmt.h"
Expand Down
6 changes: 3 additions & 3 deletions flang-rt/lib/flang_rt/io-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#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 "flang-rt/descriptor.h"
#include "flang-rt/io-api-funcs.h"
#include "flang-rt/memory.h"
#include "format.h"
#include "io-api-common.h"
#include "io-stmt.h"
Expand Down
10 changes: 5 additions & 5 deletions flang-rt/lib/flang_rt/io-error.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// IOSTAT error codes are raw errno values augmented with values for
// Fortran-specific errors.

#ifndef FORTRAN_FLANG_RT_IO_ERROR_H_
#define FORTRAN_FLANG_RT_IO_ERROR_H_
#ifndef FLANGRT_IO_ERROR_H_
#define FLANGRT_IO_ERROR_H_

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

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

} // namespace Fortran::runtime::io
#endif /* FORTRAN_FLANG_RT_IO_ERROR_H_ */
#endif /* FLANGRT_IO_ERROR_H_ */
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/io-stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "io-stmt.h"
#include "connection.h"
#include "emit-encoded.h"
#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/memory.h"
#include "format.h"
#include "tools.h"
#include "unit.h"
Expand Down
10 changes: 5 additions & 5 deletions flang-rt/lib/flang_rt/io-stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

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

#ifndef FORTRAN_FLANG_RT_IO_STMT_H_
#define FORTRAN_FLANG_RT_IO_STMT_H_
#ifndef FLANGRT_IO_STMT_H_
#define FLANGRT_IO_STMT_H_

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

} // namespace Fortran::runtime::io
#endif /* FORTRAN_FLANG_RT_IO_STMT_H_ */
#endif /* FLANGRT_IO_STMT_H_ */
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/iostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

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

namespace Fortran::runtime::io {
RT_OFFLOAD_API_GROUP_BEGIN
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/matmul-transpose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// to use the faster BLAS routines.

#include "flang/Runtime/matmul-transpose.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Common/optional.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/matmul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// Places where BLAS routines could be called are marked as TODO items.

#include "flang/Runtime/matmul.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Common/optional.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/memory.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Runtime/freestanding-tools.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/misc-intrinsic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/misc-intrinsic.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Common/optional.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/namelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "namelist.h"
#include "descriptor-io.h"
#include "emit-encoded.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "flang-rt/io-api-funcs.h"
#include "io-stmt.h"
#include <algorithm>
#include <cstring>
Expand Down
8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/random-templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_FLANG_RT_RANDOM_TEMPLATES_H_
#define FORTRAN_FLANG_RT_RANDOM_TEMPLATES_H_
#ifndef FLANGRT_RANDOM_TEMPLATES_H_
#define FLANGRT_RANDOM_TEMPLATES_H_

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

} // namespace Fortran::runtime::random

#endif /* FORTRAN_FLANG_RT_RANDOM_TEMPLATES_H_ */
#endif /* FLANGRT_RANDOM_TEMPLATES_H_ */
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// RANDOM_SEED.

#include "flang/Runtime/random.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "lock.h"
#include "random-templates.h"
#include "terminator.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// REDUCE() implementation

#include "flang/Runtime/reduce.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "reduction-templates.h"
#include "terminator.h"
#include "tools.h"
Expand Down
8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/reduction-templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
// * Character-valued reductions (MAXVAL & MINVAL) return arbitrary
// length results, dynamically allocated in a caller-supplied descriptor

#ifndef FORTRAN_FLANG_RT_REDUCTION_TEMPLATES_H_
#define FORTRAN_FLANG_RT_REDUCTION_TEMPLATES_H_
#ifndef FLANGRT_REDUCTION_TEMPLATES_H_
#define FLANGRT_REDUCTION_TEMPLATES_H_

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

} // namespace Fortran::runtime
#endif /* FORTRAN_FLANG_RT_REDUCTION_TEMPLATES_H_ */
#endif /* FLANGRT_REDUCTION_TEMPLATES_H_ */
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// NORM2, MAXLOC, MINLOC, MAXVAL, and MINVAL are in extrema.cpp.

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

Expand Down
8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
// It is a list based stack with dynamic allocation/deallocation
// of the list nodes.

#ifndef FORTRAN_FLANG_RT_STACK_H_
#define FORTRAN_FLANG_RT_STACK_H_
#ifndef FLANGRT_STACK_H_
#define FLANGRT_STACK_H_

#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/memory.h"
#include "terminator.h"

namespace Fortran::runtime {
Expand Down Expand Up @@ -133,4 +133,4 @@ template <typename T, unsigned N = 0> class Stack : public StackStorage<T, N> {
Terminator &terminator_;
};
} // namespace Fortran::runtime
#endif /* FORTRAN_FLANG_RT_STACK_H_ */
#endif /* FLANGRT_STACK_H_ */
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/stat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "stat.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "terminator.h"
#include "tools.h"

Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "flang/Runtime/support.h"
#include "ISO_Fortran_util.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "type-info.h"

namespace Fortran::runtime {
Expand Down
4 changes: 2 additions & 2 deletions flang-rt/lib/flang_rt/temporary-stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// temporaries. For use in HLFIR lowering.

#include "flang/Runtime/temporary-stack.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/memory.h"
#include "terminator.h"
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
#include "flang/Runtime/assign.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/time-intrinsic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Implements time-related intrinsic subroutines.

#include "flang/Runtime/time-intrinsic.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Runtime/cpp-type.h"
Expand Down
10 changes: 5 additions & 5 deletions flang-rt/lib/flang_rt/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_FLANG_RT_TOOLS_H_
#define FORTRAN_FLANG_RT_TOOLS_H_
#ifndef FLANGRT_TOOLS_H_
#define FLANGRT_TOOLS_H_

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/memory.h"
#include "stat.h"
#include "terminator.h"
#include "flang/Common/optional.h"
Expand Down Expand Up @@ -535,4 +535,4 @@ RT_API_ATTRS void CreatePartialReductionResult(Descriptor &result,
const char *intrinsic, TypeCode);

} // namespace Fortran::runtime
#endif /* FORTRAN_FLANG_RT_TOOLS_H_ */
#endif /* FLANGRT_TOOLS_H_ */
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/transformational.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "flang/Runtime/transformational.h"
#include "copy.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "terminator.h"
#include "tools.h"
#include "flang/Common/float128.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/lib/flang_rt/type-code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/type-code.h"
#include <cstdint>

namespace Fortran::runtime {
Expand Down
8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/type-info.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_FLANG_RT_TYPE_INFO_H_
#define FORTRAN_FLANG_RT_TYPE_INFO_H_
#ifndef FLANGRT_TYPE_INFO_H_
#define FLANGRT_TYPE_INFO_H_

// A C++ perspective of the derived type description schemata in
// flang/module/__fortran_type_info.f90.

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "terminator.h"
#include "flang/Common/Fortran-consts.h"
#include "flang/Common/bit-population-count.h"
Expand Down Expand Up @@ -321,4 +321,4 @@ class DerivedType {
};

} // namespace Fortran::runtime::typeInfo
#endif /* FORTRAN_FLANG_RT_TYPE_INFO_H_ */
#endif /* FLANGRT_TYPE_INFO_H_ */
8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/unit-map.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// Maps Fortran unit numbers to their ExternalFileUnit instances.
// A simple hash table with forward-linked chains per bucket.

#ifndef FORTRAN_FLANG_RT_UNIT_MAP_H_
#define FORTRAN_FLANG_RT_UNIT_MAP_H_
#ifndef FLANGRT_UNIT_MAP_H_
#define FLANGRT_UNIT_MAP_H_

#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/memory.h"
#include "lock.h"
#include "unit.h"
#include "flang/Common/fast-int-set.h"
Expand Down Expand Up @@ -100,4 +100,4 @@ class UnitMap {
int emergencyNewUnit_{maxNewUnits_}; // not recycled
};
} // namespace Fortran::runtime::io
#endif /* FORTRAN_FLANG_RT_UNIT_MAP_H_ */
#endif /* FLANGRT_UNIT_MAP_H_ */
8 changes: 4 additions & 4 deletions flang-rt/lib/flang_rt/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

// Fortran external I/O units

#ifndef FORTRAN_FLANG_RT_UNIT_H_
#define FORTRAN_FLANG_RT_UNIT_H_
#ifndef FLANGRT_UNIT_H_
#define FLANGRT_UNIT_H_

#include "buffer.h"
#include "connection.h"
#include "environment.h"
#include "file.h"
#include "flang-rt/flang_rt/memory.h"
#include "flang-rt/memory.h"
#include "format.h"
#include "io-error.h"
#include "io-stmt.h"
Expand Down Expand Up @@ -291,4 +291,4 @@ class ChildIo {
};

} // namespace Fortran::runtime::io
#endif /* FORTRAN_FLANG_RT_UNIT_H_ */
#endif /* FLANGRT_UNIT_H_ */
2 changes: 1 addition & 1 deletion flang-rt/unittests/Evaluate/ISO-Fortran-binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
#include "flang/Testing/testing.h"
#include "llvm/Support/raw_ostream.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Evaluate/reshape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "flang/Runtime/transformational.h"
#include "flang/Testing/testing.h"
#include <cinttypes>
Expand Down
6 changes: 3 additions & 3 deletions flang-rt/unittests/Runtime/ArrayConstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/array-constructor.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/array-constructor.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/type-code.h"
#include "gtest/gtest.h"
#include "tools.h"
#include "flang/Runtime/allocatable.h"
Expand Down
6 changes: 3 additions & 3 deletions flang-rt/unittests/Runtime/CUDA/AllocatorCUF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//

#include "cuda_runtime.h"
#include "flang-rt/flang_rt/allocator-registry.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/CUDA/allocator.h"
#include "flang-rt/allocator-registry.h"
#include "flang-rt/descriptor.h"
#include "gtest/gtest.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"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/CharacterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// in Fortran.

#include "flang/Runtime/character.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "gtest/gtest.h"
#include <cstring>
#include <functional>
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/CommandTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/command.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "flang/Runtime/execute.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/Derived.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "gtest/gtest.h"
#include "tools.h"
#include "flang/Runtime/derived-api.h"
Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/ExternalIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
//===----------------------------------------------------------------------===//

#include "CrashHandlerFixture.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/io-api-funcs.h"
#include "gtest/gtest.h"
#include "flang/Runtime/main.h"
#include "flang/Runtime/stop.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/Inquiry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/inquiry.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/type-code.h"
#include "gtest/gtest.h"
#include "tools.h"

Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/ListInputTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "CrashHandlerFixture.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/io-api-funcs.h"
#include "../../lib/flang_rt/io-error.h"

using namespace Fortran::runtime;
Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/LogicalFormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "CrashHandlerFixture.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/io-api-funcs.h"
#include <algorithm>
#include <array>
#include <cstring>
Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/Matmul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/matmul.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/type-code.h"
#include "gtest/gtest.h"
#include "tools.h"
#include "flang/Runtime/allocatable.h"
Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/MatmulTranspose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/type-code.h"
#include "gtest/gtest.h"
#include "tools.h"
#include "flang/Runtime/allocatable.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/MiscIntrinsic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "gtest/gtest.h"
#include "tools.h"
#include "flang/Runtime/allocatable.h"
Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/Namelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../../lib/flang_rt/namelist.h"
#include "CrashHandlerFixture.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/io-api-funcs.h"
#include "tools.h"
#include <algorithm>
#include <cinttypes>
Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/NumericalFormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "CrashHandlerFixture.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/io-api-funcs.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/io-api-funcs.h"
#include <algorithm>
#include <array>
#include <cstring>
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/Pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/pointer.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "gtest/gtest.h"
#include "tools.h"

Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/Random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/random.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/type-code.h"
#include "gtest/gtest.h"
#include <cmath>

Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/Reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/reduction.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/type-code.h"
#include "gtest/gtest.h"
#include "tools.h"
#include "flang/Common/float128.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/Support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/support.h"
#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/descriptor.h"
#include "gtest/gtest.h"
#include "tools.h"

Expand Down
4 changes: 2 additions & 2 deletions flang-rt/unittests/Runtime/TemporaryStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/type-code.h"
#include "gtest/gtest.h"
#include "tools.h"
#include "flang/Common/ISO_Fortran_binding_wrapper.h"
Expand Down
2 changes: 1 addition & 1 deletion flang-rt/unittests/Runtime/Transformational.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "flang/Runtime/transformational.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/type-code.h"
#include "gtest/gtest.h"
#include "tools.h"
#include "flang/Common/float128.h"
Expand Down
10 changes: 5 additions & 5 deletions flang-rt/unittests/Runtime/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
//
//===----------------------------------------------------------------------===//

#ifndef FORTRAN_UNITTESTS_RUNTIME_TOOLS_H_
#define FORTRAN_UNITTESTS_RUNTIME_TOOLS_H_
#ifndef FLANGRT_UNITTESTS_RUNTIME_TOOLS_H_
#define FLANGRT_UNITTESTS_RUNTIME_TOOLS_H_

#include "flang-rt/flang_rt/descriptor.h"
#include "flang-rt/flang_rt/type-code.h"
#include "flang-rt/descriptor.h"
#include "flang-rt/type-code.h"
#include "gtest/gtest.h"
#include "flang/Runtime/allocatable.h"
#include "flang/Runtime/cpp-type.h"
Expand Down Expand Up @@ -54,4 +54,4 @@ static OwningPtr<Descriptor> MakeArray(const std::vector<int> &shape,
}

} // namespace Fortran::runtime
#endif /* FORTRAN_UNITTESTS_RUNTIME_TOOLS_H_ */
#endif /* FLANGRT_UNITTESTS_RUNTIME_TOOLS_H_ */
6 changes: 6 additions & 0 deletions llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ if ("flang" IN_LIST LLVM_ENABLE_PROJECTS)
endif()
endif()

if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
if (NOT "flang" IN_LIST LLVM_ENABLE_PROJECTS)
message(FATAL_ERROR "Flang is not enabled, but is required for the Flang-RT runtime")
endif ()
endif ()

# Select the runtimes to build
#
# As we migrate runtimes to using the bootstrapping build, the set of default runtimes
Expand Down
21 changes: 10 additions & 11 deletions llvm/runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ function(builtin_register_target compiler_rt_path name)
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON
-DLLVM_CMAKE_DIR=${CMAKE_BINARY_DIR}
-DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_Fortran_COMPILER_WORKS=ON
-DCMAKE_ASM_COMPILER_WORKS=ON
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
${COMMON_CMAKE_ARGS}
Expand Down Expand Up @@ -232,7 +231,7 @@ foreach(entry ${runtimes})
endforeach()

function(runtime_default_target)
cmake_parse_arguments(ARG "" "" "DEPENDS;CMAKE_ARGS;PREFIXES" ${ARGN})
cmake_parse_arguments(ARG "" "" "DEPENDS;CMAKE_ARGS;PREFIXES;EXTRA_ARGS" ${ARGN})

include(${LLVM_BINARY_DIR}/runtimes/Components.cmake OPTIONAL)
set(SUB_CHECK_TARGETS ${SUB_CHECK_TARGETS} PARENT_SCOPE)
Expand Down Expand Up @@ -263,7 +262,6 @@ function(runtime_default_target)
llvm_ExternalProject_Add(runtimes
${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes
DEPENDS ${ARG_DEPENDS}
${enable_fortran}
# Builtins were built separately above
CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
-DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
Expand Down Expand Up @@ -291,7 +289,7 @@ function(runtime_default_target)
USE_TOOLCHAIN
TARGET_TRIPLE ${LLVM_TARGET_TRIPLE}
FOLDER "Runtimes"
${EXTRA_ARGS})
${EXTRA_ARGS} ${ARG_EXTRA_ARGS})
endfunction()

# runtime_register_target(name)
Expand Down Expand Up @@ -401,7 +399,6 @@ function(runtime_register_target name)
llvm_ExternalProject_Add(runtimes-${name}
${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes
DEPENDS ${ARG_DEPENDS}
${enable_fortran}
# Builtins were built separately above
CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=OFF
-DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
Expand Down Expand Up @@ -469,7 +466,7 @@ if(build_runtimes)
# together in a single CMake invocation.
set(extra_deps "")
set(extra_cmake_args "")
set(enable_fortran "")
set(extra_args "")

if(LLVM_INCLUDE_TESTS)
foreach(dep FileCheck
Expand Down Expand Up @@ -574,21 +571,23 @@ if(build_runtimes)
list(APPEND extra_cmake_args "-DLLVM_LIBC_FULL_BUILD=ON")
endif()
if("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
set(enable_fortran ENABLE_FORTRAN)
list(APPEND extra_args ENABLE_FORTRAN)
endif ()

if(NOT LLVM_RUNTIME_TARGETS)
runtime_default_target(
DEPENDS ${builtins_dep} ${extra_deps}
CMAKE_ARGS ${extra_cmake_args}
PREFIXES ${prefixes})
PREFIXES ${prefixes}
EXTRA_ARGS ${extra_args})
set(test_targets check-runtimes)
else()
if("default" IN_LIST LLVM_RUNTIME_TARGETS)
runtime_default_target(
DEPENDS ${builtins_dep} ${extra_deps}
CMAKE_ARGS ${extra_cmake_args}
PREFIXES ${prefixes})
PREFIXES ${prefixes}
EXTRA_ARGS ${extra_args})
list(REMOVE_ITEM LLVM_RUNTIME_TARGETS "default")
else()
add_custom_target(runtimes)
Expand Down Expand Up @@ -635,7 +634,7 @@ if(build_runtimes)
runtime_register_target(${name}
DEPENDS ${builtins_dep_name} ${extra_deps}
CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name} ${extra_cmake_args}
EXTRA_ARGS TARGET_TRIPLE ${name})
EXTRA_ARGS TARGET_TRIPLE ${name} ${extra_args})
endforeach()

foreach(multilib ${LLVM_RUNTIME_MULTILIBS})
Expand All @@ -646,7 +645,7 @@ if(build_runtimes)
-DLLVM_RUNTIMES_PREFIX=${name}/
-DLLVM_RUNTIMES_LIBDIR_SUBDIR=${multilib}
BASE_NAME ${name}
EXTRA_ARGS TARGET_TRIPLE ${name})
EXTRA_ARGS TARGET_TRIPLE ${name} ${extra_args})
endforeach()
endforeach()
endif()
Expand Down