summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-08-01 17:02:34 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-08-01 17:02:34 +0000
commite13d00996d97804640c38c27fd2761a44fbacf35 (patch)
tree920d837e2a3e6851c44be3b5e55ebe9181b822f5 /clang/lib
parent06bd3933ba2d5204c4f51952b76131ec013a3406 (diff)
downloadbcm5719-llvm-e13d00996d97804640c38c27fd2761a44fbacf35.tar.gz
bcm5719-llvm-e13d00996d97804640c38c27fd2761a44fbacf35.zip
Dropping some else-after-returns. No functional changes intended.
llvm-svn: 214526
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 663c80c129c..ff2594e1148 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud