Find patch attached
>From 1572b92c0b471dd069f4d5ccf604f4b85a52107a Mon Sep 17 00:00:00 2001
From: Anders Waldenborg <[email protected]>
Date: Mon, 19 Dec 2011 13:59:20 +0100
Subject: [PATCH 2/2] PYTHON: Add missing vector TypeKind
---
bindings/python/clang/cindex.py | 1 +
bindings/python/tests/cindex/test_type.py | 15 +++++++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index 9c60fe4..dc9795e 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -1043,6 +1043,7 @@ TypeKind.OBJCOBJECTPOINTER = TypeKind(109)
TypeKind.FUNCTIONNOPROTO = TypeKind(110)
TypeKind.FUNCTIONPROTO = TypeKind(111)
TypeKind.CONSTANTARRAY = TypeKind(112)
+TypeKind.VECTOR = TypeKind(113)
class Type(Structure):
"""
diff --git a/bindings/python/tests/cindex/test_type.py b/bindings/python/tests/cindex/test_type.py
index 2a35f6e..d29c52d 100644
--- a/bindings/python/tests/cindex/test_type.py
+++ b/bindings/python/tests/cindex/test_type.py
@@ -97,3 +97,18 @@ def testConstantArray():
break
else:
assert False, "Didn't find teststruct??"
+
+testvectorInput="""
+ float float4 __attribute__((vector_size(4)));
+"""
+def testVector():
+ index = Index.create()
+ tu = index.parse('t.c', unsaved_files = [('t.c',testvectorInput)])
+
+ for n in tu.cursor.get_children():
+ if n.spelling == 'float4':
+ assert n.type.kind == TypeKind.VECTOR
+ break
+ else:
+ assert False, "Didn't find float4??"
+
--
1.7.2.5
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits