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);
254 NameReferenceChecker(ASTContext &ctx, PoolScope &scope,
259 ScopeRange = SourceRange((*scope.Begin)->getBeginLoc(),
260 (*scope.End)->getBeginLoc());
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)->getBeginLoc());
332 Pass.TA.reportNote("intended @autoreleasepool scope ends here",
333 (*scope.End)->getBeginLoc());
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);