From: Eric Christopher Date: Mon, 6 Jul 2015 23:52:01 +0000 (+0000) Subject: Update target attribute support for post-commit feedback. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af612f836887c21daac48df6a1787b286842b855;p=clang Update target attribute support for post-commit feedback. Use const auto rather than duplicating the type name and fix the error message when the attribute is applied to an incorrect entity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241526 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 2bbce37e57..b3123cc83a 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -1277,7 +1277,7 @@ def Target : InheritableAttr { let Spellings = [GCC<"target">]; let Args = [StringArgument<"features">]; let Subjects = - SubjectList<[Function], ErrorDiag, "ExpectedFunctionMethodOrClass">; + SubjectList<[Function], ErrorDiag, "ExpectedFunction">; let Documentation = [Undocumented]; } diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index ac014d3220..6192244e42 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1506,7 +1506,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, const FunctionDecl *FD = dyn_cast_or_null(TargetDecl); if (FD) { - if (const TargetAttr *TD = FD->getAttr()) { + if (const auto *TD = FD->getAttr()) { StringRef FeaturesStr = TD->getFeatures(); SmallVector AttrFeatures; FeaturesStr.split(AttrFeatures, ",");