diff options
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index f2ac5c14a1..2f42607eab 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -985,15 +985,13 @@ bool NamedDecl::hasLinkage() const { NamedDecl *NamedDecl::getUnderlyingDeclImpl() { NamedDecl *ND = this; - while (true) { - if (UsingShadowDecl *UD = dyn_cast<UsingShadowDecl>(ND)) - ND = UD->getTargetDecl(); - else if (ObjCCompatibleAliasDecl *AD - = dyn_cast<ObjCCompatibleAliasDecl>(ND)) - return AD->getClassInterface(); - else - return ND; - } + while (UsingShadowDecl *UD = dyn_cast<UsingShadowDecl>(ND)) + ND = UD->getTargetDecl(); + + if (ObjCCompatibleAliasDecl *AD = dyn_cast<ObjCCompatibleAliasDecl>(ND)) + return AD->getClassInterface(); + + return ND; } bool NamedDecl::isCXXInstanceMember() const { |