forked from OSchip/llvm-project
Move loop variable update.
Thanks to Dmitri Gribenko for the suggestion. llvm-svn: 171889
This commit is contained in:
parent
820fa707b1
commit
f26d5391ab
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue