<div dir="ltr">LGTM</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 12, 2013 at 8:12 AM, Anders Waldenborg <span dir="ltr"><<a href="mailto:anders@0x63.nu" target="_blank">anders@0x63.nu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><a href="http://llvm-reviews.chandlerc.com/D1658" target="_blank">http://llvm-reviews.chandlerc.com/D1658</a><br>
<br>
Files:<br>
bindings/python/clang/cindex.py<br>
bindings/python/tests/cindex/test_type.py<br>
<br>
Index: bindings/python/clang/cindex.py<br>
===================================================================<br>
--- bindings/python/clang/cindex.py<br>
+++ bindings/python/clang/cindex.py<br>
@@ -1486,6 +1486,7 @@<br>
TypeKind.INCOMPLETEARRAY = TypeKind(114)<br>
TypeKind.VARIABLEARRAY = TypeKind(115)<br>
TypeKind.DEPENDENTSIZEDARRAY = TypeKind(116)<br>
+TypeKind.DECAYED = TypeKind(117)<br>
<br>
class Type(Structure):<br>
"""<br>
@@ -1661,6 +1662,18 @@<br>
"""<br>
return conf.lib.clang_getArraySize(self)<br>
<br>
+ def get_decayed_original_type(self):<br>
+ """<br>
+ Retrieve the original type of a decayed type.<br>
+ """<br>
+ return conf.lib.clang_getDecayedOriginalType(self)<br>
+<br>
+ def get_decayed_decayed_type(self):<br>
+ """<br>
+ Retrieve the decayed type of a decayed type.<br>
+ """<br>
+ return conf.lib.clang_getDecayedDecayedType(self)<br>
+<br>
def get_align(self):<br>
"""<br>
Retrieve the alignment of the record.<br>
@@ -2693,6 +2706,16 @@<br>
[Type],<br>
c_longlong),<br>
<br>
+ ("clang_getDecayedOriginalType",<br>
+ [Type],<br>
+ Type,<br>
+ Type.from_result),<br>
+<br>
+ ("clang_getDecayedDecayedType",<br>
+ [Type],<br>
+ Type,<br>
+ Type.from_result),<br>
+<br>
("clang_getFieldDeclBitWidth",<br>
[Cursor],<br>
c_int),<br>
Index: bindings/python/tests/cindex/test_type.py<br>
===================================================================<br>
--- bindings/python/tests/cindex/test_type.py<br>
+++ bindings/python/tests/cindex/test_type.py<br>
@@ -369,3 +369,14 @@<br>
assert teststruct.type.get_offset("bar") == bar<br>
<br>
<br>
+def test_decay():<br>
+ """Ensure decayed types are exposed"""<br>
+<br>
+ tu = get_tu("void foo(int a[]);")<br>
+ foo = get_cursor(tu, 'foo')<br>
+ a = foo.type.argument_types()[0]<br>
+<br>
+ assert a.kind == TypeKind.DECAYED<br>
+ assert a.get_decayed_original_type().kind == TypeKind.INCOMPLETEARRAY<br>
+ assert a.get_decayed_decayed_type().kind == TypeKind.POINTER<br>
+<br>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>