llcppsigfetch:func inline & static

This commit is contained in:
luoliwoshang
2024-08-26 10:56:36 +08:00
parent 24fd2e1849
commit b1225951f2
5 changed files with 130 additions and 26 deletions

View File

@@ -296,37 +296,44 @@ func (ct *Converter) ProcessFuncDecl(cursor clang.Cursor) *ast.FuncDecl {
Type: funcType,
}
// other info of function&method
if cursor.Kind == clang.CursorDestructor {
fn.IsDestructor = true
if cursor.IsFunctionInlined() != 0 {
fn.IsInline = true
}
if cursor.Kind == clang.CursorConstructor {
fn.IsConstructor = true
if cursor.IsExplicit() != 0 {
fn.IsExplicit = true
if cursor.Kind == clang.CursorCXXMethod || cursor.Kind == clang.CursorDestructor || cursor.Kind == clang.CursorConstructor {
if cursor.Kind == clang.CursorDestructor {
fn.IsDestructor = true
}
if cursor.Kind == clang.CursorConstructor {
fn.IsConstructor = true
if cursor.IsExplicit() != 0 {
fn.IsExplicit = true
}
}
if cursor.IsStatic() != 0 {
fn.IsStatic = true
}
// virtual & pure virtual
if cursor.IsVirtual() != 0 || cursor.IsPureVirtual() != 0 {
fn.IsVirtual = true
}
if cursor.IsConst() != 0 {
fn.IsConst = true
}
var numOverridden c.Uint
var overridden *clang.Cursor
cursor.OverriddenCursors(&overridden, &numOverridden)
if numOverridden > 0 {
fn.IsOverride = true
}
overridden.DisposeOverriddenCursors()
} else {
if cursor.StorageClass() == clang.SCStatic {
fn.IsStatic = true
}
}
if cursor.IsStatic() != 0 {
fn.IsStatic = true
}
// virtual & pure virtual
if cursor.IsVirtual() != 0 || cursor.IsPureVirtual() != 0 {
fn.IsVirtual = true
}
// todo(zzy):inline & const
var numOverridden c.Uint
var overridden *clang.Cursor
cursor.OverriddenCursors(&overridden, &numOverridden)
if numOverridden > 0 {
fn.IsOverride = true
}
overridden.DisposeOverriddenCursors()
return fn
}