r358566 - [libclang] Expose ext_vector_type
Sven van Haastregt via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 17 02:08:50 PDT 2019
Author: svenvh
Date: Wed Apr 17 02:08:50 2019
New Revision: 358566
URL: http://llvm.org/viewvc/llvm-project?rev=358566&view=rev
Log:
[libclang] Expose ext_vector_type
Differential Revision: https://reviews.llvm.org/D60775
Modified:
cfe/trunk/bindings/python/clang/cindex.py
cfe/trunk/include/clang-c/Index.h
cfe/trunk/test/Index/opencl-types.cl
cfe/trunk/tools/libclang/CXType.cpp
Modified: cfe/trunk/bindings/python/clang/cindex.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/bindings/python/clang/cindex.py?rev=358566&r1=358565&r2=358566&view=diff
==============================================================================
--- cfe/trunk/bindings/python/clang/cindex.py (original)
+++ cfe/trunk/bindings/python/clang/cindex.py Wed Apr 17 02:08:50 2019
@@ -2121,6 +2121,8 @@ TypeKind.OCLEVENT = TypeKind(158)
TypeKind.OCLQUEUE = TypeKind(159)
TypeKind.OCLRESERVEID = TypeKind(160)
+TypeKind.EXTVECTOR = TypeKind(176)
+
class RefQualifierKind(BaseEnumeration):
"""Describes a specific ref-qualifier of a type."""
Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=358566&r1=358565&r2=358566&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Wed Apr 17 02:08:50 2019
@@ -32,7 +32,7 @@
* compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
*/
#define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 54
+#define CINDEX_VERSION_MINOR 55
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
@@ -3315,7 +3315,9 @@ enum CXTypeKind {
CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173,
CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174,
- CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175
+ CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175,
+
+ CXType_ExtVector = 176
};
/**
Modified: cfe/trunk/test/Index/opencl-types.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/opencl-types.cl?rev=358566&r1=358565&r2=358566&view=diff
==============================================================================
--- cfe/trunk/test/Index/opencl-types.cl (original)
+++ cfe/trunk/test/Index/opencl-types.cl Wed Apr 17 02:08:50 2019
@@ -17,11 +17,11 @@ void kernel testFloatTypes() {
}
// CHECK: VarDecl=scalarHalf:11:8 (Definition){{( \(invalid\))?}} [type=half] [typekind=Half] [isPOD=1]
-// CHECK: VarDecl=vectorHalf:12:9 (Definition) [type=half4] [typekind=Typedef] [canonicaltype=half __attribute__((ext_vector_type(4)))] [canonicaltypekind=Unexposed] [isPOD=1]
+// CHECK: VarDecl=vectorHalf:12:9 (Definition) [type=half4] [typekind=Typedef] [canonicaltype=half __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
// CHECK: VarDecl=scalarFloat:13:9 (Definition) [type=float] [typekind=Float] [isPOD=1]
-// CHECK: VarDecl=vectorFloat:14:10 (Definition) [type=float4] [typekind=Typedef] [canonicaltype=float __attribute__((ext_vector_type(4)))] [canonicaltypekind=Unexposed] [isPOD=1]
+// CHECK: VarDecl=vectorFloat:14:10 (Definition) [type=float4] [typekind=Typedef] [canonicaltype=float __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
// CHECK: VarDecl=scalarDouble:15:10 (Definition){{( \(invalid\))?}} [type=double] [typekind=Double] [isPOD=1]
-// CHECK: VarDecl=vectorDouble:16:11 (Definition){{( \(invalid\))?}} [type=double4] [typekind=Typedef] [canonicaltype=double __attribute__((ext_vector_type(4)))] [canonicaltypekind=Unexposed] [isPOD=1]
+// CHECK: VarDecl=vectorDouble:16:11 (Definition){{( \(invalid\))?}} [type=double4] [typekind=Typedef] [canonicaltype=double __attribute__((ext_vector_type(4)))] [canonicaltypekind=ExtVector] [isPOD=1]
#pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing : enable
Modified: cfe/trunk/tools/libclang/CXType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXType.cpp?rev=358566&r1=358565&r2=358566&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXType.cpp (original)
+++ cfe/trunk/tools/libclang/CXType.cpp Wed Apr 17 02:08:50 2019
@@ -109,6 +109,7 @@ static CXTypeKind GetTypeKind(QualType T
TKCASE(VariableArray);
TKCASE(DependentSizedArray);
TKCASE(Vector);
+ TKCASE(ExtVector);
TKCASE(MemberPointer);
TKCASE(Auto);
TKCASE(Elaborated);
@@ -600,6 +601,7 @@ CXString clang_getTypeKindSpelling(enum
TKIND(VariableArray);
TKIND(DependentSizedArray);
TKIND(Vector);
+ TKIND(ExtVector);
TKIND(MemberPointer);
TKIND(Auto);
TKIND(Elaborated);
@@ -804,6 +806,9 @@ CXType clang_getElementType(CXType CT) {
case Type::Vector:
ET = cast<VectorType> (TP)->getElementType();
break;
+ case Type::ExtVector:
+ ET = cast<ExtVectorType>(TP)->getElementType();
+ break;
case Type::Complex:
ET = cast<ComplexType> (TP)->getElementType();
break;
@@ -827,6 +832,9 @@ long long clang_getNumElements(CXType CT
case Type::Vector:
result = cast<VectorType> (TP)->getNumElements();
break;
+ case Type::ExtVector:
+ result = cast<ExtVectorType>(TP)->getNumElements();
+ break;
default:
break;
}
More information about the cfe-commits
mailing list