aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-01-25 23:08:39 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-01-25 23:08:39 +0000
commit23799e3ec4b341753e4fb63a7e995cf4ac3b6066 (patch)
tree509cc885c6f4b13b7a25f91ba309f5787b6cbe99 /lib/AST/ASTContext.cpp
parent41170b55ba635afb806394d44f2b7f1f6095df37 (diff)
simplify code by removing excessive bracing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index b0cea14788..1d103f1129 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -416,33 +416,25 @@ comments::FullComment *ASTContext::getCommentForDecl(
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;
}