Move loop variable update.

Thanks to Dmitri Gribenko for the suggestion.

llvm-svn: 171889
This commit is contained in:
Rafael Espindola 2013-01-08 19:58:34 +00:00
parent 820fa707b1
commit f26d5391ab
1 changed files with 1 additions and 2 deletions

View File

@ -10501,11 +10501,10 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func) {
// and, because of the two phase lookup, this function is called with at
// decl in the middle of a decl chain. We loop to maintain the invariant
// that once a decl is used, all decls after it are also used.
for (FunctionDecl *F = Func->getMostRecentDecl();;) {
for (FunctionDecl *F = Func->getMostRecentDecl();; F = F->getPreviousDecl()) {
F->setUsed(true);
if (F == Func)
break;
F = F->getPreviousDecl();
}
}