llcppsigfetch:include

This commit is contained in:
luoliwoshang
2024-08-18 11:16:43 +08:00
parent 02651c93a7
commit 9d16df5f25
4 changed files with 104 additions and 4 deletions

View File

@@ -160,9 +160,8 @@ func visit(cursor, parent clang.Cursor, clientData unsafe.Pointer) clang.ChildVi
switch cursor.Kind {
case clang.CursorInclusionDirective:
// todo(zzy)
ct.ProcessInclude(cursor)
case clang.CursorMacroDefinition:
// todo(zzy)
ct.ProcessMarco(cursor)
case clang.CursorEnumDecl:
// todo(zzy)
@@ -277,6 +276,12 @@ func (ct *Converter) ProcessMarco(cursor clang.Cursor) {
ct.curFile.Macros = append(ct.curFile.Macros, macro)
}
func (ct *Converter) ProcessInclude(cursor clang.Cursor) {
name := cursor.String()
defer name.Dispose()
ct.curFile.Includes = append(ct.curFile.Includes, &ast.Include{Path: c.GoString(name.CStr())})
}
type visitFieldContext struct {
params *ast.FieldList
converter *Converter