1212// Fortran language concepts that are used in many phases are defined
1313// once here to avoid redundancy and needless translation.
1414
15+ #include " flang/Common/Fortran-consts.h"
1516#include " enum-set.h"
1617#include " idioms.h"
1718#include < cinttypes>
2122namespace Fortran ::common {
2223class LanguageFeatureControl ;
2324
24- // Fortran has five kinds of intrinsic data types, plus the derived types.
25- ENUM_CLASS (TypeCategory, Integer, Real, Complex, Character, Logical, Derived)
26- ENUM_CLASS (VectorElementCategory, Integer, Unsigned, Real)
27-
2825constexpr bool IsNumericTypeCategory (TypeCategory category) {
2926 return category == TypeCategory::Integer || category == TypeCategory::Real ||
3027 category == TypeCategory::Complex;
@@ -47,9 +44,6 @@ const char *AsFortran(RelationalOperator);
4744
4845ENUM_CLASS (Intent, Default, In, Out, InOut)
4946
50- ENUM_CLASS (IoStmtKind, None, Backspace, Close, Endfile, Flush, Inquire, Open,
51- Print, Read, Rewind, Wait, Write)
52-
5347// Union of specifiers for all I/O statements.
5448ENUM_CLASS (IoSpecKind, Access, Action, Advance, Asynchronous, Blank, Decimal,
5549 Delim, Direct, Encoding, End, Eor, Err, Exist, File, Fmt, Form, Formatted,
@@ -61,29 +55,11 @@ ENUM_CLASS(IoSpecKind, Access, Action, Advance, Asynchronous, Blank, Decimal,
6155 Dispose, // nonstandard
6256)
6357
64- // Defined I/O variants
65- ENUM_CLASS (
66- DefinedIo, ReadFormatted, ReadUnformatted, WriteFormatted, WriteUnformatted)
6758const char *AsFortran (DefinedIo);
6859
69- // Floating-point rounding modes; these are packed into a byte to save
70- // room in the runtime's format processing context structure. These
71- // enumerators are defined with the corresponding values returned from
72- // llvm.get.rounding.
73- enum class RoundingMode : std::uint8_t {
74- ToZero, // ROUND=ZERO, RZ - truncation
75- TiesToEven, // ROUND=NEAREST, RN - default IEEE rounding
76- Up, // ROUND=UP, RU
77- Down, // ROUND=DOWN, RD
78- TiesAwayFromZero, // ROUND=COMPATIBLE, RC - ties round away from zero
79- };
80-
8160// Fortran label. Must be in [1..99999].
8261using Label = std::uint64_t ;
8362
84- // Fortran arrays may have up to 15 dimensions (See Fortran 2018 section 5.4.6).
85- static constexpr int maxRank{15 };
86-
8763// CUDA subprogram attribute combinations
8864ENUM_CLASS (CUDASubprogramAttrs, Host, Device, HostDevice, Global, Grid_Global)
8965
0 commit comments