<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;"><div>I'm not sure it's right to remove 'const'—consider global string constant declarations:</div><div><br></div><div>extern NSString * const MyNotificationName;</div><div><br></div><div>I think you'll have to explicitly remove ObjC lifetime attrs only.</div><div><br></div><div>Jordan</div><div><br></div><br><div><div>On May 1, 2013, at 10:28 , Fariborz Jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Author: fjahanian<br>Date: Wed May  1 12:28:37 2013<br>New Revision: 180860<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=180860&view=rev">http://llvm.org/viewvc/llvm-project?rev=180860&view=rev</a><br>Log:<br>[ObjC declaration documentation] declaration of<span class="Apple-converted-space"> </span><br>types involving Objective-C pointers must have<br>their arc qualifiers elided as they don't<span class="Apple-converted-space"> </span><br>add any additional info. //<span class="Apple-converted-space"> </span><a href="rdar://13757500">rdar://13757500</a>.<br><br>Added:<br>   cfe/trunk/test/Index/comment-unqualified-objc-pointer.m<br>Modified:<br>   cfe/trunk/include/clang/AST/Type.h<br>   cfe/trunk/lib/AST/DeclPrinter.cpp<br><br>Modified: cfe/trunk/include/clang/AST/Type.h<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=180860&r1=180859&r2=180860&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=180860&r1=180859&r2=180860&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/AST/Type.h (original)<br>+++ cfe/trunk/include/clang/AST/Type.h Wed May  1 12:28:37 2013<br>@@ -853,6 +853,10 @@ public:<br>    return *this;<br>  }<br><br>+  /// getUnqualifiedObjCPointerType - Returns the unqualified version if<br>+  /// Objective-C pointer type; otherwise, returns type as is.<br>+  inline QualType getUnqualifiedObjCPointerType() const;<br>+  <br>  /// operator==/!= - Indicate whether the specified types and qualifiers are<br>  /// identical.<br>  friend bool operator==(const QualType &LHS, const QualType &RHS) {<br>@@ -4648,6 +4652,11 @@ inline QualType QualType::getUnqualified<br>  return QualType(getSplitUnqualifiedTypeImpl(*this).Ty, 0);<br>}<br><br>+inline QualType QualType::getUnqualifiedObjCPointerType() const {<br>+  return getTypePtr()->isObjCObjectPointerType() ?<br>+                            getUnqualifiedType() : *this;<br>+}<br>+  <br>inline SplitQualType QualType::getSplitUnqualifiedType() const {<br>  if (!getTypePtr()->getCanonicalTypeInternal().hasLocalQualifiers())<br>    return split();<br>@@ -4679,7 +4688,7 @@ inline void QualType::removeLocalCVRQual<br>inline unsigned QualType::getAddressSpace() const {<br>  return getQualifiers().getAddressSpace();<br>}<br>-<br>+  <br>/// getObjCGCAttr - Return the gc attribute of this type.<br>inline Qualifiers::GC QualType::getObjCGCAttr() const {<br>  return getQualifiers().getObjCGCAttr();<br><br>Modified: cfe/trunk/lib/AST/DeclPrinter.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=180860&r1=180859&r2=180860&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=180860&r1=180859&r2=180860&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)<br>+++ cfe/trunk/lib/AST/DeclPrinter.cpp Wed May  1 12:28:37 2013<br>@@ -617,7 +617,8 @@ void DeclPrinter::VisitFieldDecl(FieldDe<br>  if (!Policy.SuppressSpecifiers && D->isModulePrivate())<br>    Out << "__module_private__ ";<br><br>-  Out << D->getType().stream(Policy, D->getName());<br>+  Out << D->getType().getUnqualifiedObjCPointerType().<br>+            stream(Policy, D->getName());<br><br>  if (D->isBitField()) {<br>    Out << " : ";<br>@@ -661,7 +662,7 @@ void DeclPrinter::VisitVarDecl(VarDecl *<br>      Out << "__module_private__ ";<br>  }<br><br>-  QualType T = D->getType();<br>+  QualType T = D->getType().getUnqualifiedObjCPointerType();<br>  if (ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D))<br>    T = Parm->getOriginalType();<br>  T.print(Out, Policy, D->getName());<br>@@ -910,7 +911,8 @@ void DeclPrinter::VisitObjCMethodDecl(Ob<br>  else<br>    Out << "+ ";<br>  if (!OMD->getResultType().isNull())<br>-    Out << '(' << OMD->getResultType().getAsString(Policy) << ")";<br>+    Out << '(' << OMD->getResultType().getUnqualifiedObjCPointerType().<br>+                    getAsString(Policy) << ")";<br><br>  std::string name = OMD->getSelector().getAsString();<br>  std::string::size_type pos, lastPos = 0;<br>@@ -919,7 +921,8 @@ void DeclPrinter::VisitObjCMethodDecl(Ob<br>    // FIXME: selector is missing here!<br>    pos = name.find_first_of(':', lastPos);<br>    Out << " " << name.substr(lastPos, pos - lastPos);<br>-    Out << ":(" << (*PI)->getType().getAsString(Policy) << ')' << **PI;<br>+    Out << ":(" << (*PI)->getType().getUnqualifiedObjCPointerType().<br>+                      getAsString(Policy) << ')' << **PI;<br>    lastPos = pos + 1;<br>  }<br><br>@@ -952,7 +955,8 @@ void DeclPrinter::VisitObjCImplementatio<br>    Indentation += Policy.Indentation;<br>    for (ObjCImplementationDecl::ivar_iterator I = OID->ivar_begin(),<br>         E = OID->ivar_end(); I != E; ++I) {<br>-      Indent() << I->getType().getAsString(Policy) << ' ' << **I << ";\n";<br>+      Indent() << I->getType().getUnqualifiedObjCPointerType().<br>+                    getAsString(Policy) << ' ' << **I << ";\n";<br>    }<br>    Indentation -= Policy.Indentation;<br>    Out << "}\n";<br>@@ -990,7 +994,8 @@ void DeclPrinter::VisitObjCInterfaceDecl<br>    Indentation += Policy.Indentation;<br>    for (ObjCInterfaceDecl::ivar_iterator I = OID->ivar_begin(),<br>         E = OID->ivar_end(); I != E; ++I) {<br>-      Indent() << I->getType().getAsString(Policy) << ' ' << **I << ";\n";<br>+      Indent() << I->getType().getUnqualifiedObjCPointerType().<br>+                    getAsString(Policy) << ' ' << **I << ";\n";<br>    }<br>    Indentation -= Policy.Indentation;<br>    Out << "}\n";<br>@@ -1041,7 +1046,8 @@ void DeclPrinter::VisitObjCCategoryDecl(<br>    Indentation += Policy.Indentation;<br>    for (ObjCCategoryDecl::ivar_iterator I = PID->ivar_begin(),<br>         E = PID->ivar_end(); I != E; ++I) {<br>-      Indent() << I->getType().getAsString(Policy) << ' ' << **I << ";\n";<br>+      Indent() << I->getType().getUnqualifiedObjCPointerType().<br>+                    getAsString(Policy) << ' ' << **I << ";\n";<br>    }<br>    Indentation -= Policy.Indentation;<br>    Out << "}\n";<br>@@ -1127,7 +1133,8 @@ void DeclPrinter::VisitObjCPropertyDecl(<br>    (void) first; // Silence dead store warning due to idiomatic code.<br>    Out << " )";<br>  }<br>-  Out << ' ' << PDecl->getType().getAsString(Policy) << ' ' << *PDecl;<br>+  Out << ' ' << PDecl->getType().getUnqualifiedObjCPointerType().<br>+                  getAsString(Policy) << ' ' << *PDecl;<br>  if (Policy.PolishForDeclaration)<br>    Out << ';';<br>}<br><br>Added: cfe/trunk/test/Index/comment-unqualified-objc-pointer.m<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/comment-unqualified-objc-pointer.m?rev=180860&view=auto">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/comment-unqualified-objc-pointer.m?rev=180860&view=auto</a><br>==============================================================================<br>--- cfe/trunk/test/Index/comment-unqualified-objc-pointer.m (added)<br>+++ cfe/trunk/test/Index/comment-unqualified-objc-pointer.m Wed May  1 12:28:37 2013<br>@@ -0,0 +1,36 @@<br>+// RUN: rm -rf %t<br>+// RUN: mkdir %t<br>+// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -fobjc-arc %s > %t/out<br>+// RUN: FileCheck %s < %t/out<br>+//<span class="Apple-converted-space"> </span><a href="rdar://13757500">rdar://13757500</a><br>+<br>+@class NSString;<br>+<br>+@interface NSArray @end<br>+<br>+@interface NSMutableArray : NSArray<span class="Apple-converted-space"> </span><br>+{<br>+//! This is the name.<br>+  NSString *Name;<br>+}<br>+//! This is WithLabel comment.<br>+- (NSString *)WithLabel:(NSString *)label;<br>+// CHECK: <Declaration>- (NSString *)WithLabel:(NSString *)label;</Declaration><span class="Apple-converted-space"> </span><br>+<br>+//! This is a property to get the Name.<br>+@property (copy) NSString *Name;<br>+// CHECK: <Declaration>@property(readwrite, copy, atomic) NSString *Name;</Declaration><br>+@end<br>+<br>+@implementation NSMutableArray<br>+{<br>+//! This is private ivar<br>+  NSString *NickName;<br>+// CHECK: <Declaration>NSString *NickName</Declaration><br>+}<br>+<br>+- (NSString *)WithLabel:(NSString *)label {<br>+    return 0;<br>+}<br>+@synthesize Name = Name;<br>+@end<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></div></blockquote></div><br></body></html>