diff --git a/c/clang/_wrap/cursor.cpp b/c/clang/_wrap/cursor.cpp index dbea65a6..da3ef9a9 100644 --- a/c/clang/_wrap/cursor.cpp +++ b/c/clang/_wrap/cursor.cpp @@ -73,12 +73,16 @@ void wrap_clang_getPointeeType(CXType *pointerTyp, CXType *pointeeTyp) { void wrap_clang_getNonReferenceType(CXType *typ, CXType *nonRefTyp) { *nonRefTyp = clang_getNonReferenceType(*typ); } +void wrap_clang_getTypeDeclaration(CXType *typ, CXCursor *cur) { *cur = clang_getTypeDeclaration(*typ); } + void wrap_clang_getResultType(CXType *typ, CXType *resultTyp) { *resultTyp = clang_getResultType(*typ); } int wrap_clang_getNumArgTypes(CXType *typ) { return clang_getNumArgTypes(*typ); } void wrap_clang_getArgType(CXType *typ, unsigned i, CXType *argTyp) { *argTyp = clang_getArgType(*typ, i); } +unsigned wrap_clang_isFunctionTypeVariadic(CXType *typ) { return clang_isFunctionTypeVariadic(*typ); } + void wrap_clang_getCursorResultType(CXCursor *cur, CXType *typ) { *typ = clang_getCursorResultType(*cur); } void wrap_clang_getElementType(CXType *Typ, CXType *elemTyp) { *elemTyp = clang_getElementType(*Typ); } @@ -107,6 +111,8 @@ enum CX_StorageClass wrap_clang_Cursor_getStorageClass(CXCursor *cursor) { CXString wrap_clang_getCursorSpelling(CXCursor *cur) { return clang_getCursorSpelling(*cur); } +unsigned wrap_clang_Cursor_isVariadic(CXCursor *cur) { return clang_Cursor_isVariadic(*cur); } + CXString wrap_clang_Cursor_getRawCommentText(CXCursor *cursor) { return clang_Cursor_getRawCommentText(*cursor); } CXString wrap_clang_Cursor_getMangling(CXCursor *cur) { return clang_Cursor_getMangling(*cur); } diff --git a/c/clang/clang.go b/c/clang/clang.go index 7103686a..e7e0ff2b 100644 --- a/c/clang/clang.go +++ b/c/clang/clang.go @@ -1947,6 +1947,17 @@ func (t Type) NonReferenceType() (ret Type) { return } +/** + * Return the cursor for the declaration of the given type. + */ +// llgo:link (*Type).wrapTypeDeclaration C.wrap_clang_getTypeDeclaration +func (t *Type) wrapTypeDeclaration(ret *Cursor) { return } + +func (t Type) TypeDeclaration() (ret Cursor) { + t.wrapTypeDeclaration(&ret) + return +} + /** * Retrieve the spelling of a given CXTypeKind. */ @@ -1995,6 +2006,14 @@ func (t Type) ArgType(index c.Uint) (ret Type) { return } +/** + * Return 1 if the CXType is a variadic function type, and 0 otherwise. + */ +// llgo:link (*Type).wrapIsFunctionTypeVariadic C.wrap_clang_isFunctionTypeVariadic +func (t *Type) wrapIsFunctionTypeVariadic() (ret c.Uint) { return 0 } + +func (t Type) IsFunctionTypeVariadic() (ret c.Uint) { return t.wrapIsFunctionTypeVariadic() } + /** * Retrieve the return type associated with a given cursor. * @@ -2159,6 +2178,14 @@ func (c Cursor) String() (ret String) { return c.wrapString() } +/** + * Returns non-zero if the given cursor is a variadic function or method. + */ +// llgo:link (*Cursor).wrapIsVariadic C.wrap_clang_Cursor_isVariadic +func (*Cursor) wrapIsVariadic() (ret c.Uint) { return 0 } + +func (c Cursor) IsVariadic() (ret c.Uint) { return c.wrapIsVariadic() } + /** * Given a cursor that represents a declaration, return the associated * comment text, including comment markers.