Simplifying a test for duplicate vec_type_hint attributes. The assert and attribute kind test were superfluous. No functional change intended.

llvm-svn: 196162
This commit is contained in:
Aaron Ballman 2013-12-02 22:16:55 +00:00
parent 564560f911
commit a9e0540c78
1 changed files with 1 additions and 5 deletions

View File

@ -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>()) {
VecTypeHintAttr *A = D->getAttr<VecTypeHintAttr>();
if (VecTypeHintAttr *A = D->getAttr<VecTypeHintAttr>()) {
if (!S.Context.hasSameType(A->getTypeHint(), ParmType)) {
S.Diag(Attr.getLoc(), diag::warn_duplicate_attribute) << Attr.getName();
return;