From: Aaron Ballman Date: Tue, 19 Nov 2013 22:18:24 +0000 (+0000) Subject: Switching some string literals to be generated by the AttributeList object itself. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d46c8e0d67c7a20b5da330af3a36c47a5f0c0484;p=clang Switching some string literals to be generated by the AttributeList object itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195160 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 3e58386209..4d0c6771e9 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -3662,7 +3662,7 @@ static void handleConstantAttr(Sema &S, Decl *D, const AttributeList &Attr) { CUDAConstantAttr(Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex())); } else { - S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "constant"; + S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); } } @@ -3685,7 +3685,7 @@ static void handleDeviceAttr(Sema &S, Decl *D, const AttributeList &Attr) { CUDADeviceAttr(Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex())); } else { - S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "device"; + S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); } } @@ -3716,7 +3716,7 @@ static void handleGlobalAttr(Sema &S, Decl *D, const AttributeList &Attr) { CUDAGlobalAttr(Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex())); } else { - S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "global"; + S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); } } @@ -3732,7 +3732,7 @@ static void handleHostAttr(Sema &S, Decl *D, const AttributeList &Attr) { CUDAHostAttr(Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex())); } else { - S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "host"; + S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); } } @@ -3748,7 +3748,7 @@ static void handleSharedAttr(Sema &S, Decl *D, const AttributeList &Attr) { CUDASharedAttr(Attr.getRange(), S.Context, Attr.getAttributeSpellingListIndex())); } else { - S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "shared"; + S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); } }