From: Matt Arsenault Date: Fri, 5 Dec 2014 18:03:55 +0000 (+0000) Subject: Use else if when checking multiple attributes. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43cfcbca3f4008db36af4d0683f8a9258a20097f;p=platform%2Fupstream%2Fllvm.git Use else if when checking multiple attributes. Only one of these can really match. llvm-svn: 223489 --- diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index e5eb61c..af7cf57 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/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(); }