Home | History | Annotate | Download | only in Sema

Lines Matching defs:Scopes

28 /// into VLA and other protected scopes.  For example, this rejects:
33 /// We also detect jumps out of protected scopes when it's not possible to do
45 /// scopes that are introduced by VLAs and other things that scope jumps like
47 /// because you can have multiple VLA scopes per compound statement, and most
48 /// compound statements don't introduce any scopes.
70 SmallVector<GotoScope, 48> Scopes;
109 Scopes.push_back(GotoScope(~0U, ~0U, ~0U, SourceLocation()));
124 /// two scopes.
127 // Inner scopes are created after outer scopes and therefore have
130 assert(Scopes[B].ParentScope < B);
131 B = Scopes[B].ParentScope;
133 assert(Scopes[A].ParentScope < A);
134 A = Scopes[A].ParentScope;
237 Scopes.push_back(GotoScope(ParentScope, Diags.first, Diags.second,
239 ParentScope = Scopes.size()-1;
284 Scopes.push_back(GotoScope(ParentScope,
286 ParentScope = Scopes.size()-1;
296 Scopes.push_back(GotoScope(ParentScope, InDiag, OutDiag, CLE->getExprLoc()));
297 ParentScope = Scopes.size() - 1;
306 // If this is a statement, rather than an expression, scopes within it don't
324 unsigned NewParentScope = Scopes.size();
325 Scopes.push_back(GotoScope(ParentScope, Diag, 0, S->getBeginLoc()));
390 unsigned NewParentScope = Scopes.size();
391 Scopes.push_back(GotoScope(ParentScope, Diag, 0, IS->getBeginLoc()));
395 NewParentScope = Scopes.size();
396 Scopes.push_back(GotoScope(ParentScope, Diag, 0, IS->getBeginLoc()));
399 NewParentScope = Scopes.size();
400 Scopes.push_back(GotoScope(ParentScope, Diag, 0, IS->getBeginLoc()));
409 unsigned NewParentScope = Scopes.size();
410 Scopes.push_back(GotoScope(ParentScope,
421 unsigned NewParentScope = Scopes.size();
422 Scopes.push_back(GotoScope(ParentScope,
434 unsigned NewParentScope = Scopes.size();
435 Scopes.push_back(GotoScope(ParentScope,
445 unsigned NewParentScope = Scopes.size();
446 Scopes.push_back(GotoScope(ParentScope,
452 unsigned NewParentScope = Scopes.size();
453 Scopes.push_back(GotoScope(ParentScope,
480 unsigned NewParentScope = Scopes.size();
481 Scopes.push_back(GotoScope(ParentScope,
492 unsigned NewParentScope = Scopes.size();
493 Scopes.push_back(GotoScope(ParentScope,
503 unsigned NewParentScope = Scopes.size();
504 Scopes.push_back(GotoScope(ParentScope,
524 unsigned NewParentScope = Scopes.size();
525 Scopes.push_back(GotoScope(ParentScope,
538 unsigned NewParentScope = Scopes.size();
539 Scopes.push_back(GotoScope(ParentScope,
567 // Disallow jumps out of scopes containing temporaries lifetime-extended to
577 Scopes.push_back(GotoScope(ParentScope, 0,
580 origParentScope = Scopes.size()-1;
604 unsigned NewParentScope = Scopes.size();
605 Scopes.emplace_back(ParentScope,
704 /// A path in is trivial if none of the entered scopes have an InDiag.
705 /// A path out is trivial is none of the exited scopes have an OutDiag.
766 // A path between scopes always consists of exitting zero or more
767 // scopes, then entering zero or more scopes. We build a set of
768 // of scopes S from which the target scope can be trivially
771 llvm::BitVector Reachable(Scopes.size(), false);
779 // Mark all the enclosing scopes from which you can safely jump
790 if (Scopes[Min].InDiag) break;
792 Min = Scopes[Min].ParentScope;
803 // to O(JumpScopes.size() / Scopes.size()): we only iterate
809 // If we find something reachable, mark all the scopes we just
811 for (unsigned S = I->first; S != Scope; S = Scopes[S].ParentScope)
822 if (Scopes[Scope].OutDiag) break;
824 Scope = Scopes[Scope].ParentScope;
868 if (Scopes[ToScopes[I]].InDiag)
869 S.Diag(Scopes[ToScopes[I]].Loc, Scopes[ToScopes[I]].InDiag);
872 /// Diagnose an indirect jump which is known to cross scopes.
883 for (unsigned I = JumpScope; I != Common; I = Scopes[I].ParentScope)
884 if (Scopes[I].OutDiag) {
886 S.Diag(Scopes[I].Loc, Scopes[I].OutDiag);
891 // Now walk into the scopes containing the label whose address was taken.
892 for (unsigned I = TargetScope; I != Common; I = Scopes[I].ParentScope)
893 if (IsCXX98CompatWarning(S, Scopes[I].InDiag))
895 else if (Scopes[I].InDiag) {
897 S.Diag(Scopes[I].Loc, Scopes[I].InDiag);
932 for (unsigned I = FromScope; I > ToScope; I = Scopes[I].ParentScope) {
933 if (Scopes[I].InDiag == diag::note_protected_by_seh_finally) {
937 if (Scopes[I].InDiag == diag::note_omp_protected_structured_block) {
950 // Pull out (and reverse) any scopes we might need to diagnose skipping.
954 for (unsigned I = ToScope; I != CommonScope; I = Scopes[I].ParentScope) {
956 IsMicrosoftJumpWarning(JumpDiagError, Scopes[I].InDiag))
958 else if (IsCXX98CompatWarning(S, Scopes[I].InDiag))
960 else if (Scopes[I].InDiag)
997 for (unsigned I = LabelAndGotoScopes[AS]; I; I = Scopes[I].ParentScope) {
998 if (Scopes[I].OutDiag) {
1000 S.Diag(Scopes[I].Loc, Scopes[I].OutDiag);