Skip to content
Snippets Groups Projects
Commit 6715f582 authored by Argyrios Kyrtzidis's avatar Argyrios Kyrtzidis
Browse files

[index] In ObjC++ handle objc type parameters for function USRs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262693 91177308-0d34-0410-b5e6-96231b3b80d8
parent c77a08cd
No related branches found
No related tags found
No related merge requests found
...@@ -663,6 +663,11 @@ void USRGenerator::VisitType(QualType T) { ...@@ -663,6 +663,11 @@ void USRGenerator::VisitType(QualType T) {
T = PT->getPointeeType(); T = PT->getPointeeType();
continue; continue;
} }
if (const ObjCObjectPointerType *OPT = T->getAs<ObjCObjectPointerType>()) {
Out << '*';
T = OPT->getPointeeType();
continue;
}
if (const RValueReferenceType *RT = T->getAs<RValueReferenceType>()) { if (const RValueReferenceType *RT = T->getAs<RValueReferenceType>()) {
Out << "&&"; Out << "&&";
T = RT->getPointeeType(); T = RT->getPointeeType();
...@@ -697,6 +702,18 @@ void USRGenerator::VisitType(QualType T) { ...@@ -697,6 +702,18 @@ void USRGenerator::VisitType(QualType T) {
VisitTagDecl(TT->getDecl()); VisitTagDecl(TT->getDecl());
return; return;
} }
if (const ObjCInterfaceType *OIT = T->getAs<ObjCInterfaceType>()) {
Out << '$';
VisitObjCInterfaceDecl(OIT->getDecl());
return;
}
if (const ObjCObjectType *OIT = T->getAs<ObjCObjectType>()) {
Out << 'Q';
VisitType(OIT->getBaseType());
for (auto *Prot : OIT->getProtocols())
VisitObjCProtocolDecl(Prot);
return;
}
if (const TemplateTypeParmType *TTP = T->getAs<TemplateTypeParmType>()) { if (const TemplateTypeParmType *TTP = T->getAs<TemplateTypeParmType>()) {
Out << 't' << TTP->getDepth() << '.' << TTP->getIndex(); Out << 't' << TTP->getDepth() << '.' << TTP->getIndex();
return; return;
......
// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
@interface MyCls
@end
@protocol P1,P2;
// CHECK: [[@LINE+1]]:6 | function/C | foo | c:@F@foo#*$objc(cs)MyCls# | __Z3fooP5MyCls | Decl | rel: 0
void foo(MyCls *o);
// CHECK: [[@LINE+1]]:6 | function/C | foo | c:@F@foo#*Qoobjc(pl)P1objc(pl)P2# | __Z3fooPU15objcproto2P12P211objc_object | Decl | rel: 0
void foo(id<P2, P1> o);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment