diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-08-01 17:02:34 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-08-01 17:02:34 +0000 |
commit | a09c6cc12927b5d84bffbd2d0d01925508a02da1 (patch) | |
tree | d98b230b76245502b747e162508f4991ab8e6b98 /lib/Sema/SemaDeclAttr.cpp | |
parent | 39163a20f04d411776e62df431648c48ec5db432 (diff) |
Dropping some else-after-returns. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214526 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 663c80c129..ff2594e114 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -91,9 +91,9 @@ static QualType getFunctionOrMethodParamType(const Decl *D, unsigned Idx) { static SourceRange getFunctionOrMethodParamRange(const Decl *D, unsigned Idx) { if (const auto *FD = dyn_cast<FunctionDecl>(D)) return FD->getParamDecl(Idx)->getSourceRange(); - else if (const auto *MD = dyn_cast<ObjCMethodDecl>(D)) + if (const auto *MD = dyn_cast<ObjCMethodDecl>(D)) return MD->parameters()[Idx]->getSourceRange(); - else if (const auto *BD = dyn_cast<BlockDecl>(D)) + if (const auto *BD = dyn_cast<BlockDecl>(D)) return BD->getParamDecl(Idx)->getSourceRange(); return SourceRange(); } @@ -107,7 +107,7 @@ static QualType getFunctionOrMethodResultType(const Decl *D) { static SourceRange getFunctionOrMethodResultSourceRange(const Decl *D) { if (const auto *FD = dyn_cast<FunctionDecl>(D)) return FD->getReturnTypeSourceRange(); - else if (const auto *MD = dyn_cast<ObjCMethodDecl>(D)) + if (const auto *MD = dyn_cast<ObjCMethodDecl>(D)) return MD->getReturnTypeSourceRange(); return SourceRange(); } @@ -116,11 +116,11 @@ static bool isFunctionOrMethodVariadic(const Decl *D) { if (const FunctionType *FnTy = D->getFunctionType()) { const FunctionProtoType *proto = cast<FunctionProtoType>(FnTy); return proto->isVariadic(); - } else if (const BlockDecl *BD = dyn_cast<BlockDecl>(D)) - return BD->isVariadic(); - else { - return cast<ObjCMethodDecl>(D)->isVariadic(); } + if (const BlockDecl *BD = dyn_cast<BlockDecl>(D)) + return BD->isVariadic(); + + return cast<ObjCMethodDecl>(D)->isVariadic(); } static bool isInstanceMethod(const Decl *D) { |