r223634 - [libclang] Encode InjectedClassNameType in the USR.
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Dec 8 00:48:43 PST 2014
Author: akirtzidis
Date: Mon Dec 8 02:48:43 2014
New Revision: 223634
URL: http://llvm.org/viewvc/llvm-project?rev=223634&view=rev
Log:
[libclang] Encode InjectedClassNameType in the USR.
Modified:
cfe/trunk/lib/Index/USRGeneration.cpp
cfe/trunk/test/Index/usrs.cpp
Modified: cfe/trunk/lib/Index/USRGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/USRGeneration.cpp?rev=223634&r1=223633&r2=223634&view=diff
==============================================================================
--- cfe/trunk/lib/Index/USRGeneration.cpp (original)
+++ cfe/trunk/lib/Index/USRGeneration.cpp Mon Dec 8 02:48:43 2014
@@ -706,6 +706,10 @@ void USRGenerator::VisitType(QualType T)
Out << ':' << DNT->getIdentifier()->getName();
return;
}
+ if (const InjectedClassNameType *InjT = T->getAs<InjectedClassNameType>()) {
+ T = InjT->getInjectedSpecializationType();
+ continue;
+ }
// Unhandled type.
Out << ' ';
Modified: cfe/trunk/test/Index/usrs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/usrs.cpp?rev=223634&r1=223633&r2=223634&view=diff
==============================================================================
--- cfe/trunk/test/Index/usrs.cpp (original)
+++ cfe/trunk/test/Index/usrs.cpp Mon Dec 8 02:48:43 2014
@@ -90,6 +90,11 @@ void funWithChar(signed char c) {}
struct { int x; } embedS1;
struct { int x; } embedS2;
+template <typename T>
+class TC1 {
+ void meth(TC1);
+};
+
// RUN: c-index-test -test-load-source-usrs all %s | FileCheck %s
// CHECK: usrs.cpp c:@N at foo Extent=[1:1 - 4:2]
// CHECK: usrs.cpp c:@N at foo@x Extent=[2:3 - 2:8]
@@ -165,3 +170,5 @@ struct { int x; } embedS2;
// CHECK: usrs.cpp c:usrs.cpp at S@usrs.cpp at 1483@FI at x Extent=[90:10 - 90:15]
// CHECK: usrs.cpp c:usrs.cpp at S@usrs.cpp at 1510@FI at x Extent=[91:10 - 91:15]
+
+// CHECK: usrs.cpp c:@ST>1#T at TC1@F at meth#>@ST>1#T at TC11t0.0# Extent=[95:3 - 95:17]
More information about the cfe-commits
mailing list