Skip to content

Commit f0c5a4d

Browse files
committed
[flang] Fix shared library build
A recent patch introduced a dependency upon Semantics from Evaluate; fixing immediately.
1 parent 864133c commit f0c5a4d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

flang/lib/Evaluate/type.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,15 @@ static const semantics::Symbol *FindParentComponent(
215215
}
216216
if (scope) {
217217
const auto &dtDetails{typeSymbol.get<semantics::DerivedTypeDetails>()};
218-
return dtDetails.GetParentComponent(*scope);
218+
// TODO: Combine with semantics::DerivedTypeDetails::GetParentComponent
219+
if (auto extends{dtDetails.GetParentComponentName()}) {
220+
if (auto iter{scope->find(*extends)}; iter != scope->cend()) {
221+
if (const semantics::Symbol & symbol{*iter->second};
222+
symbol.test(semantics::Symbol::Flag::ParentComp)) {
223+
return &symbol;
224+
}
225+
}
226+
}
219227
}
220228
return nullptr;
221229
}

0 commit comments

Comments
 (0)