Skip to content

Commit d61ea03

Browse files
committed
address feedback
1 parent f360dec commit d61ea03

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ class Descriptor {
227227
RT_API_ATTRS bool IsPointer() const {
228228
return raw_.attribute == CFI_attribute_pointer;
229229
}
230-
RT_API_ATTRS bool IsAssociated() const { return raw_.base_addr != nullptr; }
231230
RT_API_ATTRS bool IsAllocatable() const {
232231
return raw_.attribute == CFI_attribute_allocatable;
233232
}

flang-rt/lib/runtime/derived-api.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,9 @@ bool RTDEF(ExtendsTypeOf)(const Descriptor &a, const Descriptor &mold) {
124124
// F'23 16.9.86 p 5
125125
// If MOLD is unlimited polymorphic and is either a disassociated pointer or
126126
// unallocated allocatable variable, the result is true;
127-
if ((mold.IsPointer() && !mold.IsAssociated()) ||
128-
(mold.IsAllocatable() && !mold.IsAllocated())) {
127+
if ((mold.IsPointer() || mold.IsAllocatable()) && !mold.IsAllocated()) {
129128
return true;
130-
} else if ((a.IsPointer() && !a.IsAssociated()) ||
131-
(a.IsAllocatable() && !a.IsAllocated())) {
129+
} else if ((a.IsPointer() || a.IsAllocatable()) && !a.IsAllocated()) {
132130
return false;
133131
}
134132
auto aType{a.raw().type};

flang-rt/lib/runtime/pointer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ int RTDEF(PointerDeallocatePolymorphic)(Descriptor &pointer,
259259
}
260260

261261
bool RTDEF(PointerIsAssociated)(const Descriptor &pointer) {
262-
return pointer.IsAssociated();
262+
return pointer.raw().base_addr != nullptr;
263263
}
264264

265265
bool RTDEF(PointerIsAssociatedWith)(

0 commit comments

Comments
 (0)