[cfe-commits] r173521 - /cfe/trunk/lib/AST/ASTContext.cpp
Fariborz Jahanian
fjahanian at apple.com
Fri Jan 25 15:08:39 PST 2013
Author: fjahanian
Date: Fri Jan 25 17:08:39 2013
New Revision: 173521
URL: http://llvm.org/viewvc/llvm-project?rev=173521&view=rev
Log:
simplify code by removing excessive bracing.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=173521&r1=173520&r2=173521&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri Jan 25 17:08:39 2013
@@ -416,33 +416,25 @@ comments::FullComment *ASTContext::getCo
if (isa<ObjCMethodDecl>(D) || isa<FunctionDecl>(D)) {
SmallVector<const NamedDecl*, 8> Overridden;
const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D);
- if (OMD && OMD->isPropertyAccessor()) {
- if (const ObjCPropertyDecl *PDecl = OMD->findPropertyDecl()) {
- if (comments::FullComment *FC = getCommentForDecl(PDecl, PP)) {
- comments::FullComment *CFC = cloneFullComment(FC, D);
- return CFC;
- }
- }
- }
+ if (OMD && OMD->isPropertyAccessor())
+ if (const ObjCPropertyDecl *PDecl = OMD->findPropertyDecl())
+ if (comments::FullComment *FC = getCommentForDecl(PDecl, PP))
+ return cloneFullComment(FC, D);
if (OMD)
addRedeclaredMethods(OMD, Overridden);
getOverriddenMethods(dyn_cast<NamedDecl>(D), Overridden);
- for (unsigned i = 0, e = Overridden.size(); i < e; i++) {
- if (comments::FullComment *FC = getCommentForDecl(Overridden[i], PP)) {
- comments::FullComment *CFC = cloneFullComment(FC, D);
- return CFC;
- }
- }
+ for (unsigned i = 0, e = Overridden.size(); i < e; i++)
+ if (comments::FullComment *FC = getCommentForDecl(Overridden[i], PP))
+ return cloneFullComment(FC, D);
}
else if (const TypedefDecl *TD = dyn_cast<TypedefDecl>(D)) {
+ // Attach enum's documentation to its typedef if latter
+ // does not have one of its own.
QualType QT = TD->getUnderlyingType();
- if (const EnumType *ET = QT->getAs<EnumType>()) {
+ if (const EnumType *ET = QT->getAs<EnumType>())
if (const EnumDecl *ED = ET->getDecl())
- if (comments::FullComment *FC = getCommentForDecl(ED, PP)) {
- comments::FullComment *CFC = cloneFullComment(FC, D);
- return CFC;
- }
- }
+ if (comments::FullComment *FC = getCommentForDecl(ED, PP))
+ return cloneFullComment(FC, D);
}
return NULL;
}
More information about the cfe-commits
mailing list