From 27df2e81c86718c9d78a5cf83de8b49ef4c4469c Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 2 Dec 2013 22:16:55 +0000 Subject: [PATCH] Simplifying a test for duplicate vec_type_hint attributes. The assert and attribute kind test were superfluous. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196162 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclAttr.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 21f3526da8..60bc7b79ad 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -2319,8 +2319,6 @@ static void handleWorkGroupSize(Sema &S, Decl *D, } static void handleVecTypeHint(Sema &S, Decl *D, const AttributeList &Attr) { - assert(Attr.getKind() == AttributeList::AT_VecTypeHint); - if (!Attr.hasParsedType()) { S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << Attr.getName() << 1; @@ -2339,9 +2337,7 @@ static void handleVecTypeHint(Sema &S, Decl *D, const AttributeList &Attr) { return; } - if (Attr.getKind() == AttributeList::AT_VecTypeHint && - D->hasAttr()) { - VecTypeHintAttr *A = D->getAttr(); + if (VecTypeHintAttr *A = D->getAttr()) { if (!S.Context.hasSameType(A->getTypeHint(), ParmType)) { S.Diag(Attr.getLoc(), diag::warn_duplicate_attribute) << Attr.getName(); return; -- 2.50.1