[cfe-commits] r152339 - /cfe/trunk/lib/AST/Decl.cpp
Benjamin Kramer
benny.kra at googlemail.com
Thu Mar 8 13:00:45 PST 2012
Author: d0k
Date: Thu Mar 8 15:00:45 2012
New Revision: 152339
URL: http://llvm.org/viewvc/llvm-project?rev=152339&view=rev
Log:
Untangle getUnderlyingDeclImpl, no functionality change.
Modified:
cfe/trunk/lib/AST/Decl.cpp
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=152339&r1=152338&r2=152339&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Thu Mar 8 15:00:45 2012
@@ -985,15 +985,13 @@
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 {
More information about the cfe-commits
mailing list