castdump:funcproto type & enum value

This commit is contained in:
luoliwoshang
2024-08-07 20:07:27 +08:00
parent 4fda2b656f
commit 8d70aba1f5
3 changed files with 100 additions and 14 deletions

View File

@@ -1608,6 +1608,22 @@ func (c Cursor) ResultType() (ret Type) {
return
}
/**
* Retrieve the integer value of an enum constant declaration as a signed
* long long.
*
* If the cursor does not reference an enum constant declaration, LLONG_MIN is
* returned. Since this is also potentially a valid constant value, the kind of
* the cursor must be verified before calling this function.
*/
// llgo:link (*Cursor).wrapEnumConstantDeclValue C.wrap_clang_getEnumConstantDeclValue
func (*Cursor) wrapEnumConstantDeclValue() (ret c.LongLong) {
return 0
}
func (c Cursor) EnumConstantDeclValue() (ret c.LongLong) {
return c.wrapEnumConstantDeclValue()
}
/**
* Retrieve the number of non-variadic arguments associated with a given
* cursor.
@@ -1788,6 +1804,47 @@ func (t Type) String() (ret String) {
return t.wrapString()
}
/**
* Retrieve the return type associated with a function type.
*
* If a non-function type is passed in, an invalid type is returned.
*/
// llgo:link (*Type).wrapResultType C.wrap_clang_getResultType
func (t *Type) wrapResultType(ret *Type) { return }
func (t Type) ResultType() (ret Type) {
t.wrapResultType(&ret)
return
}
/**
* Retrieve the number of non-variadic parameters associated with a
* function type.
*
* If a non-function type is passed in, -1 is returned.
*/
// llgo:link (*Type).wrapNumArgTypes C.wrap_clang_getNumArgTypes
func (t *Type) wrapNumArgTypes() (num c.Int) { return 0 }
func (t Type) NumArgTypes() (num c.Int) {
return t.wrapNumArgTypes()
}
// void wrap_clang_getArgType(CXType *typ, unsigned i, CXType *argTyp) { *argTyp = clang_getArgType(*typ, i); }
/**
* Retrieve the type of a parameter of a function type.
*
* If a non-function type is passed in or the function does not have enough
* parameters, an invalid type is returned.
*/
// llgo:link (*Type).wrapArgType C.wrap_clang_getArgType
func (t *Type) wrapArgType(index c.Uint, argTyp *Type) { return }
func (t Type) ArgType(index c.Uint) (ret Type) {
t.wrapArgType(index, &ret)
return
}
/**
* For pointer types, returns the type of the pointee.
*/
@@ -1806,6 +1863,7 @@ func (t Type) PointeeType() (ret Type) {
*/
// llgo:link (*Type).wrapArrayElementType C.wrap_clang_getArrayElementType
func (t *Type) wrapArrayElementType(ret *Type) { return }
func (t Type) ArrayElementType() (ret Type) {
t.wrapArrayElementType(&ret)
return
@@ -1821,6 +1879,7 @@ func (t Type) ArrayElementType() (ret Type) {
*/
// llgo:link (*Type).wrapCanonicalType C.wrap_clang_getCanonicalType
func (t *Type) wrapCanonicalType(ret *Type) { return }
func (t Type) CanonicalType() (ret Type) {
t.wrapCanonicalType(&ret)
return