return *this;
}
+ /// getUnqualifiedObjCPointerType - Returns the unqualified version if
+ /// Objective-C pointer type; otherwise, returns type as is.
+ inline QualType getUnqualifiedObjCPointerType() const;
+
/// operator==/!= - Indicate whether the specified types and qualifiers are
/// identical.
friend bool operator==(const QualType &LHS, const QualType &RHS) {
return QualType(getSplitUnqualifiedTypeImpl(*this).Ty, 0);
}
+inline QualType QualType::getUnqualifiedObjCPointerType() const {
+ return getTypePtr()->isObjCObjectPointerType() ?
+ getUnqualifiedType() : *this;
+}
+
inline SplitQualType QualType::getSplitUnqualifiedType() const {
if (!getTypePtr()->getCanonicalTypeInternal().hasLocalQualifiers())
return split();
inline unsigned QualType::getAddressSpace() const {
return getQualifiers().getAddressSpace();
}
-
+
/// getObjCGCAttr - Return the gc attribute of this type.
inline Qualifiers::GC QualType::getObjCGCAttr() const {
return getQualifiers().getObjCGCAttr();
if (!Policy.SuppressSpecifiers && D->isModulePrivate())
Out << "__module_private__ ";
- Out << D->getType().stream(Policy, D->getName());
+ Out << D->getType().getUnqualifiedObjCPointerType().
+ stream(Policy, D->getName());
if (D->isBitField()) {
Out << " : ";
Out << "__module_private__ ";
}
- QualType T = D->getType();
+ QualType T = D->getType().getUnqualifiedObjCPointerType();
if (ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D))
T = Parm->getOriginalType();
T.print(Out, Policy, D->getName());
else
Out << "+ ";
if (!OMD->getResultType().isNull())
- Out << '(' << OMD->getResultType().getAsString(Policy) << ")";
+ Out << '(' << OMD->getResultType().getUnqualifiedObjCPointerType().
+ getAsString(Policy) << ")";
std::string name = OMD->getSelector().getAsString();
std::string::size_type pos, lastPos = 0;
// FIXME: selector is missing here!
pos = name.find_first_of(':', lastPos);
Out << " " << name.substr(lastPos, pos - lastPos);
- Out << ":(" << (*PI)->getType().getAsString(Policy) << ')' << **PI;
+ Out << ":(" << (*PI)->getType().getUnqualifiedObjCPointerType().
+ getAsString(Policy) << ')' << **PI;
lastPos = pos + 1;
}
Indentation += Policy.Indentation;
for (ObjCImplementationDecl::ivar_iterator I = OID->ivar_begin(),
E = OID->ivar_end(); I != E; ++I) {
- Indent() << I->getType().getAsString(Policy) << ' ' << **I << ";\n";
+ Indent() << I->getType().getUnqualifiedObjCPointerType().
+ getAsString(Policy) << ' ' << **I << ";\n";
}
Indentation -= Policy.Indentation;
Out << "}\n";
Indentation += Policy.Indentation;
for (ObjCInterfaceDecl::ivar_iterator I = OID->ivar_begin(),
E = OID->ivar_end(); I != E; ++I) {
- Indent() << I->getType().getAsString(Policy) << ' ' << **I << ";\n";
+ Indent() << I->getType().getUnqualifiedObjCPointerType().
+ getAsString(Policy) << ' ' << **I << ";\n";
}
Indentation -= Policy.Indentation;
Out << "}\n";
Indentation += Policy.Indentation;
for (ObjCCategoryDecl::ivar_iterator I = PID->ivar_begin(),
E = PID->ivar_end(); I != E; ++I) {
- Indent() << I->getType().getAsString(Policy) << ' ' << **I << ";\n";
+ Indent() << I->getType().getUnqualifiedObjCPointerType().
+ getAsString(Policy) << ' ' << **I << ";\n";
}
Indentation -= Policy.Indentation;
Out << "}\n";
(void) first; // Silence dead store warning due to idiomatic code.
Out << " )";
}
- Out << ' ' << PDecl->getType().getAsString(Policy) << ' ' << *PDecl;
+ Out << ' ' << PDecl->getType().getUnqualifiedObjCPointerType().
+ getAsString(Policy) << ' ' << *PDecl;
if (Policy.PolishForDeclaration)
Out << ';';
}
--- /dev/null
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -fobjc-arc %s > %t/out
+// RUN: FileCheck %s < %t/out
+// rdar://13757500
+
+@class NSString;
+
+@interface NSArray @end
+
+@interface NSMutableArray : NSArray
+{
+//! This is the name.
+ NSString *Name;
+}
+//! This is WithLabel comment.
+- (NSString *)WithLabel:(NSString *)label;
+// CHECK: <Declaration>- (NSString *)WithLabel:(NSString *)label;</Declaration>
+
+//! This is a property to get the Name.
+@property (copy) NSString *Name;
+// CHECK: <Declaration>@property(readwrite, copy, atomic) NSString *Name;</Declaration>
+@end
+
+@implementation NSMutableArray
+{
+//! This is private ivar
+ NSString *NickName;
+// CHECK: <Declaration>NSString *NickName</Declaration>
+}
+
+- (NSString *)WithLabel:(NSString *)label {
+ return 0;
+}
+@synthesize Name = Name;
+@end