Skip to content

Commit 037a68e

Browse files
committed
Replace IsSymbolInCommonBlock function
1 parent ebc9192 commit 037a68e

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

flang/lib/Semantics/resolve-directives.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,20 +2901,6 @@ void ResolveOmpTopLevelParts(
29012901
});
29022902
}
29032903

2904-
static bool IsSymbolInCommonBlock(const Symbol &symbol) {
2905-
// TODO Improve the performance of this predicate function.
2906-
// Going through all symbols sequentially, in all common blocks, can be
2907-
// slow when there are many symbols. A possible optimization is to add
2908-
// an OmpInCommonBlock flag to Symbol, to make it possible to quickly
2909-
// test if a given symbol is in a common block.
2910-
for (const auto &cb : symbol.owner().commonBlocks()) {
2911-
if (IsCommonBlockContaining(cb.second.get(), symbol)) {
2912-
return true;
2913-
}
2914-
}
2915-
return false;
2916-
}
2917-
29182904
static bool IsSymbolThreadprivate(const Symbol &symbol) {
29192905
if (const auto *details{symbol.detailsIf<HostAssocDetails>()}) {
29202906
return details->symbol().test(Symbol::Flag::OmpThreadprivate);
@@ -2943,7 +2929,7 @@ static bool IsSymbolPrivate(const Symbol &symbol) {
29432929
case Scope::Kind::BlockConstruct:
29442930
return !symbol.attrs().test(Attr::SAVE) &&
29452931
!symbol.attrs().test(Attr::PARAMETER) && !IsAssumedShape(symbol) &&
2946-
!IsSymbolInCommonBlock(symbol);
2932+
!symbol.flags().test(Symbol::Flag::InCommonBlock);
29472933
default:
29482934
return false;
29492935
}

0 commit comments

Comments
 (0)