Skip to content

Commit f2bef56

Browse files
committed
Revert "[flang] Restructure runtime to avoid recursion (relanding) (llvm#143993)"
This reverts commit 2bf3cca.
1 parent 2e1e941 commit f2bef56

32 files changed

+1174
-2352
lines changed

flang-rt/include/flang-rt/runtime/environment.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ struct ExecutionEnvironment {
6464
bool defaultUTF8{false}; // DEFAULT_UTF8
6565
bool checkPointerDeallocation{true}; // FORT_CHECK_POINTER_DEALLOCATION
6666

67-
enum InternalDebugging { WorkQueue = 1 };
68-
int internalDebugging{0}; // FLANG_RT_DEBUG
69-
7067
// CUDA related variables
7168
std::size_t cudaStackLimit{0}; // ACC_OFFLOAD_STACK_SIZE
7269
bool cudaDeviceIsManaged{false}; // NV_CUDAFOR_DEVICE_IS_MANAGED

flang-rt/include/flang-rt/runtime/stat.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Terminator;
2424
enum Stat {
2525
StatOk = 0, // required to be zero by Fortran
2626

27-
// Interoperable STAT= codes (>= 11)
27+
// Interoperable STAT= codes
2828
StatBaseNull = CFI_ERROR_BASE_ADDR_NULL,
2929
StatBaseNotNull = CFI_ERROR_BASE_ADDR_NOT_NULL,
3030
StatInvalidElemLen = CFI_INVALID_ELEM_LEN,
@@ -36,7 +36,7 @@ enum Stat {
3636
StatMemAllocation = CFI_ERROR_MEM_ALLOCATION,
3737
StatOutOfBounds = CFI_ERROR_OUT_OF_BOUNDS,
3838

39-
// Standard STAT= values (>= 101)
39+
// Standard STAT= values
4040
StatFailedImage = FORTRAN_RUNTIME_STAT_FAILED_IMAGE,
4141
StatLocked = FORTRAN_RUNTIME_STAT_LOCKED,
4242
StatLockedOtherImage = FORTRAN_RUNTIME_STAT_LOCKED_OTHER_IMAGE,
@@ -49,14 +49,10 @@ enum Stat {
4949
// Additional "processor-defined" STAT= values
5050
StatInvalidArgumentNumber = FORTRAN_RUNTIME_STAT_INVALID_ARG_NUMBER,
5151
StatMissingArgument = FORTRAN_RUNTIME_STAT_MISSING_ARG,
52-
StatValueTooShort = FORTRAN_RUNTIME_STAT_VALUE_TOO_SHORT, // -1
52+
StatValueTooShort = FORTRAN_RUNTIME_STAT_VALUE_TOO_SHORT,
5353
StatMoveAllocSameAllocatable =
5454
FORTRAN_RUNTIME_STAT_MOVE_ALLOC_SAME_ALLOCATABLE,
5555
StatBadPointerDeallocation = FORTRAN_RUNTIME_STAT_BAD_POINTER_DEALLOCATION,
56-
57-
// Dummy status for work queue continuation, declared here to perhaps
58-
// avoid collisions
59-
StatContinue = 201
6056
};
6157

6258
RT_API_ATTRS const char *StatErrorString(int);

flang-rt/include/flang-rt/runtime/type-info.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,12 @@ class SpecialBinding {
154154
RT_API_ATTRS bool IsArgDescriptor(int zeroBasedArg) const {
155155
return (isArgDescriptorSet_ >> zeroBasedArg) & 1;
156156
}
157-
RT_API_ATTRS bool IsTypeBound() const { return isTypeBound_ != 0; }
157+
RT_API_ATTRS bool isTypeBound() const { return isTypeBound_; }
158158
RT_API_ATTRS bool IsArgContiguous(int zeroBasedArg) const {
159159
return (isArgContiguousSet_ >> zeroBasedArg) & 1;
160160
}
161-
template <typename PROC>
162-
RT_API_ATTRS PROC GetProc(const Binding *bindings = nullptr) const {
163-
if (bindings && isTypeBound_ > 0) {
164-
return reinterpret_cast<PROC>(bindings[isTypeBound_ - 1].proc);
165-
} else {
166-
return reinterpret_cast<PROC>(proc_);
167-
}
161+
template <typename PROC> RT_API_ATTRS PROC GetProc() const {
162+
return reinterpret_cast<PROC>(proc_);
168163
}
169164

170165
FILE *Dump(FILE *) const;
@@ -198,8 +193,6 @@ class SpecialBinding {
198193
// When false, the defined I/O subroutine must have been
199194
// called via a generic interface, not a generic TBP.
200195
std::uint8_t isArgDescriptorSet_{0};
201-
// When a special binding is type-bound, this is its binding's index (plus 1,
202-
// so that 0 signifies that it's not type-bound).
203196
std::uint8_t isTypeBound_{0};
204197
// True when a FINAL subroutine has a dummy argument that is an array that
205198
// is CONTIGUOUS or neither assumed-rank nor assumed-shape.
@@ -247,7 +240,6 @@ class DerivedType {
247240
RT_API_ATTRS bool noFinalizationNeeded() const {
248241
return noFinalizationNeeded_;
249242
}
250-
RT_API_ATTRS bool noDefinedAssignment() const { return noDefinedAssignment_; }
251243

252244
RT_API_ATTRS std::size_t LenParameters() const {
253245
return lenParameterKind().Elements();
@@ -330,7 +322,6 @@ class DerivedType {
330322
bool noInitializationNeeded_{false};
331323
bool noDestructionNeeded_{false};
332324
bool noFinalizationNeeded_{false};
333-
bool noDefinedAssignment_{false};
334325
};
335326

336327
} // namespace Fortran::runtime::typeInfo

0 commit comments

Comments
 (0)