Lines Matching refs:scope

11 // Calls to NSAutoreleasePools will be rewritten as an @autorelease scope.
22 // - There is not a corresponding -release/-drain in the same scope
24 // - There is a variable that is declared inside the intended @autorelease scope
97 PoolScope &scope = *scpI;
98 clearRefsIn(*scope.Begin, info.Refs);
99 clearRefsIn(*scope.End, info.Refs);
100 clearRefsIn(scope.Releases.begin(), scope.Releases.end(), info.Refs);
121 PoolScope &scope = *scpI;
122 clearUnavailableDiags(*scope.Begin);
123 clearUnavailableDiags(*scope.End);
124 if (scope.IsFollowedBySimpleReturnStmt) {
125 // Include the return in the scope.
126 Pass.TA.replaceStmt(*scope.Begin, "@autoreleasepool {");
127 Pass.TA.removeStmt(*scope.End);
128 Stmt::child_iterator retI = scope.End;
137 SourceRange(scope.getIndentedRange().getBegin(),
139 scope.CompoundParent->getBeginLoc());
141 Pass.TA.replaceStmt(*scope.Begin, "@autoreleasepool {");
142 Pass.TA.replaceStmt(*scope.End, "}");
143 Pass.TA.increaseIndentation(scope.getIndentedRange(),
144 scope.CompoundParent->getBeginLoc());
152 PoolScope &scope = *scpI;
154 relI = scope.Releases.begin(),
155 relE = scope.Releases.end(); relI != relE; ++relI) {
207 PoolScope &scope = Scopes.back();
208 scope.End = I;
209 handlePoolScope(scope, S);
253 NameReferenceChecker(ASTContext &ctx, PoolScope &scope,
258 ScopeRange = SourceRange((*scope.Begin)->getBeginLoc(),
259 (*scope.End)->getBeginLoc());
295 void handlePoolScope(PoolScope &scope, CompoundStmt *compoundS) {
296 // Check that all names declared inside the scope are not used
297 // outside the scope.
301 Stmt::child_iterator SI = scope.End, SE = compoundS->body_end();
303 // Check if the autoreleasepool scope is followed by a simple return
304 // statement, in which case we will include the return in the scope.
310 scope.IsFollowedBySimpleReturnStmt = true;
311 ++SI; // the return will be included in scope, don't check it.
315 nameUsedOutsideScope = !NameReferenceChecker(Pass.Ctx, scope,
323 // declared inside the pool scope are used outside of it.
327 "NSAutoreleasePool scope that it was declared in", referenceLoc);
329 Pass.TA.reportNote("intended @autoreleasepool scope begins here",
330 (*scope.Begin)->getBeginLoc());
331 Pass.TA.reportNote("intended @autoreleasepool scope ends here",
332 (*scope.End)->getBeginLoc());
339 ReleaseCollector releaseColl(scope.PoolVar, scope.Releases);
340 Stmt::child_iterator I = scope.Begin;
342 for (; I != scope.End; ++I)
346 PoolVars[scope.PoolVar].Scopes.push_back(scope);