Skip to content

Commit dadf669

Browse files
Moved Scope::FindCommonBlock() and Scope::FindCommonBlockUse() implementations to .cpp file
1 parent e7370be commit dadf669

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

flang/include/flang/Semantics/scope.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -198,21 +198,10 @@ class Scope {
198198
const SourceName &name, Attrs attrs, Symbol &cbUltimate);
199199

200200
// Find COMMON block that is declared in the current scope
201-
Symbol *FindCommonBlock(const SourceName &name) const {
202-
if (const auto it{commonBlocks_.find(name)}; it != commonBlocks_.end()) {
203-
return &*it->second;
204-
}
205-
return nullptr;
206-
}
201+
Symbol *FindCommonBlock(const SourceName &name) const;
207202

208203
// Find USE-associated COMMON block in the current scope
209-
Symbol *FindCommonBlockUse(const SourceName &name) const {
210-
if (const auto it{commonBlockUses_.find(name)};
211-
it != commonBlockUses_.end()) {
212-
return &*it->second;
213-
}
214-
return nullptr;
215-
}
204+
Symbol *FindCommonBlockUse(const SourceName &name) const;
216205

217206
// Find COMMON block in current and surrounding scopes, follow USE
218207
// associations

flang/lib/Semantics/scope.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,21 @@ bool Scope::AddCommonBlockUse(
192192
return commonBlockUses_.emplace(name, useCB).second;
193193
}
194194

195+
Symbol *Scope::FindCommonBlock(const SourceName &name) const {
196+
if (const auto it{commonBlocks_.find(name)}; it != commonBlocks_.end()) {
197+
return &*it->second;
198+
}
199+
return nullptr;
200+
}
201+
202+
Symbol *Scope::FindCommonBlockUse(const SourceName &name) const {
203+
if (const auto it{commonBlockUses_.find(name)};
204+
it != commonBlockUses_.end()) {
205+
return &*it->second;
206+
}
207+
return nullptr;
208+
}
209+
195210
bool Scope::AddSubmodule(const SourceName &name, Scope &submodule) {
196211
return submodules_.emplace(name, submodule).second;
197212
}

0 commit comments

Comments
 (0)