Skip to content

[Flang] Move non-Common headers to FortranSupport #124416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
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 "flang/Common/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_ */
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
6 changes: 3 additions & 3 deletions flang/include/flang/Evaluate/call.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#include "constant.h"
#include "formatting.h"
#include "type.h"
#include "flang/Common/Fortran.h"
#include "flang/Common/indirection.h"
#include "flang/Common/reference.h"
#include "flang/Parser/char-block.h"
#include "flang/Semantics/attr.h"
#include "flang/Support/Fortran.h"
#include "flang/Support/indirection.h"
#include "flang/Support/reference.h"
#include <optional>
#include <vector>

Expand Down
6 changes: 3 additions & 3 deletions flang/include/flang/Evaluate/characteristics.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#include "shape.h"
#include "tools.h"
#include "type.h"
#include "flang/Common/Fortran-features.h"
#include "flang/Common/Fortran.h"
#include "flang/Common/enum-set.h"
#include "flang/Common/idioms.h"
#include "flang/Common/indirection.h"
#include "flang/Parser/char-block.h"
#include "flang/Semantics/symbol.h"
#include "flang/Support/Fortran-features.h"
#include "flang/Support/Fortran.h"
#include "flang/Support/indirection.h"
#include <optional>
#include <string>
#include <variant>
Expand Down
8 changes: 4 additions & 4 deletions flang/include/flang/Evaluate/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
#ifndef FORTRAN_EVALUATE_COMMON_H_
#define FORTRAN_EVALUATE_COMMON_H_

#include "flang/Common/Fortran-features.h"
#include "flang/Common/Fortran.h"
#include "flang/Common/default-kinds.h"
#include "flang/Common/enum-set.h"
#include "flang/Common/idioms.h"
#include "flang/Common/indirection.h"
#include "flang/Common/restorer.h"
#include "flang/Common/target-rounding.h"
#include "flang/Parser/char-block.h"
#include "flang/Parser/message.h"
#include "flang/Support/Fortran-features.h"
#include "flang/Support/Fortran.h"
#include "flang/Support/default-kinds.h"
#include "flang/Support/indirection.h"
#include <cinttypes>
#include <map>
#include <set>
Expand Down
4 changes: 2 additions & 2 deletions flang/include/flang/Evaluate/constant.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#include "formatting.h"
#include "type.h"
#include "flang/Common/default-kinds.h"
#include "flang/Common/reference.h"
#include "flang/Support/default-kinds.h"
#include "flang/Support/reference.h"
#include <map>
#include <vector>

Expand Down
6 changes: 3 additions & 3 deletions flang/include/flang/Evaluate/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "formatting.h"
#include "type.h"
#include "variable.h"
#include "flang/Common/Fortran.h"
#include "flang/Common/idioms.h"
#include "flang/Common/indirection.h"
#include "flang/Common/template.h"
#include "flang/Parser/char-block.h"
#include "flang/Support/Fortran.h"
#include "flang/Support/indirection.h"
#include "flang/Support/template.h"
#include <algorithm>
#include <list>
#include <tuple>
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Evaluate/formatting.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// This header is meant to be included by the headers that define the several
// representational class templates that need it, not by external clients.

#include "flang/Common/indirection.h"
#include "flang/Support/indirection.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Evaluate/intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include "call.h"
#include "characteristics.h"
#include "type.h"
#include "flang/Common/default-kinds.h"
#include "flang/Parser/char-block.h"
#include "flang/Parser/message.h"
#include "flang/Support/default-kinds.h"
#include <memory>
#include <optional>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Evaluate/shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "expression.h"
#include "traverse.h"
#include "variable.h"
#include "flang/Common/indirection.h"
#include "flang/Evaluate/type.h"
#include "flang/Support/indirection.h"
#include <optional>
#include <variant>

Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Evaluate/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#ifndef FORTRAN_EVALUATE_TARGET_H_
#define FORTRAN_EVALUATE_TARGET_H_

#include "flang/Common/Fortran.h"
#include "flang/Common/enum-class.h"
#include "flang/Common/enum-set.h"
#include "flang/Common/target-rounding.h"
#include "flang/Evaluate/common.h"
#include "flang/Support/Fortran.h"
#include <cstdint>

namespace Fortran::evaluate {
Expand Down
4 changes: 2 additions & 2 deletions flang/include/flang/Evaluate/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

#include "traverse.h"
#include "flang/Common/idioms.h"
#include "flang/Common/template.h"
#include "flang/Common/unwrap.h"
#include "flang/Evaluate/constant.h"
#include "flang/Evaluate/expression.h"
#include "flang/Evaluate/shape.h"
Expand All @@ -21,6 +19,8 @@
#include "flang/Semantics/attr.h"
#include "flang/Semantics/scope.h"
#include "flang/Semantics/symbol.h"
#include "flang/Support/template.h"
#include "flang/Support/unwrap.h"
#include <array>
#include <optional>
#include <set>
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Evaluate/traverse.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
// expression of an ASSOCIATE (or related) construct entity.

#include "expression.h"
#include "flang/Common/indirection.h"
#include "flang/Semantics/symbol.h"
#include "flang/Semantics/type.h"
#include "flang/Support/indirection.h"
#include <set>
#include <type_traits>

Expand Down
6 changes: 3 additions & 3 deletions flang/include/flang/Evaluate/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#include "integer.h"
#include "logical.h"
#include "real.h"
#include "flang/Common/Fortran-features.h"
#include "flang/Common/Fortran.h"
#include "flang/Common/idioms.h"
#include "flang/Common/real.h"
#include "flang/Common/template.h"
#include "flang/Support/Fortran-features.h"
#include "flang/Support/Fortran.h"
#include "flang/Support/template.h"
#include <cinttypes>
#include <optional>
#include <string>
Expand Down
4 changes: 2 additions & 2 deletions flang/include/flang/Evaluate/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include "static-data.h"
#include "type.h"
#include "flang/Common/idioms.h"
#include "flang/Common/reference.h"
#include "flang/Common/template.h"
#include "flang/Parser/char-block.h"
#include "flang/Support/reference.h"
#include "flang/Support/template.h"
#include <optional>
#include <variant>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Frontend/CompilerInvocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#ifndef FORTRAN_FRONTEND_COMPILERINVOCATION_H
#define FORTRAN_FRONTEND_COMPILERINVOCATION_H

#include "flang/Common/LangOptions.h"
#include "flang/Frontend/CodeGenOptions.h"
#include "flang/Frontend/FrontendOptions.h"
#include "flang/Frontend/PreprocessorOptions.h"
Expand All @@ -22,6 +21,7 @@
#include "flang/Parser/parsing.h"
#include "flang/Semantics/semantics.h"
#include "mlir/Support/Timing.h"
#include "flang/Support/LangOptions.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "llvm/Option/ArgList.h"
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Frontend/FrontendOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
#ifndef FORTRAN_FRONTEND_FRONTENDOPTIONS_H
#define FORTRAN_FRONTEND_FRONTENDOPTIONS_H

#include "flang/Common/Fortran-features.h"
#include "flang/Lower/EnvironmentDefault.h"
#include "flang/Parser/characters.h"
#include "flang/Parser/unparse.h"
#include "flang/Support/Fortran-features.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/MemoryBuffer.h"
#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/ISO_Fortran_binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* 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 <stddef.h>
#define FORTRAN_ISO_NAMESPACE_
#endif
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Lower/AbstractConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
#ifndef FORTRAN_LOWER_ABSTRACTCONVERTER_H
#define FORTRAN_LOWER_ABSTRACTCONVERTER_H

#include "flang/Common/Fortran.h"
#include "flang/Lower/LoweringOptions.h"
#include "flang/Lower/PFTDefs.h"
#include "flang/Optimizer/Builder/BoxValue.h"
#include "flang/Optimizer/Dialect/FIRAttr.h"
#include "flang/Semantics/symbol.h"
#include "flang/Support/Fortran.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Operation.h"
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Lower/Bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#ifndef FORTRAN_LOWER_BRIDGE_H
#define FORTRAN_LOWER_BRIDGE_H

#include "flang/Common/Fortran.h"
#include "flang/Frontend/CodeGenOptions.h"
#include "flang/Frontend/TargetOptions.h"
#include "flang/Lower/AbstractConverter.h"
Expand All @@ -22,6 +21,7 @@
#include "flang/Lower/StatementContext.h"
#include "flang/Optimizer/Builder/FIRBuilder.h"
#include "flang/Optimizer/Dialect/Support/KindMapping.h"
#include "flang/Support/Fortran.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/OwningOpRef.h"
#include <set>
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Lower/CallInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#ifndef FORTRAN_LOWER_CALLINTERFACE_H
#define FORTRAN_LOWER_CALLINTERFACE_H

#include "flang/Common/reference.h"
#include "flang/Evaluate/characteristics.h"
#include "flang/Support/reference.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/BuiltinOps.h"
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Lower/ConvertType.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#ifndef FORTRAN_LOWER_CONVERT_TYPE_H
#define FORTRAN_LOWER_CONVERT_TYPE_H

#include "flang/Common/Fortran.h"
#include "flang/Evaluate/type.h"
#include "flang/Support/Fortran.h"
#include "mlir/IR/BuiltinTypes.h"

namespace mlir {
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Lower/LoweringOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef FLANG_LOWER_LOWERINGOPTIONS_H
#define FLANG_LOWER_LOWERINGOPTIONS_H

#include "flang/Common/MathOptionsBase.h"
#include "flang/Support/MathOptionsBase.h"

namespace Fortran::lower {

Expand Down
4 changes: 2 additions & 2 deletions flang/include/flang/Lower/PFTBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
#ifndef FORTRAN_LOWER_PFTBUILDER_H
#define FORTRAN_LOWER_PFTBUILDER_H

#include "flang/Common/reference.h"
#include "flang/Common/template.h"
#include "flang/Lower/HostAssociations.h"
#include "flang/Lower/PFTDefs.h"
#include "flang/Parser/parse-tree.h"
#include "flang/Semantics/attr.h"
#include "flang/Semantics/scope.h"
#include "flang/Semantics/semantics.h"
#include "flang/Semantics/symbol.h"
#include "flang/Support/reference.h"
#include "flang/Support/template.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"

Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Lower/Support/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#ifndef FORTRAN_LOWER_SUPPORT_UTILS_H
#define FORTRAN_LOWER_SUPPORT_UTILS_H

#include "flang/Common/indirection.h"
#include "flang/Parser/char-block.h"
#include "flang/Semantics/tools.h"
#include "flang/Support/indirection.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/BuiltinAttributes.h"
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Lower/SymbolMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
#ifndef FORTRAN_LOWER_SYMBOLMAP_H
#define FORTRAN_LOWER_SYMBOLMAP_H

#include "flang/Common/reference.h"
#include "flang/Optimizer/Builder/BoxValue.h"
#include "flang/Optimizer/Dialect/FIRType.h"
#include "flang/Optimizer/Dialect/FortranVariableInterface.h"
#include "flang/Optimizer/Support/Matcher.h"
#include "flang/Semantics/symbol.h"
#include "flang/Support/reference.h"
#include "mlir/IR/Value.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
Expand Down
2 changes: 1 addition & 1 deletion flang/include/flang/Optimizer/Builder/FIRBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
#ifndef FORTRAN_OPTIMIZER_BUILDER_FIRBUILDER_H
#define FORTRAN_OPTIMIZER_BUILDER_FIRBUILDER_H

#include "flang/Common/MathOptionsBase.h"
#include "flang/Optimizer/Dialect/FIROps.h"
#include "flang/Optimizer/Dialect/FIROpsSupport.h"
#include "flang/Optimizer/Dialect/FIRType.h"
#include "flang/Optimizer/Dialect/Support/FIRContext.h"
#include "flang/Optimizer/Dialect/Support/KindMapping.h"
#include "flang/Support/MathOptionsBase.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "llvm/ADT/DenseMap.h"
Expand Down
Loading
Loading