Switching to use checkAttributeNumArgs for trivial cases. No functional changes intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186591 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 9d73ca3..ef401c3 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1547,10 +1547,8 @@
static void handleAliasAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// check the attribute arguments.
- if (Attr.getNumArgs() != 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ if (!checkAttributeNumArgs(S, Attr, 1))
return;
- }
Expr *Arg = Attr.getArg(0);
Arg = Arg->IgnoreParenCasts();
@@ -1670,10 +1668,8 @@
static void handleTLSModelAttr(Sema &S, Decl *D,
const AttributeList &Attr) {
// Check the attribute arguments.
- if (Attr.getNumArgs() != 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ if (!checkAttributeNumArgs(S, Attr, 1))
return;
- }
Expr *Arg = Attr.getArg(0);
Arg = Arg->IgnoreParenCasts();
@@ -3130,8 +3126,7 @@
return;
}
- if (Attr.getNumArgs() != 1) {
- S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ if (!checkAttributeNumArgs(S, Attr, 1)) {
Attr.setInvalid();
return;
}
@@ -4146,8 +4141,7 @@
if (Attr.isInvalid())
return true;
- if (Attr.getNumArgs() != 1) {
- Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ if (!checkAttributeNumArgs(*this, Attr, 1)) {
Attr.setInvalid();
return true;
}