forked from OSchip/llvm-project
Move the null check outside of the loop, no functionality change.
llvm-svn: 163553
This commit is contained in:
parent
f89a92702f
commit
54b102985d
|
@ -1503,11 +1503,14 @@ static void ExpandAnonymousFieldDesignator(Sema &SemaRef,
|
|||
/// corresponds to FieldName.
|
||||
static IndirectFieldDecl *FindIndirectFieldDesignator(FieldDecl *AnonField,
|
||||
IdentifierInfo *FieldName) {
|
||||
if (!FieldName)
|
||||
return 0;
|
||||
|
||||
assert(AnonField->isAnonymousStructOrUnion());
|
||||
Decl *NextDecl = AnonField->getNextDeclInContext();
|
||||
while (IndirectFieldDecl *IF =
|
||||
dyn_cast_or_null<IndirectFieldDecl>(NextDecl)) {
|
||||
if (FieldName && FieldName == IF->getAnonField()->getIdentifier())
|
||||
if (FieldName == IF->getAnonField()->getIdentifier())
|
||||
return IF;
|
||||
NextDecl = NextDecl->getNextDeclInContext();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue