]> granicus.if.org Git - clang/commitdiff
Update target attribute support for post-commit feedback.
authorEric Christopher <echristo@gmail.com>
Mon, 6 Jul 2015 23:52:01 +0000 (23:52 +0000)
committerEric Christopher <echristo@gmail.com>
Mon, 6 Jul 2015 23:52:01 +0000 (23:52 +0000)
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

include/clang/Basic/Attr.td
lib/CodeGen/CGCall.cpp

index 2bbce37e57bba828e5f5e6201258433d0730a2a7..b3123cc83a1044aea4360a872a85f7b765d4e6de 100644 (file)
@@ -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];
 }
 
index ac014d3220a938598ac91dc3b61499b7c35fed60..6192244e426990e539748935ae2fcb7fe3bba97b 100644 (file)
@@ -1506,7 +1506,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
 
     const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(TargetDecl);
     if (FD) {
-      if (const TargetAttr *TD = FD->getAttr<TargetAttr>()) {
+      if (const auto *TD = FD->getAttr<TargetAttr>()) {
         StringRef FeaturesStr = TD->getFeatures();
         SmallVector<StringRef, 1> AttrFeatures;
         FeaturesStr.split(AttrFeatures, ",");