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