llcppsigfetch:union

This commit is contained in:
luoliwoshang
2024-08-20 10:43:01 +08:00
parent bf8aa502f9
commit 43bcf1051d
3 changed files with 69 additions and 0 deletions

View File

@@ -194,6 +194,8 @@ func visit(cursor, parent clang.Cursor, clientData unsafe.Pointer) clang.ChildVi
ct.PopScope()
case clang.CursorStructDecl:
ct.ProcessStruct(cursor)
case clang.CursorUnionDecl:
ct.ProcessUnion(cursor)
case clang.CursorFunctionDecl:
ct.curFile.Decls = append(ct.curFile.Decls, ct.ProcessFunc(cursor))
case clang.CursorNamespace:
@@ -435,6 +437,11 @@ func (ct *Converter) ProcessStruct(cursor clang.Cursor) {
ct.curFile.Decls = append(ct.curFile.Decls, structDecl)
}
func (ct *Converter) ProcessUnion(cursor clang.Cursor) {
structDecl := ct.ProcessStructOrClass(cursor, ast.Union)
ct.curFile.Decls = append(ct.curFile.Decls, structDecl)
}
func (ct *Converter) ProcessClass(cursor clang.Cursor) {
classDecl := ct.ProcessStructOrClass(cursor, ast.Class)
// other logic for class