Lines Matching full:scope

13 // control transfers out of a particular scope.  This can be
79 /// Push an entry of the given size onto this protected-scope stack.
160 // terminate is the current EH scope, we may skip adding any EH cleanup
166 EHCleanupScope *Scope =
178 Scope->setLifetimeMarker();
180 // With Windows -EHa, Invoke llvm.seh.scope.begin() for EHCleanup
185 // Check getInvokeDest() to generate llvm.seh.scope.begin() as needed.
190 return Scope->getCleanupBuffer();
237 EHCatchScope *scope =
240 return scope;
417 EHCleanupScope &Scope = cast<EHCleanupScope>(*EHStack.begin());
418 HadBranches |= Scope.hasBranches();
420 // As long as Old strictly encloses the scope's enclosing normal
424 Old.strictlyEncloses(Scope.getEnclosingNormalCleanup());
499 EHCleanupScope &Scope) {
500 assert(Scope.isNormalCleanup());
501 llvm::BasicBlock *Entry = Scope.getNormalBlock();
504 Scope.setNormalBlock(Entry);
598 EHCleanupScope &scope) {
599 llvm::BasicBlock *entry = scope.getNormalBlock();
641 EHCleanupScope &Scope = cast<EHCleanupScope>(*EHStack.begin());
642 assert(Scope.getFixupDepth() <= EHStack.getNumBranchFixups());
647 if (ForDeactivation && (Scope.isNormalCleanup() || !getLangOpts().EHAsynch)) {
651 bool IsActive = Scope.isActive();
653 Scope.shouldTestFlagInNormalCleanup() ? Scope.getActiveFlag()
656 Scope.shouldTestFlagInEHCleanup() ? Scope.getActiveFlag()
661 llvm::BasicBlock *EHEntry = Scope.getCachedEHDispatchBlock();
662 assert(Scope.hasEHBranches() == (EHEntry != nullptr));
664 EHScopeStack::stable_iterator EHParent = Scope.getEnclosingEHScope();
669 unsigned FixupDepth = Scope.getFixupDepth();
673 bool HasExistingBranches = Scope.hasBranches();
681 // end of the last cleanup, which points to the current scope. The
690 assert(!Scope.isNormalCleanup() || !HasPrebranchedFallthrough ||
691 (Scope.getNormalBlock() &&
693 == Scope.getNormalBlock()));
696 if (Scope.isNormalCleanup() &&
703 if (Scope.isNormalCleanup() && HasPrebranchedFallthrough &&
714 EHScope &enclosing = *EHStack.find(Scope.getEnclosingNormalCleanup());
726 llvm::BasicBlock *normalEntry = Scope.getNormalBlock();
735 destroyOptimisticNormalEntry(*this, Scope);
749 auto *CleanupSource = reinterpret_cast<char *>(Scope.getCleanupBuffer());
753 size_t CleanupSize = Scope.getCleanupSize();
766 if (Scope.isNormalCleanup())
768 if (Scope.isEHCleanup())
771 // Under -EHa, invoke seh.scope.end() to mark scope end before dtor
772 bool IsEHa = getLangOpts().EHAsynch && !Scope.isLifetimeMarker();
775 // Mark CPP scope end for passed-by-value Arg temp
779 // fallthrough. Restore original IP to emit CPP scope ends in the correct
788 destroyOptimisticNormalEntry(*this, Scope);
789 Scope.MarkEmitted();
797 // mark SEH scope end for fall-through flow
805 destroyOptimisticNormalEntry(*this, Scope);
806 Scope.MarkEmitted();
815 llvm::BasicBlock *NormalEntry = CreateNormalEntry(*this, Scope);
839 // intercept normal cleanup to mark SEH scope end
851 (Scope.getEnclosingNormalCleanup() != EHStack.stable_end());
854 // - if there are branch-throughs threaded through the scope
859 if (Scope.hasBranchThroughs() ||
863 EHScope &S = *EHStack.find(Scope.getEnclosingNormalCleanup());
877 if (!Scope.hasBranchThroughs() && !HasFixups && !HasFallthrough &&
878 !currentFunctionUsesSEHTry() && Scope.getNumBranchAfters() == 1) {
890 llvm::BasicBlock *BranchAfter = Scope.getBranchAfterBlock(0);
894 // - if there are branch-afters threaded through the scope
898 } else if (Scope.getNumBranchAfters() ||
926 for (unsigned I = 0, E = Scope.getNumBranchAfters(); I != E; ++I) {
927 Switch->addCase(Scope.getBranchAfterIndex(I),
928 Scope.getBranchAfterBlock(I));
942 Scope.MarkEmitted();
1023 // Push a terminate scope or cleanupendpad scope around the potentially
1058 // Leave the terminate scope.
1079 // If we're not in an active normal cleanup scope, or if the
1080 // destination scope is within the innermost active normal cleanup
1081 // scope, we don't need to worry about fixups.
1092 /// the current cleanup-protected scope. The target scope may not yet
1110 // If we're not in an active normal cleanup scope, or if the
1111 // destination scope is within the innermost active normal cleanup
1112 // scope, we don't need to worry about fixups.
1119 // If we can't resolve the destination cleanup scope, just add this
1120 // to the current cleanup scope as a branch fixup.
1132 // Otherwise, thread through all the normal cleanups in scope.
1140 EHCleanupScope &Scope =
1142 BI->setSuccessor(0, CreateNormalEntry(*this, Scope));
1150 EHCleanupScope &Scope = cast<EHCleanupScope>(*EHStack.find(I));
1151 assert(Scope.isNormalCleanup());
1152 I = Scope.getEnclosingNormalCleanup();
1157 Scope.addBranchAfter(Index, Dest.getBlock());
1161 // Otherwise, tell the scope that there's a jump propagating
1164 if (!Scope.addBranchThrough(Dest.getBlock()))
1183 EHScope &scope = *EHStack.find(i);
1184 if (scope.hasEHBranches())
1187 i = scope.getEnclosingEHScope();
1207 EHCleanupScope &Scope = cast<EHCleanupScope>(*CGF.EHStack.find(C));
1220 if (Scope.isNormalCleanup()) {
1221 Scope.setTestFlagInNormalCleanup();
1226 if (Scope.isEHCleanup() &&
1228 Scope.setTestFlagInEHCleanup();
1236 Address var = Scope.getActiveFlag();
1241 Scope.setActiveFlag(var);
1242 Scope.AddAuxAllocas(AllocaTracker.Take());
1266 EHCleanupScope &Scope = cast<EHCleanupScope>(*EHStack.find(C));
1267 assert(!Scope.isActive() && "double activation");
1271 Scope.setActive(true);
1278 EHCleanupScope &Scope = cast<EHCleanupScope>(*EHStack.find(C));
1279 assert(Scope.isActive() && "double deactivation");
1293 Scope.setActive(false);
1327 // Invoke a llvm.seh.scope.begin at the beginning of a CPP scope for -EHa
1333 CGM.CreateRuntimeFunction(FTy, "llvm.seh.scope.begin");
1337 // Invoke a llvm.seh.scope.end at the end of a CPP scope for -EHa
1338 // llvm.seh.scope.end is emitted before popCleanup, so it's "invoked"
1344 CGM.CreateRuntimeFunction(FTy, "llvm.seh.scope.end");
1348 // Invoke a llvm.seh.try.begin at the beginning of a SEH scope for -EHa
1358 // Invoke a llvm.seh.try.end at the end of a SEH scope for -EHa