From: Matt Arsenault Date: Fri, 5 Dec 2014 18:03:55 +0000 (+0000) Subject: Use else if when checking multiple attributes. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aefc430bcddaa7b89636e54a07e2ac3bbf9eadf3;p=clang Use else if when checking multiple attributes. Only one of these can really match. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223489 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index e5eb61c1eb..af7cf5713d 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -4764,12 +4764,10 @@ void Sema::ProcessDeclAttributeList(Scope *S, Decl *D, if (Attr *A = D->getAttr()) { Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A; D->setInvalidDecl(); - } - if (Attr *A = D->getAttr()) { + } else if (Attr *A = D->getAttr()) { Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A; D->setInvalidDecl(); - } - if (Attr *A = D->getAttr()) { + } else if (Attr *A = D->getAttr()) { Diag(D->getLocation(), diag::err_opencl_kernel_attr) << A; D->setInvalidDecl(); }