diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-25 23:08:39 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-25 23:08:39 +0000 |
commit | 66024d02448d4ce05f1ad71a92b610f2285882f8 (patch) | |
tree | db0340b08b06f774bf034534960015cffc83fe85 /clang/lib/AST/ASTContext.cpp | |
parent | 4e5ca9e578db1375a0a7d7fa400ceccb99816505 (diff) | |
download | bcm5719-llvm-66024d02448d4ce05f1ad71a92b610f2285882f8.tar.gz bcm5719-llvm-66024d02448d4ce05f1ad71a92b610f2285882f8.zip |
simplify code by removing excessive bracing.
llvm-svn: 173521
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index b0cea14788b..1d103f11296 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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; } |