Lines Matching full:scope
1 //===--- JumpDiagnostics.cpp - Protected scope jump analysis ------*- C++ -*-=//
10 // jumps that enter a protected scope in an invalid way.
42 /// are taken to handle incomplete scope information.
46 /// scopes that are introduced by VLAs and other things that scope jumps like
47 /// gotos. This scope tree has nothing to do with the source scope tree,
51 /// ParentScope - The index in ScopeMap of the parent scope. This is 0 for
52 /// the parent scope is the function body.
55 /// InDiag - The note to emit if there is a jump into this scope.
59 /// of this scope. Direct jumps always clean up their current scope
108 // Add a scope entry for function scope.
112 // defined scope record for every "goto" and label.
122 /// GetDeepestCommonScope - Finds the innermost scope enclosing the
141 /// GetDiagForGotoScopeDecl - If this decl induces a new goto scope, return a
187 // storage duration is not in scope to a point where it is in scope
195 // with automatic storage duration is not in scope to a point
196 // where it is in scope is ill-formed unless the variable has
232 /// Build scope information for a declaration that is part of a DeclStmt.
234 // If this decl causes a new scope, push and switch to it.
243 // scope we just installed.
249 /// Build scope information for a captured block literal variables.
290 /// Build scope information for compound literals of C struct types that are
301 /// coherent VLA scope with a specified parent node. Walk through the
307 // propagate out into the enclosing scope. Otherwise we have to worry
315 // If we found a label, remember that it is in ParentScope scope.
332 // to a normal goto. In addition, we don't calculate scope in the
345 // before entering the scope of the switch statement.
363 // Remember both what scope a goto is in as well as the fact that we have
461 // If this is a declstmt with a VLA definition, it defines a scope from here
464 // The decl statement creates a scope if any of the decls in it are VLAs
487 // Disallow jumps into any part of an @try statement by pushing a scope and
488 // walking all sub-stmts in that scope.
530 // evaluated in the normal scope.
534 // scope.
548 // new scope.
642 // Cases, labels, and defaults aren't "scope parents". It's also
682 // If an asm goto jumps to a different scope, things like destructors or
753 // Collect a single representative of every scope containing an indirect
772 // Collect a single representative of every scope containing a
774 // For most code bases, there will be only one such scope.
784 // For each target scope, make sure it's trivially reachable from
785 // every scope containing a jump site.
789 // of scopes S from which the target scope can be trivially
790 // entered, then verify that every jump scope can be trivially
791 // exitted to reach a scope in S.
797 // into the target scope. 'Min' will end up being the index of
798 // the shallowest such scope.
803 // Don't go beyond the outermost scope.
806 // Stop if we can't trivially enter the current scope.
813 // reach this label scope.
815 unsigned Scope = JumpScope;
816 // Walk out the "scope chain" for this scope, looking for a scope
823 if (Reachable.test(Scope)) {
826 for (unsigned S = JumpScope; S != Scope; S = Scopes[S].ParentScope)
832 // Don't walk out if we've reached the top-level scope or we've
833 // gotten shallower than the shallowest reachable scope.
834 if (Scope == 0 || Scope < Min) break;
837 if (Scopes[Scope].OutDiag) break;
839 Scope = Scopes[Scope].ParentScope;
878 /// Produce note diagnostics for a jump into a protected scope.
897 // Walk out the scope chain until we reach the common ancestor.
928 /// jumping within or out of its current scope, not into a deeper one.
940 // Common case: exactly the same scope, which is fine.
946 // less nested scope. Check if it crosses a __finally along the way.
967 // It's okay to jump out from a nested scope.