Home | History | Annotate | Download | only in Sema

Lines Matching refs:Scope

1 //===--- JumpDiagnostics.cpp - Protected scope jump analysis ------*- C++ -*-=//
11 // jumps that enter a protected scope in an invalid way.
36 /// are taken to handle incomplete scope information.
40 /// scopes that are introduced by VLAs and other things that scope jumps like
41 /// gotos. This scope tree has nothing to do with the source scope tree,
45 /// ParentScope - The index in ScopeMap of the parent scope. This is 0 for
46 /// the parent scope is the function body.
49 /// InDiag - The note to emit if there is a jump into this scope.
53 /// of this scope. Direct jumps always clean up their current scope
97 // Add a scope entry for function scope.
101 // defined scope record for every "goto" and label.
110 /// GetDeepestCommonScope - Finds the innermost scope enclosing the
129 /// GetDiagForGotoScopeDecl - If this decl induces a new goto scope, return a
170 // storage duration is not in scope to a point where it is in scope
178 // with automatic storage duration is not in scope to a point
179 // where it is in scope is ill-formed unless the variable has
215 /// \brief Build scope information for a declaration that is part of a DeclStmt.
217 // If this decl causes a new scope, push and switch to it.
226 // scope we just installed.
232 /// \brief Build scope information for a captured block literal variables.
270 /// coherent VLA scope with a specified parent node. Walk through the
275 // propagate out into the enclosing scope. Otherwise we have to worry
283 // If we found a label, remember that it is in ParentScope scope.
291 // to a normal goto. In addition, we don't calculate scope in the
306 // Evaluate the condition variable before entering the scope of the switch
315 // Remember both what scope a goto is in as well as the fact that we have
386 // Cases, labels, and defaults aren't "scope parents". It's also
404 // If this is a declstmt with a VLA definition, it defines a scope from here
407 // The decl statement creates a scope if any of the decls in it are VLAs
413 // Disallow jumps into any part of an @try statement by pushing a scope and
414 // walking all sub-stmts in that scope.
455 // evaluated in the normal scope.
459 // scope.
473 // new scope.
597 // Collect a single representative of every scope containing an
619 // Collect a single representative of every scope containing a
621 // For most code bases, there will be only one such scope.
634 // For each target scope, make sure it's trivially reachable from
635 // every scope containing a jump site.
639 // of scopes S from which the target scope can be trivially
640 // entered, then verify that every jump scope can be trivially
641 // exitted to reach a scope in S.
651 // into the target scope. 'Min' will end up being the index of
652 // the shallowest such scope.
657 // Don't go beyond the outermost scope.
660 // Stop if we can't trivially enter the current scope.
667 // reach this label scope.
670 unsigned Scope = I->first;
672 // Walk out the "scope chain" for this scope, looking for a scope
679 if (Reachable.test(Scope)) {
682 for (unsigned S = I->first; S != Scope; S = Scopes[S].ParentScope)
688 // Don't walk out if we've reached the top-level scope or we've
689 // gotten shallower than the shallowest reachable scope.
690 if (Scope == 0 || Scope < Min) break;
693 if (Scopes[Scope].OutDiag) break;
695 Scope = Scopes[Scope].ParentScope;
731 /// Produce note diagnostics for a jump into a protected scope.
751 // Walk out the scope chain until we reach the common ancestor.
779 /// jumping within or out of its current scope, not into a deeper one.
791 // Common case: exactly the same scope, which is fine.
797 // less nested scope. Check if it crosses a __finally along the way.
808 // It's okay to jump out from a nested scope.