diff --git a/c/clang/_wrap/cursor.cpp b/c/clang/_wrap/cursor.cpp index 3d80f44c..c5775eee 100644 --- a/c/clang/_wrap/cursor.cpp +++ b/c/clang/_wrap/cursor.cpp @@ -49,6 +49,8 @@ void wrap_clang_getArrayElementType(CXType *arrayTyp, CXType *elemTyp) { *elemTyp = clang_getArrayElementType(*arrayTyp); } +void wrap_clang_getElementType(CXType *Typ, CXType *elemTyp) { *elemTyp = clang_getElementType(*Typ); } + long long wrap_clang_getArraySize(CXType *arrayTyp) { return clang_getArraySize(*arrayTyp); } void wrap_clang_getCanonicalType(CXType *typ, CXType *canonicalType) { *canonicalType = clang_getCanonicalType(*typ); } diff --git a/c/clang/clang.go b/c/clang/clang.go index 522dd065..71bd5a7f 100644 --- a/c/clang/clang.go +++ b/c/clang/clang.go @@ -1894,6 +1894,20 @@ func (t Type) ArrayElementType() (ret Type) { return } +/** + * Return the element type of an array, complex, or vector type. + * + * If a type is passed in that is not an array, complex, or vector type, + * an invalid type is returned. + */ +// llgo:link (*Type).wrapElementType C.wrap_clang_getElementType +func (t *Type) wrapElementType(ret *Type) { return } + +func (t Type) ElementType() (ret Type) { + t.wrapElementType(&ret) + return +} + /** * Return the array size of a constant array. *