Lines Matching refs:scope

12 // Calls to NSAutoreleasePools will be rewritten as an @autorelease scope.
23 // - There is not a corresponding -release/-drain in the same scope
25 // - There is a variable that is declared inside the intended @autorelease scope
98 PoolScope &scope = *scpI;
99 clearRefsIn(*scope.Begin, info.Refs);
100 clearRefsIn(*scope.End, info.Refs);
101 clearRefsIn(scope.Releases.begin(), scope.Releases.end(), info.Refs);
122 PoolScope &scope = *scpI;
123 clearUnavailableDiags(*scope.Begin);
124 clearUnavailableDiags(*scope.End);
125 if (scope.IsFollowedBySimpleReturnStmt) {
126 // Include the return in the scope.
127 Pass.TA.replaceStmt(*scope.Begin, "@autoreleasepool {");
128 Pass.TA.removeStmt(*scope.End);
129 Stmt::child_iterator retI = scope.End;
138 SourceRange(scope.getIndentedRange().getBegin(),
140 scope.CompoundParent->getLocStart());
142 Pass.TA.replaceStmt(*scope.Begin, "@autoreleasepool {");
143 Pass.TA.replaceStmt(*scope.End, "}");
144 Pass.TA.increaseIndentation(scope.getIndentedRange(),
145 scope.CompoundParent->getLocStart());
153 PoolScope &scope = *scpI;
155 relI = scope.Releases.begin(),
156 relE = scope.Releases.end(); relI != relE; ++relI) {
208 PoolScope &scope = Scopes.back();
209 scope.End = I;
210 handlePoolScope(scope, S);
254 NameReferenceChecker(ASTContext &ctx, PoolScope &scope,
259 ScopeRange = SourceRange((*scope.Begin)->getLocStart(),
260 (*scope.End)->getLocStart());
296 void handlePoolScope(PoolScope &scope, CompoundStmt *compoundS) {
297 // Check that all names declared inside the scope are not used
298 // outside the scope.
302 Stmt::child_iterator SI = scope.End, SE = compoundS->body_end();
304 // Check if the autoreleasepool scope is followed by a simple return
305 // statement, in which case we will include the return in the scope.
311 scope.IsFollowedBySimpleReturnStmt = true;
312 ++SI; // the return will be included in scope, don't check it.
316 nameUsedOutsideScope = !NameReferenceChecker(Pass.Ctx, scope,
324 // declared inside the pool scope are used outside of it.
328 "NSAutoreleasePool scope that it was declared in", referenceLoc);
330 Pass.TA.reportNote("intended @autoreleasepool scope begins here",
331 (*scope.Begin)->getLocStart());
332 Pass.TA.reportNote("intended @autoreleasepool scope ends here",
333 (*scope.End)->getLocStart());
340 ReleaseCollector releaseColl(scope.PoolVar, scope.Releases);
341 Stmt::child_iterator I = scope.Begin;
343 for (; I != scope.End; ++I)
347 PoolVars[scope.PoolVar].Scopes.push_back(scope);