r213193 - Specifying the diagnostic argument through the attribute table generator instead of having to enter it manually as part of the attribute subject list. This only affects attributes appertaining to ObjC interfaces and protocols.

Aaron Ballman aaron at aaronballman.com
Wed Jul 16 13:28:11 PDT 2014


Author: aaronballman
Date: Wed Jul 16 15:28:10 2014
New Revision: 213193

URL: http://llvm.org/viewvc/llvm-project?rev=213193&view=rev
Log:
Specifying the diagnostic argument through the attribute table generator instead of having to enter it manually as part of the attribute subject list. This only affects attributes appertaining to ObjC interfaces and protocols.

No new tests required as this is covered by existing tests.

Modified:
    cfe/trunk/include/clang/Basic/Attr.td
    cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp

Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=213193&r1=213192&r2=213193&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Wed Jul 16 15:28:10 2014
@@ -990,11 +990,10 @@ def ObjCDesignatedInitializer : Attr {
 }
 
 def ObjCRuntimeName : Attr {
-    let Spellings = [GNU<"objc_runtime_name">];
-    let Subjects = SubjectList<[ObjCInterface, ObjCProtocol], ErrorDiag,
-    "ExpectedObjectiveCInterfaceOrProtocol">;
-    let Args = [StringArgument<"MetadataName">];
-    let Documentation = [ObjCRuntimeNameDocs];
+  let Spellings = [GNU<"objc_runtime_name">];
+  let Subjects = SubjectList<[ObjCInterface, ObjCProtocol], ErrorDiag>;
+  let Args = [StringArgument<"MetadataName">];
+  let Documentation = [ObjCRuntimeNameDocs];
 }
 
 def OptimizeNone : InheritableAttr {

Modified: cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=213193&r1=213192&r2=213193&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Wed Jul 16 15:28:10 2014
@@ -2154,6 +2154,8 @@ static std::string CalculateDiagnostic(c
                                            "ExpectedVariableOrFunction)";
 
     case ObjCMethod | ObjCProp: return "ExpectedMethodOrProperty";
+    case ObjCProtocol | ObjCInterface:
+      return "ExpectedObjectiveCInterfaceOrProtocol";
     case Field | Var: return "ExpectedFieldOrGlobalVar";
   }
 





More information about the cfe-commits mailing list