Lines Matching defs:scope
15 #include "flang/Semantics/scope.h"
27 // Find this or containing scope that matches predicate
30 for (const Scope *scope{&start};; scope = &scope->parent()) {
31 if (predicate(*scope)) {
32 return scope;
34 if (scope->IsTopLevel()) {
43 start, [](const Scope &scope) { return scope.parent().IsTopLevel(); }));
52 start, [](const Scope &scope) { return scope.IsModule(); });
56 return FindScopeContaining(start, [](const Scope &scope) {
57 return scope.IsModule() || scope.IsSubmodule();
63 start, [](const Scope &scope) { return scope.IsModuleFile(); });
68 return DEREF(FindScopeContaining(start, [](const Scope &scope) {
69 switch (scope.kind()) {
87 return DEREF(FindScopeContaining(start, [](const Scope &scope) {
88 switch (scope.kind()) {
112 const Scope &scope{GetProgramUnitContaining(start)};
113 return IsPureProcedure(scope) ? &scope : nullptr;
117 const Scope *FindOpenACCConstructContaining(const Scope *scope) {
118 return scope ? FindScopeContaining(*scope,
241 bool IsUseAssociated(const Symbol &symbol, const Scope &scope) {
244 owner != GetTopLevelUnitContaining(scope);
251 [&](const Scope &scope) { return &scope == maybeAncestor; });
268 bool IsHostAssociated(const Symbol &symbol, const Scope &scope) {
272 GetProgramUnitOrBlockConstructContaining(scope));
275 bool IsHostAssociatedIntoSubprogram(const Symbol &symbol, const Scope &scope) {
279 GetProgramUnitContaining(scope));
312 bool IsBindCProcedure(const Scope &scope) {
313 if (const Symbol * symbol{scope.GetSymbol()}) {
321 const Scope &scope, std::set<const Scope *> &visited) {
322 if (!scope.IsDerivedType()) {
325 if (!visited.insert(&scope).second) {
330 for (const auto &pair : scope) {
336 for (const auto &pair : scope) {
341 if (const Scope * nested{derived->scope()}) {
354 const Symbol *FindPointerComponent(const Scope &scope) {
356 return FindPointerComponent(scope, visited);
360 if (const Scope * scope{derived.scope()}) {
361 return FindPointerComponent(*scope);
385 const Symbol &object, const Scope &scope, bool isPointerDefinition) {
400 &GetProgramUnitContaining(scope)) {
549 if (const Scope * parentScope{parentDerived->typeSymbol().scope()}) {
609 const DeclTypeSpec *FindParentTypeSpec(const Scope &scope) {
610 if (scope.kind() == Scope::Kind::DerivedType) {
611 if (const auto *symbol{scope.symbol()}) {
619 if (const Scope * scope{symbol.scope()}) {
621 if (const Symbol * parent{details->GetParentComponent(*scope)}) {
906 std::list<std::list<SymbolRef>> GetStorageAssociations(const Scope &scope) {
908 for (const EquivalenceSet &set : scope.equivalenceSets()) {
1115 const Scope *FindCUDADeviceContext(const Scope *scope) {
1116 return !scope ? nullptr : FindScopeContaining(*scope, [](const Scope &s) {
1127 bool IsAccessible(const Symbol &original, const Scope &scope) {
1131 return !module || module->Contains(scope);
1138 const Scope &scope, const Symbol &symbol) {
1139 if (IsAccessible(symbol, scope)) {
1141 } else if (FindModuleFileContaining(scope)) {
1175 Scope &scope, DerivedTypeSpec &&spec, DeclTypeSpec::Category category) {
1176 spec.EvaluateParameters(scope.context());
1178 type{scope.FindInstantiatedDerivedType(spec, category)}) {
1183 DeclTypeSpec &type{scope.MakeDerivedType(category, std::move(spec))};
1184 type.derivedTypeSpec().Instantiate(scope);
1350 const Scope &scope{deepest.GetScope()};
1351 auto scopeIter{scope.find(*nameIterator++)};
1352 if (scopeIter != scope.cend()) {
1481 if (const Scope * scope{type.scope()}) {
1483 for (const auto &pair : *scope) {
1658 const Scope *scope) {
1659 if (const Scope * dtScope{derived.scope()}) {
1672 if (scope) {
1675 for (; scope && !scope->IsGlobal(); scope = &scope->parent()) {
1676 auto iter{scope->find(name)};
1677 if (iter != scope->end()) {
1694 return parentType && HasDefinedIo(which, *parentType, scope);