diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2013-12-26 18:30:57 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2013-12-26 18:30:57 +0000 |
commit | 3e424b5070f3415824dc2942e8ad4480f3cfae99 (patch) | |
tree | 120ef7d590e62134d54b3d28414a954f5cf753fd /clang/lib/Sema/SemaDecl.cpp | |
parent | 88fe3220536db1fd9d41ce4560ae02752b9c3257 (diff) | |
download | bcm5719-llvm-3e424b5070f3415824dc2942e8ad4480f3cfae99.tar.gz bcm5719-llvm-3e424b5070f3415824dc2942e8ad4480f3cfae99.zip |
Teach the diagnostics engine about the Attr type to make reporting on semantic attributes easier (and not require hard-coded strings). This requires a getSpelling() function on the Attr class, which is table-driven. Updates a handful of cases where a hard-coded string was being used to test the functionality out. Updating associated test cases for the improved quoting.
llvm-svn: 198055
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 9ed9510a659..fd576f3d5ad 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -8934,7 +8934,7 @@ Sema::FinalizeDeclaration(Decl *ThisDecl) { if (UsedAttr *Attr = VD->getAttr<UsedAttr>()) { if (!Attr->isInherited() && !VD->isThisDeclarationADefinition()) { - Diag(Attr->getLocation(), diag::warn_attribute_ignored) << "'used'"; + Diag(Attr->getLocation(), diag::warn_attribute_ignored) << Attr; VD->dropAttr<UsedAttr>(); } } @@ -9674,7 +9674,7 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D) { !(LangOpts.MicrosoftExt && FD->getLexicalDeclContext()->isRecord())) { Diag(FD->getLocation(), diag::err_attribute_can_be_applied_only_to_symbol_declaration) - << "dllimport"; + << DA; FD->setInvalidDecl(); return D; } @@ -9687,7 +9687,7 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D) { // emitted. Diag(FD->getLocation(), diag::warn_redeclaration_without_attribute_prev_attribute_ignored) - << FD->getName() << "dllimport"; + << FD->getName() << DA; } } // We want to attach documentation to original Decl (which might be |