r301635 - [index] Handle vector types in USR generator
Alex Lorenz via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 28 02:46:36 PDT 2017
Author: arphaman
Date: Fri Apr 28 04:46:36 2017
New Revision: 301635
URL: http://llvm.org/viewvc/llvm-project?rev=301635&view=rev
Log:
[index] Handle vector types in USR generator
rdar://25339187
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=301635&r1=301634&r2=301635&view=diff
==============================================================================
--- cfe/trunk/lib/Index/USRGeneration.cpp (original)
+++ cfe/trunk/lib/Index/USRGeneration.cpp Fri Apr 28 04:46:36 2017
@@ -811,7 +811,13 @@ void USRGenerator::VisitType(QualType T)
T = InjT->getInjectedSpecializationType();
continue;
}
-
+ if (const auto *VT = T->getAs<VectorType>()) {
+ Out << (T->isExtVectorType() ? ']' : '[');
+ Out << VT->getNumElements();
+ T = VT->getElementType();
+ continue;
+ }
+
// Unhandled type.
Out << ' ';
break;
Modified: cfe/trunk/test/Index/usrs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/usrs.cpp?rev=301635&r1=301634&r2=301635&view=diff
==============================================================================
--- cfe/trunk/test/Index/usrs.cpp (original)
+++ cfe/trunk/test/Index/usrs.cpp Fri Apr 28 04:46:36 2017
@@ -95,6 +95,14 @@ class TC1 {
void meth(TC1);
};
+typedef __attribute__((__ext_vector_type__(3))) float float3;
+
+typedef float __m128 __attribute__((__vector_size__(16)));
+
+float3 vectorOverload(float3 f);
+
+__m128 vectorOverload(__m128 f);
+
// RUN: c-index-test -test-load-source-usrs all -fno-delayed-template-parsing %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]
@@ -172,3 +180,6 @@ class TC1 {
// 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]
+
+// CHECK: usrs.cpp c:@F at vectorOverload#]3f# Extent=[102:1 - 102:32]
+// CHECK: usrs.cpp c:@F at vectorOverload#[4f# Extent=[104:1 - 104:32]
More information about the cfe-commits
mailing list