<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 16, 2014, at 1:08 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Wed, Jul 16, 2014 at 3:44 PM, Fariborz Jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:<br><blockquote type="cite">Author: fjahanian<br>Date: Wed Jul 16 14:44:34 2014<br>New Revision: 213185<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=213185&view=rev">http://llvm.org/viewvc/llvm-project?rev=213185&view=rev</a><br>Log:<br>Objective-C. Changes per A. Ballman's comment<br>for my last patch. // <a href="rdar://17631257">rdar://17631257</a><br><br>Added:<br>    cfe/trunk/test/SemaObjC/objc-asm-attribute-neg-test.m<br>Modified:<br>    cfe/trunk/include/clang/AST/DeclObjC.h<br>    cfe/trunk/include/clang/Basic/Attr.td<br>    cfe/trunk/include/clang/Basic/AttrDocs.td<br>    cfe/trunk/lib/AST/DeclObjC.cpp<br>    cfe/trunk/lib/Sema/SemaDeclAttr.cpp<br><br>Modified: cfe/trunk/include/clang/AST/DeclObjC.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=213185&r1=213184&r2=213185&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=213185&r1=213184&r2=213185&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/AST/DeclObjC.h (original)<br>+++ cfe/trunk/include/clang/AST/DeclObjC.h Wed Jul 16 14:44:34 2014<br>@@ -955,6 +955,9 @@ public:<br>   void mergeClassExtensionProtocolList(ObjCProtocolDecl *const* List,<br>                                        unsigned Num,<br>                                        ASTContext &C);<br>+<br>+  /// Produce a name to be used for class's metadata. It comes either via<br>+  /// objc_runtime_name attribute or class name.<br>   StringRef getObjCRuntimeNameAsString() const;<br><br>   /// Returns the designated initializers for the interface.<br>@@ -1654,6 +1657,8 @@ public:<br>   /// \brief Starts the definition of this Objective-C protocol.<br>   void startDefinition();<br><br>+  /// Produce a name to be used for protocol's metadata. It comes either via<br>+  /// objc_runtime_name attribute or protocol name.<br>   StringRef getObjCRuntimeNameAsString() const;<br><br>   SourceRange getSourceRange() const override LLVM_READONLY {<br>@@ -2104,6 +2109,8 @@ public:<br>     return getName();<br>   }<br><br>+  /// Produce a name to be used for class's metadata. It comes either via<br>+  /// class's objc_runtime_name attribute or class name.<br>   StringRef getObjCRuntimeNameAsString() const;<br><br>   const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }<br><br>Modified: cfe/trunk/include/clang/Basic/Attr.td<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=213185&r1=213184&r2=213185&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=213185&r1=213184&r2=213185&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/Basic/Attr.td (original)<br>+++ cfe/trunk/include/clang/Basic/Attr.td Wed Jul 16 14:44:34 2014<br>@@ -993,8 +993,8 @@ def ObjCRuntimeName : Attr {<br>     let Spellings = [GNU<"objc_runtime_name">];<br>     let Subjects = SubjectList<[ObjCInterface, ObjCProtocol], ErrorDiag,<br>     "ExpectedObjectiveCInterfaceOrProtocol">;<br>-    let Args = [StringArgument<"MetadataName", 1>];<br>-    let Documentation = [Undocumented];<br>+    let Args = [StringArgument<"MetadataName">];<br>+    let Documentation = [ObjCRuntimeNameDocs];<br> }<br><br> def OptimizeNone : InheritableAttr {<br><br>Modified: cfe/trunk/include/clang/Basic/AttrDocs.td<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=213185&r1=213184&r2=213185&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=213185&r1=213184&r2=213185&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/Basic/AttrDocs.td (original)<br>+++ cfe/trunk/include/clang/Basic/AttrDocs.td Wed Jul 16 14:44:34 2014<br>@@ -426,6 +426,25 @@ implementation of an override in a subcl<br>   }];<br> }<br><br>+def ObjCRuntimeNameDocs : Documentation {<br>+    let Category = DocCatFunction;<br>+    let Content = [{<br>+        Annotation of Objective-C classes and protocols with this attribute allow to<br>+        use an alternative name for metadata names which normally use class or protocol<br>+        names as part of their names.<br></blockquote><br>The phrasing here is a bit hard to understand. Would this capture the<br>meaning sufficiently?<br><br>By default, the Objective-C interface or protocol identifier is used<br>as the metadata name for that object. The `objc_runtime_name`<br>attribute allows annotated interfaces or protocols to use the<br>specified string argument as the object's metadata name instead of the<br>default name.<br><br></blockquote><br></div><div>Sounds much better. In r<font face="Menlo"><span style="font-size: 11px;">213192 with minor change “in the metadata name” instead of</span></font></div><div><font face="Menlo"><span style="font-size: 11px;">“as the metadata name” as the name has a fixed prefix as well.</span></font></div><div><font face="Menlo"><span style="font-size: 11px;">- Fariborz</span></font></div><div><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><br></body></html>