diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2013-07-23 19:30:11 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2013-07-23 19:30:11 +0000 |
commit | b7243381c2b7a7214af5e1f8d557f2d9b85642bf (patch) | |
tree | ea5081c31707ceba3ccc7b58694ef9955977c76e /clang/lib/Sema/TargetAttributesSema.cpp | |
parent | 8a0f8238b82ce26af45fbd89a8b0e5b6883b4dce (diff) | |
download | bcm5719-llvm-b7243381c2b7a7214af5e1f8d557f2d9b85642bf.tar.gz bcm5719-llvm-b7243381c2b7a7214af5e1f8d557f2d9b85642bf.zip |
Added the attribute name to the err_attribute_wrong_number_arguments diagnostic for clarity; updated almost all of the affected test cases.
Thanks to Fariborz Jahanian for the suggestion!
llvm-svn: 186980
Diffstat (limited to 'clang/lib/Sema/TargetAttributesSema.cpp')
-rw-r--r-- | clang/lib/Sema/TargetAttributesSema.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/clang/lib/Sema/TargetAttributesSema.cpp b/clang/lib/Sema/TargetAttributesSema.cpp index 526399a2783..8ea7319b6e7 100644 --- a/clang/lib/Sema/TargetAttributesSema.cpp +++ b/clang/lib/Sema/TargetAttributesSema.cpp @@ -30,7 +30,8 @@ static void HandleMSP430InterruptAttr(Decl *d, const AttributeList &Attr, Sema &S) { // Check the attribute arguments. if (Attr.getNumArgs() != 1) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1; + S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) + << Attr.getName() << 1; return; } @@ -75,7 +76,8 @@ static void HandleMBlazeInterruptHandlerAttr(Decl *d, const AttributeList &Attr, Sema &S) { // Check the attribute arguments. if (Attr.getNumArgs() != 0) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1; + S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) + << Attr.getName() << 1; return; } @@ -90,7 +92,8 @@ static void HandleMBlazeSaveVolatilesAttr(Decl *d, const AttributeList &Attr, Sema &S) { // Check the attribute arguments. if (Attr.getNumArgs() != 0) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1; + S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) + << Attr.getName() << 1; return; } @@ -125,7 +128,8 @@ static void HandleX86ForceAlignArgPointerAttr(Decl *D, Sema &S) { // Check the attribute arguments. if (Attr.getNumArgs() != 0) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0; + S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) + << Attr.getName() << 0; return; } @@ -177,7 +181,8 @@ DLLImportAttr *Sema::mergeDLLImportAttr(Decl *D, SourceRange Range, static void HandleDLLImportAttr(Decl *D, const AttributeList &Attr, Sema &S) { // check the attribute arguments. if (Attr.getNumArgs() != 0) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0; + S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) + << Attr.getName() << 0; return; } @@ -223,7 +228,8 @@ DLLExportAttr *Sema::mergeDLLExportAttr(Decl *D, SourceRange Range, static void HandleDLLExportAttr(Decl *D, const AttributeList &Attr, Sema &S) { // check the attribute arguments. if (Attr.getNumArgs() != 0) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0; + S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) + << Attr.getName() << 0; return; } @@ -280,7 +286,8 @@ namespace { static void HandleMips16Attr(Decl *D, const AttributeList &Attr, Sema &S) { // check the attribute arguments. if (Attr.hasParameterOrArguments()) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0; + S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) + << Attr.getName() << 0; return; } // Attribute can only be applied to function types. @@ -296,7 +303,8 @@ static void HandleMips16Attr(Decl *D, const AttributeList &Attr, Sema &S) { static void HandleNoMips16Attr(Decl *D, const AttributeList &Attr, Sema &S) { // check the attribute arguments. if (Attr.hasParameterOrArguments()) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 0; + S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) + << Attr.getName() << 0; return; } // Attribute can only be applied to function types. |