[AST] VarDecl::hasDefinition() - Early exit if we find a strong definition.

llvm-svn: 152166
This commit is contained in:
Daniel Dunbar 2012-03-06 23:52:46 +00:00
parent 304314d739
commit 082c62d943

View File

@ -1313,8 +1313,11 @@ VarDecl::DefinitionKind VarDecl::hasDefinition() const {
const VarDecl *First = getFirstDeclaration();
for (redecl_iterator I = First->redecls_begin(), E = First->redecls_end();
I != E; ++I)
I != E; ++I) {
Kind = std::max(Kind, (*I)->isThisDeclarationADefinition());
if (Kind == Definition)
break;
}
return Kind;
}