c/clang/symg:normal gen json

This commit is contained in:
luoliwoshang
2024-07-26 14:37:26 +08:00
parent f391ccb8e8
commit c53484f92e
3 changed files with 21 additions and 6 deletions

View File

@@ -70,7 +70,13 @@ func collectFuncInfo(cursor clang.Cursor) ASTInformation {
symbol := cursor.Mangling()
info.Name = c.GoString(cursorStr.CStr())
info.Symbol = c.GoString(symbol.CStr())
if len(info.Symbol) >= 1 {
if info.Symbol[0] == '_' {
info.Symbol = info.Symbol[1:]
}
}
defer symbol.Dispose()
defer cursorStr.Dispose()
@@ -212,6 +218,7 @@ func main() {
fmt.Fprintln(os.Stderr, "Usage: <C++ header file>\n")
return
} else {
// sourceFile := *c.Advance(c.Argv, 1)
printJson(parse(c.Index(c.Argv, 1)))
// fmt.Println("Json end")