From a08a1c98c0164b36b834effa2f9afd5b823d717a Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Wed, 22 Jan 2025 13:44:47 +0800 Subject: [PATCH] llcppsigfetch:collect typedef,class,struct,method,field,enum USR --- _xtool/llcppsigfetch/parse/cvt.go | 63 ++-- .../complex_test/forwarddecl_test/llgo.expect | 165 ++++++---- .../cvt_test/decl_test/class_test/llgo.expect | 180 ++++++----- .../decl_test/comment_test/llgo.expect | 99 +++--- .../cvt_test/decl_test/enum_test/llgo.expect | 57 ++-- .../cvt_test/decl_test/func_test/llgo.expect | 123 +++---- .../cvt_test/decl_test/scope_test/llgo.expect | 63 ++-- .../decl_test/struct_test/llgo.expect | 63 ++-- .../decl_test/typedef_test/llgo.expect | 303 ++++++++++-------- .../cvt_test/decl_test/union_test/llgo.expect | 42 ++- .../cvt_test/preprocess_test/llgo.expect | 9 +- .../parse/cvt_test/type_test/llgo.expect | 54 ++-- _xtool/llcppsigfetch/parse/dump.go | 2 +- _xtool/llcppsymg/clangutils/clangutils.go | 16 +- _xtool/llcppsymg/parse/parse.go | 2 +- ast/ast.go | 2 +- 16 files changed, 711 insertions(+), 532 deletions(-) diff --git a/_xtool/llcppsigfetch/parse/cvt.go b/_xtool/llcppsigfetch/parse/cvt.go index 7567d02ae..8f0884839 100644 --- a/_xtool/llcppsigfetch/parse/cvt.go +++ b/_xtool/llcppsigfetch/parse/cvt.go @@ -177,9 +177,7 @@ func (ct *Converter) GetCurFile(cursor clang.Cursor) *ast.File { } func (ct *Converter) CreateDeclBase(cursor clang.Cursor) ast.DeclBase { - usr := toStr(cursor.USR()) base := ast.DeclBase{ - USR: usr, Loc: &ast.Location{ File: ct.curLoc.File, }, @@ -417,7 +415,7 @@ func (ct *Converter) ProcessFunctionType(t clang.Type) *ast.FuncType { func (ct *Converter) ProcessTypeDefDecl(cursor clang.Cursor) *ast.TypedefDecl { ct.incIndent() defer ct.decIndent() - name, kind := getCursorDesc(cursor) + name, kind, usr := getCursorDesc(cursor) ct.logln("ProcessTypeDefDecl: CursorName:", name, "CursorKind:", kind, "CursorTypeKind:", toStr(cursor.Type().Kind.String())) typ := ct.ProcessUnderlyingType(cursor) @@ -432,7 +430,7 @@ func (ct *Converter) ProcessTypeDefDecl(cursor clang.Cursor) *ast.TypedefDecl { decl := &ast.TypedefDecl{ DeclBase: ct.CreateDeclBase(cursor), - Name: &ast.Ident{Name: name}, + Name: &ast.Ident{Name: name, USR: usr}, Type: typ, } return decl @@ -502,7 +500,7 @@ func (ct *Converter) getActualType(t clang.Type) clang.Type { func (ct *Converter) ProcessFuncDecl(cursor clang.Cursor) *ast.FuncDecl { ct.incIndent() defer ct.decIndent() - name, kind := getCursorDesc(cursor) + name, kind, usr := getCursorDesc(cursor) mangledName := toStr(cursor.Mangling()) ct.logln("ProcessFuncDecl: CursorName:", name, "CursorKind:", kind, "mangledName:", mangledName) @@ -532,10 +530,10 @@ func (ct *Converter) ProcessFuncDecl(cursor clang.Cursor) *ast.FuncDecl { numFields := c.Int(len(funcType.Params.List)) for i := c.Int(0); i < numArgs; i++ { arg := cursor.Argument(c.Uint(i)) - name := clang.GoString(arg.DisplayName()) + name := clang.GoString(arg.String()) if len(name) > 0 && i < numFields { field := funcType.Params.List[i] - field.Names = []*ast.Ident{&ast.Ident{Name: name}} + field.Names = []*ast.Ident{{Name: name, USR: clang.GoString(arg.USR())}} } } } @@ -547,7 +545,7 @@ func (ct *Converter) ProcessFuncDecl(cursor clang.Cursor) *ast.FuncDecl { funcDecl := &ast.FuncDecl{ DeclBase: ct.CreateDeclBase(cursor), - Name: &ast.Ident{Name: name}, + Name: &ast.Ident{Name: name, USR: usr}, Type: funcType, MangledName: mangledName, } @@ -608,15 +606,12 @@ func (ct *Converter) ProcessEnumType(cursor clang.Cursor) *ast.EnumType { clangutils.VisitChildren(cursor, func(cursor, parent clang.Cursor) clang.ChildVisitResult { if cursor.Kind == clang.CursorEnumConstantDecl { - name := cursor.String() - defer name.Dispose() - val := (*c.Char)(c.Malloc(unsafe.Sizeof(c.Char(0)) * 20)) c.Sprintf(val, c.Str("%lld"), cursor.EnumConstantDeclValue()) defer c.Free(unsafe.Pointer(val)) enum := &ast.EnumItem{ - Name: &ast.Ident{Name: c.GoString(name.CStr())}, + Name: &ast.Ident{Name: clang.GoString(cursor.String()), USR: clang.GoString(cursor.USR())}, Value: &ast.BasicLit{ Kind: ast.IntLit, Value: c.GoString(val), @@ -633,7 +628,7 @@ func (ct *Converter) ProcessEnumType(cursor clang.Cursor) *ast.EnumType { } func (ct *Converter) ProcessEnumDecl(cursor clang.Cursor) *ast.EnumTypeDecl { - cursorName, cursorKind := getCursorDesc(cursor) + cursorName, cursorKind, cursorUSR := getCursorDesc(cursor) ct.logln("ProcessEnumDecl: CursorName:", cursorName, "CursorKind:", cursorKind) decl := &ast.EnumTypeDecl{ @@ -643,7 +638,7 @@ func (ct *Converter) ProcessEnumDecl(cursor clang.Cursor) *ast.EnumTypeDecl { anony := cursor.IsAnonymous() if anony == 0 { - decl.Name = &ast.Ident{Name: cursorName} + decl.Name = &ast.Ident{Name: cursorName, USR: cursorUSR} ct.logln("ProcessEnumDecl: has name", cursorName) } else { ct.logln("ProcessRecordDecl: is anonymous") @@ -677,8 +672,6 @@ func (ct *Converter) createBaseField(cursor clang.Cursor) *ast.Field { ct.incIndent() defer ct.decIndent() - fieldName := toStr(cursor.String()) - typ := cursor.Type() typeName, typeKind := getTypeDesc(typ) @@ -696,8 +689,14 @@ func (ct *Converter) createBaseField(cursor clang.Cursor) *ast.Field { field.Comment = commentGroup } } + + fieldName := clang.GoString(cursor.String()) + if fieldName != "" { - field.Names = []*ast.Ident{{Name: fieldName}} + field.Names = []*ast.Ident{{ + Name: fieldName, + USR: clang.GoString(cursor.USR()), + }} } return field } @@ -754,7 +753,7 @@ func (ct *Converter) ProcessMethods(cursor clang.Cursor) []*ast.FuncDecl { func (ct *Converter) ProcessRecordDecl(cursor clang.Cursor) *ast.TypeDecl { ct.incIndent() defer ct.decIndent() - cursorName, cursorKind := getCursorDesc(cursor) + cursorName, cursorKind, cursorUSR := getCursorDesc(cursor) ct.logln("ProcessRecordDecl: CursorName:", cursorName, "CursorKind:", cursorKind) decl := &ast.TypeDecl{ @@ -764,7 +763,7 @@ func (ct *Converter) ProcessRecordDecl(cursor clang.Cursor) *ast.TypeDecl { anony := cursor.IsAnonymousRecordDecl() if anony == 0 { - decl.Name = &ast.Ident{Name: cursorName} + decl.Name = &ast.Ident{Name: cursorName, USR: cursorUSR} ct.logln("ProcessRecordDecl: has name", cursorName) } else { ct.logln("ProcessRecordDecl: is anonymous") @@ -782,7 +781,7 @@ func (ct *Converter) ProcessUnionDecl(cursor clang.Cursor) *ast.TypeDecl { } func (ct *Converter) ProcessClassDecl(cursor clang.Cursor) *ast.TypeDecl { - cursorName, cursorKind := getCursorDesc(cursor) + cursorName, cursorKind, cursorUSR := getCursorDesc(cursor) ct.logln("ProcessClassDecl: CursorName:", cursorName, "CursorKind:", cursorKind) // Pushing class scope before processing its type and popping after @@ -791,7 +790,7 @@ func (ct *Converter) ProcessClassDecl(cursor clang.Cursor) *ast.TypeDecl { decl := &ast.TypeDecl{ DeclBase: base, - Name: &ast.Ident{Name: cursorName}, + Name: &ast.Ident{Name: cursorName, USR: cursorUSR}, Type: typ, } @@ -802,7 +801,7 @@ func (ct *Converter) ProcessRecordType(cursor clang.Cursor) *ast.RecordType { ct.incIndent() defer ct.decIndent() - cursorName, cursorKind := getCursorDesc(cursor) + cursorName, cursorKind, _ := getCursorDesc(cursor) ct.logln("ProcessRecordType: CursorName:", cursorName, "CursorKind:", cursorKind) tag := toTag(cursor.Kind) @@ -863,9 +862,12 @@ func (ct *Converter) ProcessElaboratedType(t clang.Type) ast.Expr { func (ct *Converter) ProcessTypeDefType(t clang.Type) ast.Expr { cursor := t.TypeDeclaration() - ct.logln("ProcessTypeDefType: Typedef TypeDeclaration", toStr(cursor.String()), toStr(t.String())) + typeName, typeKind := getTypeDesc(t) + cursorName, cursorKind, cursorUSR := getCursorDesc(cursor) + + ct.logln("ProcessTypeDefType: Typedef TypeDeclaration", cursorName, cursorKind, typeName, typeKind) if name := toStr(cursor.String()); name != "" { - return &ast.Ident{Name: name} + return &ast.Ident{Name: name, USR: cursorUSR} } ct.logln("ProcessTypeDefType: typedef type have no name") return nil @@ -995,16 +997,16 @@ func isMethod(cursor clang.Cursor) bool { return cursor.Kind == clang.CursorCXXMethod || cursor.Kind == clang.CursorConstructor || cursor.Kind == clang.CursorDestructor } -func buildScopingFromParts(parts []string) ast.Expr { +func buildScopingFromParts(parts []*clangutils.ScopingPart) ast.Expr { if len(parts) == 0 { return nil } - var expr ast.Expr = &ast.Ident{Name: parts[0]} + var expr ast.Expr = &ast.Ident{Name: parts[0].Name, USR: parts[0].USR} for _, part := range parts[1:] { expr = &ast.ScopingExpr{ Parent: expr, - X: &ast.Ident{Name: part}, + X: &ast.Ident{Name: part.Name, USR: part.USR}, } } return expr @@ -1029,8 +1031,9 @@ func getTypeDesc(t clang.Type) (name string, kind string) { return } -func getCursorDesc(cursor clang.Cursor) (name string, kind string) { - name = toStr(cursor.String()) - kind = toStr(cursor.Kind.String()) +func getCursorDesc(cursor clang.Cursor) (name string, kind string, usr string) { + name = clang.GoString(cursor.String()) + kind = clang.GoString(cursor.Kind.String()) + usr = clang.GoString(cursor.USR()) return } diff --git a/_xtool/llcppsigfetch/parse/cvt_test/complex_test/forwarddecl_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/complex_test/forwarddecl_test/llgo.expect index 50390494c..488963bd6 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/complex_test/forwarddecl_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/complex_test/forwarddecl_test/llgo.expect @@ -6,14 +6,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@Foo" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@S@Foo" }, "Type": { "_Type": "RecordType", @@ -28,7 +28,8 @@ "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "bar" + "Name": "bar", + "USR": "c:@S@bar" }, "Tag": 0 } @@ -39,7 +40,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@S@Foo@FI@b" }] }] }, @@ -49,14 +51,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@bar" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "bar" + "Name": "bar", + "USR": "c:@S@bar" }, "Type": { "_Type": "RecordType", @@ -76,7 +78,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@bar@FI@a" }] }] }, @@ -86,14 +89,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@sqlite3_pcache_page" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "sqlite3_pcache_page" + "Name": "sqlite3_pcache_page", + "USR": "c:@S@sqlite3_pcache_page" }, "Type": { "_Type": "RecordType", @@ -108,14 +111,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@sqlite3_pcache_page" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "sqlite3_pcache_page" + "Name": "sqlite3_pcache_page", + "USR": "c:@S@sqlite3_pcache_page" }, "Type": { "_Type": "RecordType", @@ -138,7 +141,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "pExtra" + "Name": "pExtra", + "USR": "c:@S@sqlite3_pcache_page@FI@pExtra" }] }] }, @@ -148,14 +152,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@sqlite3_pcache" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "sqlite3_pcache" + "Name": "sqlite3_pcache", + "USR": "c:@S@sqlite3_pcache" }, "Type": { "_Type": "RecordType", @@ -170,14 +174,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@sqlite3_pcache_methods2" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "sqlite3_pcache_methods2" + "Name": "sqlite3_pcache_methods2", + "USR": "c:@S@sqlite3_pcache_methods2" }, "Type": { "_Type": "RecordType", @@ -192,14 +196,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@sqlite3_pcache_methods2" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "sqlite3_pcache_methods2" + "Name": "sqlite3_pcache_methods2", + "USR": "c:@S@sqlite3_pcache_methods2" }, "Type": { "_Type": "RecordType", @@ -219,7 +223,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "iVersion" + "Name": "iVersion", + "USR": "c:@S@sqlite3_pcache_methods2@FI@iVersion" }] }, { "_Type": "Field", @@ -259,7 +264,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "xShutdown" + "Name": "xShutdown", + "USR": "c:@S@sqlite3_pcache_methods2@FI@xShutdown" }] }, { "_Type": "Field", @@ -311,7 +317,8 @@ "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "sqlite3_pcache" + "Name": "sqlite3_pcache", + "USR": "c:forwarddecl.h@T@sqlite3_pcache" } } } @@ -322,7 +329,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "xCreate" + "Name": "xCreate", + "USR": "c:@S@sqlite3_pcache_methods2@FI@xCreate" }] }] }, @@ -332,14 +340,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@sqlite3_file" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "sqlite3_file" + "Name": "sqlite3_file", + "USR": "c:@S@sqlite3_file" }, "Type": { "_Type": "RecordType", @@ -354,14 +362,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@sqlite3_file" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "sqlite3_file" + "Name": "sqlite3_file", + "USR": "c:@S@sqlite3_file" }, "Type": { "_Type": "RecordType", @@ -374,7 +382,8 @@ "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "sqlite3_io_methods" + "Name": "sqlite3_io_methods", + "USR": "c:@S@sqlite3_io_methods" } }, "Doc": null, @@ -383,7 +392,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "pMethods" + "Name": "pMethods", + "USR": "c:@S@sqlite3_file@FI@pMethods" }] }] }, @@ -393,14 +403,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@sqlite3_io_methods" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "sqlite3_io_methods" + "Name": "sqlite3_io_methods", + "USR": "c:@S@sqlite3_io_methods" }, "Type": { "_Type": "RecordType", @@ -421,7 +431,8 @@ "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "sqlite3_file" + "Name": "sqlite3_file", + "USR": "c:forwarddecl.h@T@sqlite3_file" } }, "Doc": null, @@ -471,7 +482,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "xUnfetch" + "Name": "xUnfetch", + "USR": "c:@S@sqlite3_io_methods@FI@xUnfetch" }] }] }, @@ -481,14 +493,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@lua_State" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "lua_State" + "Name": "lua_State", + "USR": "c:@S@lua_State" }, "Type": { "_Type": "RecordType", @@ -503,14 +515,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@lua_Debug" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "lua_Debug" + "Name": "lua_Debug", + "USR": "c:@S@lua_Debug" }, "Type": { "_Type": "RecordType", @@ -525,14 +537,14 @@ "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@F@lua_getstack" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "lua_getstack" + "Name": "lua_getstack", + "USR": "c:@F@lua_getstack" }, "MangledName": "lua_getstack", "Type": { @@ -545,7 +557,8 @@ "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "lua_State" + "Name": "lua_State", + "USR": "c:forwarddecl.h@T@lua_State" } }, "Doc": null, @@ -554,7 +567,8 @@ "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "L" + "Name": "L", + "USR": "c:forwarddecl.h@868@F@lua_getstack@L" }] }, { "_Type": "Field", @@ -569,7 +583,8 @@ "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "level" + "Name": "level", + "USR": "c:forwarddecl.h@882@F@lua_getstack@level" }] }, { "_Type": "Field", @@ -577,7 +592,8 @@ "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "lua_Debug" + "Name": "lua_Debug", + "USR": "c:forwarddecl.h@T@lua_Debug" } }, "Doc": null, @@ -586,7 +602,8 @@ "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "ar" + "Name": "ar", + "USR": "c:forwarddecl.h@893@F@lua_getstack@ar" }] }] }, @@ -608,14 +625,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h", - "USR": "c:@S@lua_Debug" + "File": "./hfile/forwarddecl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "lua_Debug" + "Name": "lua_Debug", + "USR": "c:@S@lua_Debug" }, "Type": { "_Type": "RecordType", @@ -643,7 +660,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "short_src" + "Name": "short_src", + "USR": "c:@S@lua_Debug@FI@short_src" }] }, { "_Type": "Field", @@ -653,7 +671,8 @@ "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "CallInfo" + "Name": "CallInfo", + "USR": "c:@S@CallInfo" }, "Tag": 0 } @@ -664,7 +683,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "i_ci" + "Name": "i_ci", + "USR": "c:@S@lua_Debug@FI@i_ci" }] }] }, @@ -695,14 +715,14 @@ "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "./hfile/def.h", - "USR": "c:@F@f" + "File": "./hfile/def.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "f" + "Name": "f", + "USR": "c:@F@f" }, "MangledName": "f", "Type": { @@ -715,7 +735,8 @@ "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:def.h@T@foo" } }, "Doc": null, @@ -724,7 +745,8 @@ "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "f" + "Name": "f", + "USR": "c:def.h@49@F@f@f" }] }] }, @@ -755,14 +777,14 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/impl.h", - "USR": "c:@S@foo" + "File": "./hfile/impl.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@S@foo" }, "Type": { "_Type": "RecordType", @@ -782,7 +804,8 @@ "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@foo@FI@a" }] }] }, diff --git a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/class_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/class_test/llgo.expect index dfbe67602..37f921bf1 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/class_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/class_test/llgo.expect @@ -7,14 +7,14 @@ TestClassDecl Case 1: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Type": { "_Type": "RecordType", @@ -34,7 +34,8 @@ TestClassDecl Case 1: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@A@FI@a" }] }, { "_Type": "Field", @@ -49,7 +50,8 @@ TestClassDecl Case 1: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@S@A@FI@b" }] }] }, @@ -69,14 +71,14 @@ TestClassDecl Case 2: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Type": { "_Type": "RecordType", @@ -96,7 +98,8 @@ TestClassDecl Case 2: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@A@a" }] }, { "_Type": "Field", @@ -111,7 +114,8 @@ TestClassDecl Case 2: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@S@A@FI@b" }] }] }, @@ -119,17 +123,18 @@ TestClassDecl Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A@F@foo#I#d#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@S@A@F@foo#I#d#" }, "MangledName": "_ZN1A3fooEid", "Type": { @@ -149,7 +154,8 @@ TestClassDecl Case 2: "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:temp.h@60@S@A@F@foo#I#d#@a" }] }, { "_Type": "Field", @@ -164,7 +170,8 @@ TestClassDecl Case 2: "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:temp.h@66@S@A@F@foo#I#d#@b" }] }] }, @@ -186,17 +193,18 @@ TestClassDecl Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A@F@vafoo#I.#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Name": { "_Type": "Ident", - "Name": "vafoo" + "Name": "vafoo", + "USR": "c:@S@A@F@vafoo#I.#" }, "MangledName": "_ZN1A5vafooEiz", "Type": { @@ -216,7 +224,8 @@ TestClassDecl Case 2: "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:temp.h@91@S@A@F@vafoo#I.#@a" }] }, { "_Type": "Field", @@ -260,14 +269,14 @@ TestClassDecl Case 3: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Type": { "_Type": "RecordType", @@ -280,17 +289,18 @@ TestClassDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A@F@A#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Name": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A@F@A#" }, "MangledName": "_ZN1AC1Ev", "Type": { @@ -317,17 +327,18 @@ TestClassDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A@F@A#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Name": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A@F@A#" }, "MangledName": "_ZN1AC1Ev", "Type": { @@ -354,17 +365,18 @@ TestClassDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A@F@~A#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Name": { "_Type": "Ident", - "Name": "~A" + "Name": "~A", + "USR": "c:@S@A@F@~A#" }, "MangledName": "_ZN1AD1Ev", "Type": { @@ -391,17 +403,18 @@ TestClassDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A@F@foo#S" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@S@A@F@foo#S" }, "MangledName": "_ZN1A3fooEv", "Type": { @@ -440,14 +453,14 @@ TestClassDecl Case 4: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Base" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Base" + "Name": "Base", + "USR": "c:@S@Base" }, "Type": { "_Type": "RecordType", @@ -460,17 +473,18 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Base@F@Base#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "Base" + "Name": "Base", + "USR": "c:@S@Base" }, "Name": { "_Type": "Ident", - "Name": "Base" + "Name": "Base", + "USR": "c:@S@Base@F@Base#" }, "MangledName": "_ZN4BaseC1Ev", "Type": { @@ -497,17 +511,18 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Base@F@~Base#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "Base" + "Name": "Base", + "USR": "c:@S@Base" }, "Name": { "_Type": "Ident", - "Name": "~Base" + "Name": "~Base", + "USR": "c:@S@Base@F@~Base#" }, "MangledName": "_ZN4BaseD1Ev", "Type": { @@ -534,17 +549,18 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Base@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "Base" + "Name": "Base", + "USR": "c:@S@Base" }, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@S@Base@F@foo#" }, "MangledName": "_ZN4Base3fooEv", "Type": { @@ -573,14 +589,14 @@ TestClassDecl Case 4: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Derived" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Derived" + "Name": "Derived", + "USR": "c:@S@Derived" }, "Type": { "_Type": "RecordType", @@ -593,17 +609,18 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Derived@F@Derived#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "Derived" + "Name": "Derived", + "USR": "c:@S@Derived" }, "Name": { "_Type": "Ident", - "Name": "Derived" + "Name": "Derived", + "USR": "c:@S@Derived@F@Derived#" }, "MangledName": "_ZN7DerivedC1Ev", "Type": { @@ -630,17 +647,18 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Derived@F@~Derived#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "Derived" + "Name": "Derived", + "USR": "c:@S@Derived" }, "Name": { "_Type": "Ident", - "Name": "~Derived" + "Name": "~Derived", + "USR": "c:@S@Derived@F@~Derived#" }, "MangledName": "_ZN7DerivedD1Ev", "Type": { @@ -667,17 +685,18 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Derived@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "Derived" + "Name": "Derived", + "USR": "c:@S@Derived" }, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@S@Derived@F@foo#" }, "MangledName": "_ZN7Derived3fooEv", "Type": { @@ -716,17 +735,18 @@ TestClassDecl Case 5: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@N@A@S@Foo" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" }, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@N@A@S@Foo" }, "Type": { "_Type": "RecordType", @@ -741,24 +761,26 @@ TestClassDecl Case 5: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@N@A@S@Foo@F@bar#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@N@A@S@Foo" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } }, "Name": { "_Type": "Ident", - "Name": "bar" + "Name": "bar", + "USR": "c:@N@A@S@Foo@F@bar#" }, "MangledName": "_ZN1A3Foo3barEv", "Type": { diff --git a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/comment_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/comment_test/llgo.expect index 8cc75687f..7dc6c6d97 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/comment_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/comment_test/llgo.expect @@ -7,14 +7,14 @@ TestDoc Case 1: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -51,14 +51,14 @@ TestDoc Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -95,8 +95,7 @@ TestDoc Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": { "_Type": "CommentGroup", @@ -108,7 +107,8 @@ TestDoc Case 3: "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -145,8 +145,7 @@ TestDoc Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": { "_Type": "CommentGroup", @@ -158,7 +157,8 @@ TestDoc Case 4: "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -195,8 +195,7 @@ TestDoc Case 5: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": { "_Type": "CommentGroup", @@ -208,7 +207,8 @@ TestDoc Case 5: "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -245,8 +245,7 @@ TestDoc Case 6: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": { "_Type": "CommentGroup", @@ -261,7 +260,8 @@ TestDoc Case 6: "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -298,8 +298,7 @@ TestDoc Case 7: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": { "_Type": "CommentGroup", @@ -314,7 +313,8 @@ TestDoc Case 7: "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -351,8 +351,7 @@ TestDoc Case 8: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": { "_Type": "CommentGroup", @@ -367,7 +366,8 @@ TestDoc Case 8: "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -404,8 +404,7 @@ TestDoc Case 9: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": { "_Type": "CommentGroup", @@ -426,7 +425,8 @@ TestDoc Case 9: "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -463,14 +463,14 @@ TestDoc Case 10: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Foo" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@S@Foo" }, "Type": { "_Type": "RecordType", @@ -496,7 +496,8 @@ TestDoc Case 10: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:@S@Foo@FI@x" }] }, { "_Type": "Field", @@ -517,7 +518,8 @@ TestDoc Case 10: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "y" + "Name": "y", + "USR": "c:@S@Foo@FI@y" }] }, { "_Type": "Field", @@ -538,7 +540,8 @@ TestDoc Case 10: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "z" + "Name": "z", + "USR": "c:@S@Foo@FI@z" }] }] }, @@ -558,14 +561,14 @@ TestDoc Case 11: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Doc" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Doc" + "Name": "Doc", + "USR": "c:@S@Doc" }, "Type": { "_Type": "RecordType", @@ -597,7 +600,8 @@ TestDoc Case 11: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:@S@Doc@x" }] }, { "_Type": "Field", @@ -618,7 +622,8 @@ TestDoc Case 11: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "y" + "Name": "y", + "USR": "c:@S@Doc@y" }] }, { "_Type": "Field", @@ -645,7 +650,8 @@ TestDoc Case 11: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@Doc@FI@a" }] }, { "_Type": "Field", @@ -666,7 +672,8 @@ TestDoc Case 11: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@S@Doc@FI@b" }] }, { "_Type": "Field", @@ -687,7 +694,8 @@ TestDoc Case 11: "Access": 2, "Names": [{ "_Type": "Ident", - "Name": "value" + "Name": "value", + "USR": "c:@S@Doc@FI@value" }] }] }, @@ -695,8 +703,7 @@ TestDoc Case 11: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Doc@F@Foo#" + "File": "temp.h" }, "Doc": { "_Type": "CommentGroup", @@ -713,11 +720,13 @@ TestDoc Case 11: }, "Parent": { "_Type": "Ident", - "Name": "Doc" + "Name": "Doc", + "USR": "c:@S@Doc" }, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@S@Doc@F@Foo#" }, "MangledName": "_ZN3Doc3FooEv", "Type": { diff --git a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/enum_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/enum_test/llgo.expect index 85daa82aa..f455e79c2 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/enum_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/enum_test/llgo.expect @@ -7,8 +7,7 @@ TestEnumDecl Case 1: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@Ea@a" + "File": "temp.h" }, "Doc": null, "Parent": null, @@ -19,7 +18,8 @@ TestEnumDecl Case 1: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@Ea@a@a" }, "Value": { "_Type": "BasicLit", @@ -30,7 +30,8 @@ TestEnumDecl Case 1: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@Ea@a@b" }, "Value": { "_Type": "BasicLit", @@ -41,7 +42,8 @@ TestEnumDecl Case 1: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "c" + "Name": "c", + "USR": "c:@Ea@a@c" }, "Value": { "_Type": "BasicLit", @@ -64,14 +66,14 @@ TestEnumDecl Case 2: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@E@Foo" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@E@Foo" }, "Type": { "_Type": "EnumType", @@ -79,7 +81,8 @@ TestEnumDecl Case 2: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@E@Foo@a" }, "Value": { "_Type": "BasicLit", @@ -90,7 +93,8 @@ TestEnumDecl Case 2: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@E@Foo@b" }, "Value": { "_Type": "BasicLit", @@ -101,7 +105,8 @@ TestEnumDecl Case 2: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "c" + "Name": "c", + "USR": "c:@E@Foo@c" }, "Value": { "_Type": "BasicLit", @@ -124,14 +129,14 @@ TestEnumDecl Case 3: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@E@Foo" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@E@Foo" }, "Type": { "_Type": "EnumType", @@ -139,7 +144,8 @@ TestEnumDecl Case 3: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@E@Foo@a" }, "Value": { "_Type": "BasicLit", @@ -150,7 +156,8 @@ TestEnumDecl Case 3: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@E@Foo@b" }, "Value": { "_Type": "BasicLit", @@ -161,7 +168,8 @@ TestEnumDecl Case 3: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "c" + "Name": "c", + "USR": "c:@E@Foo@c" }, "Value": { "_Type": "BasicLit", @@ -184,14 +192,14 @@ TestEnumDecl Case 4: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@E@Foo" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@E@Foo" }, "Type": { "_Type": "EnumType", @@ -199,7 +207,8 @@ TestEnumDecl Case 4: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@E@Foo@a" }, "Value": { "_Type": "BasicLit", @@ -210,7 +219,8 @@ TestEnumDecl Case 4: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@E@Foo@b" }, "Value": { "_Type": "BasicLit", @@ -221,7 +231,8 @@ TestEnumDecl Case 4: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "c" + "Name": "c", + "USR": "c:@E@Foo@c" }, "Value": { "_Type": "BasicLit", diff --git a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect index 10b524c95..b9aa5a8c9 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect @@ -7,14 +7,14 @@ TestFuncDecl Case 1: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -51,14 +51,14 @@ TestFuncDecl Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#I#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#I#" }, "MangledName": "_Z3fooi", "Type": { @@ -78,7 +78,8 @@ TestFuncDecl Case 2: "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:temp.h@9@F@foo#I#@a" }] }] }, @@ -110,14 +111,14 @@ TestFuncDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#I.#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#I.#" }, "MangledName": "_Z3fooiz", "Type": { @@ -137,7 +138,8 @@ TestFuncDecl Case 3: "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:temp.h@9@F@foo#I.#@a" }] }, { "_Type": "Field", @@ -179,14 +181,14 @@ TestFuncDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#I#d#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#I#d#" }, "MangledName": "_Z3fooid", "Type": { @@ -206,7 +208,8 @@ TestFuncDecl Case 4: "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:temp.h@11@F@foo#I#d#@a" }] }, { "_Type": "Field", @@ -221,7 +224,8 @@ TestFuncDecl Case 4: "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:temp.h@17@F@foo#I#d#@b" }] }] }, @@ -256,14 +260,14 @@ TestFuncDecl Case 5: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@F@add#I#I#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "add" + "Name": "add", + "USR": "c:temp.h@F@add#I#I#" }, "MangledName": "_ZL3addii", "Type": { @@ -283,7 +287,8 @@ TestFuncDecl Case 5: "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:temp.h@22@F@add#I#I#@a" }] }, { "_Type": "Field", @@ -298,7 +303,8 @@ TestFuncDecl Case 5: "Access": 0, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:temp.h@29@F@add#I#I#@b" }] }] }, @@ -330,14 +336,14 @@ TestFuncDecl Case 6: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@fntype" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "fntype" + "Name": "fntype", + "USR": "c:temp.h@T@fntype" }, "Type": { "_Type": "FuncType", @@ -355,14 +361,14 @@ TestFuncDecl Case 6: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -399,14 +405,14 @@ TestFuncDecl Case 7: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@fntype" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "fntype" + "Name": "fntype", + "USR": "c:temp.h@T@fntype" }, "Type": { "_Type": "FuncType", @@ -436,31 +442,32 @@ TestFuncDecl Case 7: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@fntype2" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "fntype2" + "Name": "fntype2", + "USR": "c:temp.h@T@fntype2" }, "Type": { "_Type": "Ident", - "Name": "fntype" + "Name": "fntype", + "USR": "c:temp.h@T@fntype" } }, { "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#L#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#L#" }, "MangledName": "_Z3fool", "Type": { @@ -509,14 +516,14 @@ TestFuncDecl Case 8: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@OSSL_CORE_HANDLE" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "OSSL_CORE_HANDLE" + "Name": "OSSL_CORE_HANDLE", + "USR": "c:@S@OSSL_CORE_HANDLE" }, "Type": { "_Type": "RecordType", @@ -531,14 +538,14 @@ TestFuncDecl Case 8: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@OSSL_DISPATCH" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "OSSL_DISPATCH" + "Name": "OSSL_DISPATCH", + "USR": "c:@S@OSSL_DISPATCH" }, "Type": { "_Type": "RecordType", @@ -553,14 +560,14 @@ TestFuncDecl Case 8: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@OSSL_provider_init_fn" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "OSSL_provider_init_fn" + "Name": "OSSL_provider_init_fn", + "USR": "c:temp.h@T@OSSL_provider_init_fn" }, "Type": { "_Type": "FuncType", @@ -572,7 +579,8 @@ TestFuncDecl Case 8: "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "OSSL_CORE_HANDLE" + "Name": "OSSL_CORE_HANDLE", + "USR": "c:temp.h@T@OSSL_CORE_HANDLE" } }, "Doc": null, @@ -586,7 +594,8 @@ TestFuncDecl Case 8: "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "OSSL_DISPATCH" + "Name": "OSSL_DISPATCH", + "USR": "c:temp.h@T@OSSL_DISPATCH" } }, "Doc": null, @@ -602,7 +611,8 @@ TestFuncDecl Case 8: "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "OSSL_DISPATCH" + "Name": "OSSL_DISPATCH", + "USR": "c:temp.h@T@OSSL_DISPATCH" } } }, @@ -641,14 +651,14 @@ TestFuncDecl Case 8: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@OSSL_provider_init#*1$@S@OSSL_CORE_HANDLE#*1$@S@OSSL_DISPATCH#*S2_#**v#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "OSSL_provider_init" + "Name": "OSSL_provider_init", + "USR": "c:@F@OSSL_provider_init#*1$@S@OSSL_CORE_HANDLE#*1$@S@OSSL_DISPATCH#*S2_#**v#" }, "MangledName": "_Z18OSSL_provider_initPK16OSSL_CORE_HANDLEPK13OSSL_DISPATCHPS4_PPv", "Type": { @@ -661,7 +671,8 @@ TestFuncDecl Case 8: "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "OSSL_CORE_HANDLE" + "Name": "OSSL_CORE_HANDLE", + "USR": "c:temp.h@T@OSSL_CORE_HANDLE" } }, "Doc": null, @@ -675,7 +686,8 @@ TestFuncDecl Case 8: "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "OSSL_DISPATCH" + "Name": "OSSL_DISPATCH", + "USR": "c:temp.h@T@OSSL_DISPATCH" } }, "Doc": null, @@ -691,7 +703,8 @@ TestFuncDecl Case 8: "_Type": "PointerType", "X": { "_Type": "Ident", - "Name": "OSSL_DISPATCH" + "Name": "OSSL_DISPATCH", + "USR": "c:temp.h@T@OSSL_DISPATCH" } } }, diff --git a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/scope_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/scope_test/llgo.expect index c2ca3be5a..43bb39faa 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/scope_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/scope_test/llgo.expect @@ -7,14 +7,14 @@ TestScope Case 1: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@F@foo#" }, "MangledName": "_Z3foov", "Type": { @@ -51,17 +51,18 @@ TestScope Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@N@a@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@N@a" }, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@N@a@F@foo#" }, "MangledName": "_ZN1a3fooEv", "Type": { @@ -98,24 +99,26 @@ TestScope Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@N@a@N@b@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@N@a@N@b" }, "Parent": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@N@a" } }, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@N@a@N@b@F@foo#" }, "MangledName": "_ZN1a1b3fooEv", "Type": { @@ -152,14 +155,14 @@ TestScope Case 4: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@a" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@a" }, "Type": { "_Type": "RecordType", @@ -172,17 +175,18 @@ TestScope Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@a@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@a" }, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@S@a@F@foo#" }, "MangledName": "_ZN1a3fooEv", "Type": { @@ -221,17 +225,18 @@ TestScope Case 5: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@N@a@S@b" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@N@a" }, "Name": { "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@N@a@S@b" }, "Type": { "_Type": "RecordType", @@ -244,24 +249,26 @@ TestScope Case 5: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@N@a@S@b@F@foo#" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@N@a@S@b" }, "Parent": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@N@a" } }, "Name": { "_Type": "Ident", - "Name": "foo" + "Name": "foo", + "USR": "c:@N@a@S@b@F@foo#" }, "MangledName": "_ZN1a1b3fooEv", "Type": { diff --git a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/struct_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/struct_test/llgo.expect index bb7d04180..1d61a845a 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/struct_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/struct_test/llgo.expect @@ -7,8 +7,7 @@ TestStructDecl Case 1: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@Sa" + "File": "temp.h" }, "Doc": null, "Parent": null, @@ -31,7 +30,8 @@ TestStructDecl Case 1: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:temp.h@Sa@FI@a" }] }] }, @@ -51,14 +51,14 @@ TestStructDecl Case 2: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Type": { "_Type": "RecordType", @@ -78,7 +78,8 @@ TestStructDecl Case 2: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@A@FI@a" }] }, { "_Type": "Field", @@ -93,7 +94,8 @@ TestStructDecl Case 2: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@S@A@FI@b" }] }] }, @@ -113,14 +115,14 @@ TestStructDecl Case 3: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Type": { "_Type": "RecordType", @@ -140,7 +142,8 @@ TestStructDecl Case 3: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@A@FI@a" }] }, { "_Type": "Field", @@ -155,7 +158,8 @@ TestStructDecl Case 3: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@S@A@FI@b" }] }] }, @@ -175,14 +179,14 @@ TestStructDecl Case 4: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@A" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@S@A" }, "Type": { "_Type": "RecordType", @@ -202,7 +206,8 @@ TestStructDecl Case 4: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@S@A@FI@a" }] }, { "_Type": "Field", @@ -251,7 +256,8 @@ TestStructDecl Case 4: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@S@A@FI@Foo" }] }] }, @@ -271,14 +277,14 @@ TestStructDecl Case 5: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@S@Person" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Person" + "Name": "Person", + "USR": "c:@S@Person" }, "Type": { "_Type": "RecordType", @@ -298,7 +304,8 @@ TestStructDecl Case 5: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "age" + "Name": "age", + "USR": "c:@S@Person@FI@age" }] }, { "_Type": "Field", @@ -320,7 +327,8 @@ TestStructDecl Case 5: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "year" + "Name": "year", + "USR": "c:@S@Person@S@temp.h@31@FI@year" }] }, { "_Type": "Field", @@ -335,7 +343,8 @@ TestStructDecl Case 5: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "day" + "Name": "day", + "USR": "c:@S@Person@S@temp.h@31@FI@day" }] }, { "_Type": "Field", @@ -350,7 +359,8 @@ TestStructDecl Case 5: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "month" + "Name": "month", + "USR": "c:@S@Person@S@temp.h@31@FI@month" }] }] }, @@ -362,7 +372,8 @@ TestStructDecl Case 5: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "birthday" + "Name": "birthday", + "USR": "c:@S@Person@FI@birthday" }] }] }, diff --git a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/llgo.expect index 364cad8f6..26c117ba7 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/llgo.expect @@ -7,14 +7,14 @@ TestTypeDefDecl Case 1: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@INT" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "INT" + "Name": "INT", + "USR": "c:temp.h@T@INT" }, "Type": { "_Type": "BuiltinType", @@ -35,14 +35,14 @@ TestTypeDefDecl Case 2: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@INT" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "INT" + "Name": "INT", + "USR": "c:temp.h@T@INT" }, "Type": { "_Type": "BuiltinType", @@ -53,18 +53,19 @@ TestTypeDefDecl Case 2: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@STANDARD_INT" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "STANDARD_INT" + "Name": "STANDARD_INT", + "USR": "c:temp.h@T@STANDARD_INT" }, "Type": { "_Type": "Ident", - "Name": "INT" + "Name": "INT", + "USR": "c:temp.h@T@INT" } }], "includes": [], @@ -80,14 +81,14 @@ TestTypeDefDecl Case 3: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@INT" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "INT" + "Name": "INT", + "USR": "c:temp.h@T@INT" }, "Type": { "_Type": "BuiltinType", @@ -98,14 +99,14 @@ TestTypeDefDecl Case 3: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@IntPtr" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "IntPtr" + "Name": "IntPtr", + "USR": "c:temp.h@T@IntPtr" }, "Type": { "_Type": "PointerType", @@ -119,14 +120,14 @@ TestTypeDefDecl Case 3: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@IntArr" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "IntArr" + "Name": "IntArr", + "USR": "c:temp.h@T@IntArr" }, "Type": { "_Type": "ArrayType", @@ -151,14 +152,14 @@ TestTypeDefDecl Case 4: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@Foo" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:temp.h@T@Foo" }, "Type": { "_Type": "PointerType", @@ -223,14 +224,14 @@ TestTypeDefDecl Case 5: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@Foo" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:temp.h@T@Foo" }, "Type": { "_Type": "PointerType", @@ -275,14 +276,14 @@ TestTypeDefDecl Case 5: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@Bar" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "Bar" + "Name": "Bar", + "USR": "c:temp.h@T@Bar" }, "Type": { "_Type": "PointerType", @@ -343,17 +344,18 @@ TestTypeDefDecl Case 6: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@N@A@S@Foo" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" }, "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@N@A@S@Foo" }, "Type": { "_Type": "RecordType", @@ -373,7 +375,8 @@ TestTypeDefDecl Case 6: "Access": 3, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:@N@A@S@Foo@FI@x" }] }] }, @@ -383,17 +386,18 @@ TestTypeDefDecl Case 6: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@N@A@T@MyClass" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" }, "Name": { "_Type": "Ident", - "Name": "MyClass" + "Name": "MyClass", + "USR": "c:temp.h@N@A@T@MyClass" }, "Type": { "_Type": "TagExpr", @@ -401,11 +405,13 @@ TestTypeDefDecl Case 6: "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@N@A@S@Foo" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } }, "Tag": 3 @@ -414,17 +420,18 @@ TestTypeDefDecl Case 6: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@N@A@T@MyClassPtr" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" }, "Name": { "_Type": "Ident", - "Name": "MyClassPtr" + "Name": "MyClassPtr", + "USR": "c:temp.h@N@A@T@MyClassPtr" }, "Type": { "_Type": "PointerType", @@ -434,11 +441,13 @@ TestTypeDefDecl Case 6: "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@N@A@S@Foo" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } }, "Tag": 3 @@ -448,17 +457,18 @@ TestTypeDefDecl Case 6: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@N@A@T@MyClassArray" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" }, "Name": { "_Type": "Ident", - "Name": "MyClassArray" + "Name": "MyClassArray", + "USR": "c:temp.h@N@A@T@MyClassArray" }, "Type": { "_Type": "ArrayType", @@ -468,11 +478,13 @@ TestTypeDefDecl Case 6: "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@N@A@S@Foo" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } }, "Tag": 3 @@ -493,14 +505,14 @@ TestTypeDefDecl Case 7: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@SA@MyStruct" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "MyStruct" + "Name": "MyStruct", + "USR": "c:@SA@MyStruct" }, "Type": { "_Type": "RecordType", @@ -520,7 +532,8 @@ TestTypeDefDecl Case 7: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:@SA@MyStruct@FI@x" }] }] }, @@ -540,14 +553,14 @@ TestTypeDefDecl Case 8: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@UA@MyUnion" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "MyUnion" + "Name": "MyUnion", + "USR": "c:@UA@MyUnion" }, "Type": { "_Type": "RecordType", @@ -567,7 +580,8 @@ TestTypeDefDecl Case 8: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:@UA@MyUnion@FI@x" }] }] }, @@ -587,14 +601,14 @@ TestTypeDefDecl Case 9: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@EA@MyEnum" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "MyEnum" + "Name": "MyEnum", + "USR": "c:@EA@MyEnum" }, "Type": { "_Type": "EnumType", @@ -602,7 +616,8 @@ TestTypeDefDecl Case 9: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "RED" + "Name": "RED", + "USR": "c:@EA@MyEnum@RED" }, "Value": { "_Type": "BasicLit", @@ -613,7 +628,8 @@ TestTypeDefDecl Case 9: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "GREEN" + "Name": "GREEN", + "USR": "c:@EA@MyEnum@GREEN" }, "Value": { "_Type": "BasicLit", @@ -624,7 +640,8 @@ TestTypeDefDecl Case 9: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "BLUE" + "Name": "BLUE", + "USR": "c:@EA@MyEnum@BLUE" }, "Value": { "_Type": "BasicLit", @@ -647,14 +664,14 @@ TestTypeDefDecl Case 10: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@SA@MyStruct" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "MyStruct" + "Name": "MyStruct", + "USR": "c:@SA@MyStruct" }, "Type": { "_Type": "RecordType", @@ -674,7 +691,8 @@ TestTypeDefDecl Case 10: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:@SA@MyStruct@FI@x" }] }] }, @@ -684,20 +702,21 @@ TestTypeDefDecl Case 10: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@MyStruct2" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "MyStruct2" + "Name": "MyStruct2", + "USR": "c:temp.h@T@MyStruct2" }, "Type": { "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "MyStruct" + "Name": "MyStruct", + "USR": "c:@SA@MyStruct" }, "Tag": 0 } @@ -705,14 +724,14 @@ TestTypeDefDecl Case 10: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@StructPtr" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "StructPtr" + "Name": "StructPtr", + "USR": "c:temp.h@T@StructPtr" }, "Type": { "_Type": "PointerType", @@ -720,7 +739,8 @@ TestTypeDefDecl Case 10: "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "MyStruct" + "Name": "MyStruct", + "USR": "c:@SA@MyStruct" }, "Tag": 0 } @@ -729,14 +749,14 @@ TestTypeDefDecl Case 10: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@StructArr" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "StructArr" + "Name": "StructArr", + "USR": "c:temp.h@T@StructArr" }, "Type": { "_Type": "ArrayType", @@ -744,7 +764,8 @@ TestTypeDefDecl Case 10: "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "MyStruct" + "Name": "MyStruct", + "USR": "c:@SA@MyStruct" }, "Tag": 0 }, @@ -764,14 +785,14 @@ TestTypeDefDecl Case 11: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@EA@MyEnum" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "MyEnum" + "Name": "MyEnum", + "USR": "c:@EA@MyEnum" }, "Type": { "_Type": "EnumType", @@ -779,7 +800,8 @@ TestTypeDefDecl Case 11: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "RED" + "Name": "RED", + "USR": "c:@EA@MyEnum@RED" }, "Value": { "_Type": "BasicLit", @@ -790,7 +812,8 @@ TestTypeDefDecl Case 11: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "GREEN" + "Name": "GREEN", + "USR": "c:@EA@MyEnum@GREEN" }, "Value": { "_Type": "BasicLit", @@ -801,7 +824,8 @@ TestTypeDefDecl Case 11: "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "BLUE" + "Name": "BLUE", + "USR": "c:@EA@MyEnum@BLUE" }, "Value": { "_Type": "BasicLit", @@ -814,20 +838,21 @@ TestTypeDefDecl Case 11: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@MyEnum2" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "MyEnum2" + "Name": "MyEnum2", + "USR": "c:temp.h@T@MyEnum2" }, "Type": { "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "MyEnum" + "Name": "MyEnum", + "USR": "c:@EA@MyEnum" }, "Tag": 2 } @@ -835,14 +860,14 @@ TestTypeDefDecl Case 11: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@EnumPtr" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "EnumPtr" + "Name": "EnumPtr", + "USR": "c:temp.h@T@EnumPtr" }, "Type": { "_Type": "PointerType", @@ -850,7 +875,8 @@ TestTypeDefDecl Case 11: "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "MyEnum" + "Name": "MyEnum", + "USR": "c:@EA@MyEnum" }, "Tag": 2 } @@ -859,14 +885,14 @@ TestTypeDefDecl Case 11: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@T@EnumArr" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "EnumArr" + "Name": "EnumArr", + "USR": "c:temp.h@T@EnumArr" }, "Type": { "_Type": "ArrayType", @@ -874,7 +900,8 @@ TestTypeDefDecl Case 11: "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "MyEnum" + "Name": "MyEnum", + "USR": "c:@EA@MyEnum" }, "Tag": 2 }, @@ -894,24 +921,26 @@ TestTypeDefDecl Case 12: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@N@A@N@B@SA@MyStruct" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "B" + "Name": "B", + "USR": "c:@N@A@N@B" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } }, "Name": { "_Type": "Ident", - "Name": "MyStruct" + "Name": "MyStruct", + "USR": "c:@N@A@N@B@SA@MyStruct" }, "Type": { "_Type": "RecordType", @@ -931,7 +960,8 @@ TestTypeDefDecl Case 12: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:@N@A@N@B@SA@MyStruct@FI@x" }] }] }, @@ -941,24 +971,26 @@ TestTypeDefDecl Case 12: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@N@A@N@B@T@MyStruct2" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "B" + "Name": "B", + "USR": "c:@N@A@N@B" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } }, "Name": { "_Type": "Ident", - "Name": "MyStruct2" + "Name": "MyStruct2", + "USR": "c:temp.h@N@A@N@B@T@MyStruct2" }, "Type": { "_Type": "TagExpr", @@ -966,17 +998,20 @@ TestTypeDefDecl Case 12: "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "MyStruct" + "Name": "MyStruct", + "USR": "c:@N@A@N@B@SA@MyStruct" }, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "B" + "Name": "B", + "USR": "c:@N@A@N@B" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } } }, @@ -986,24 +1021,26 @@ TestTypeDefDecl Case 12: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@N@A@N@B@T@StructPtr" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "B" + "Name": "B", + "USR": "c:@N@A@N@B" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } }, "Name": { "_Type": "Ident", - "Name": "StructPtr" + "Name": "StructPtr", + "USR": "c:temp.h@N@A@N@B@T@StructPtr" }, "Type": { "_Type": "PointerType", @@ -1013,17 +1050,20 @@ TestTypeDefDecl Case 12: "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "MyStruct" + "Name": "MyStruct", + "USR": "c:@N@A@N@B@SA@MyStruct" }, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "B" + "Name": "B", + "USR": "c:@N@A@N@B" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } } }, @@ -1034,24 +1074,26 @@ TestTypeDefDecl Case 12: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@N@A@N@B@T@StructArr" + "File": "temp.h" }, "Doc": null, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "B" + "Name": "B", + "USR": "c:@N@A@N@B" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } }, "Name": { "_Type": "Ident", - "Name": "StructArr" + "Name": "StructArr", + "USR": "c:temp.h@N@A@N@B@T@StructArr" }, "Type": { "_Type": "ArrayType", @@ -1061,17 +1103,20 @@ TestTypeDefDecl Case 12: "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "MyStruct" + "Name": "MyStruct", + "USR": "c:@N@A@N@B@SA@MyStruct" }, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "B" + "Name": "B", + "USR": "c:@N@A@N@B" }, "Parent": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@N@A" } } }, diff --git a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/union_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/union_test/llgo.expect index ba5da7d65..0452c7cdd 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/decl_test/union_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/decl_test/union_test/llgo.expect @@ -7,8 +7,7 @@ TestUnionDecl Case 1: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:temp.h@Ua" + "File": "temp.h" }, "Doc": null, "Parent": null, @@ -31,7 +30,8 @@ TestUnionDecl Case 1: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:temp.h@Ua@FI@a" }] }, { "_Type": "Field", @@ -46,7 +46,8 @@ TestUnionDecl Case 1: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:temp.h@Ua@FI@b" }] }] }, @@ -66,14 +67,14 @@ TestUnionDecl Case 2: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@U@A" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "A" + "Name": "A", + "USR": "c:@U@A" }, "Type": { "_Type": "RecordType", @@ -93,7 +94,8 @@ TestUnionDecl Case 2: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@U@A@FI@a" }] }, { "_Type": "Field", @@ -108,7 +110,8 @@ TestUnionDecl Case 2: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@U@A@FI@b" }] }] }, @@ -128,14 +131,14 @@ TestUnionDecl Case 3: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h", - "USR": "c:@U@OuterUnion" + "File": "temp.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "OuterUnion" + "Name": "OuterUnion", + "USR": "c:@U@OuterUnion" }, "Type": { "_Type": "RecordType", @@ -155,7 +158,8 @@ TestUnionDecl Case 3: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "i" + "Name": "i", + "USR": "c:@U@OuterUnion@FI@i" }] }, { "_Type": "Field", @@ -170,7 +174,8 @@ TestUnionDecl Case 3: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "f" + "Name": "f", + "USR": "c:@U@OuterUnion@FI@f" }] }, { "_Type": "Field", @@ -192,7 +197,8 @@ TestUnionDecl Case 3: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "c" + "Name": "c", + "USR": "c:@U@OuterUnion@U@temp.h@53@FI@c" }] }, { "_Type": "Field", @@ -207,7 +213,8 @@ TestUnionDecl Case 3: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "s" + "Name": "s", + "USR": "c:@U@OuterUnion@U@temp.h@53@FI@s" }] }] }, @@ -219,7 +226,8 @@ TestUnionDecl Case 3: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "inner" + "Name": "inner", + "USR": "c:@U@OuterUnion@FI@inner" }] }] }, diff --git a/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect index fd12cb075..360c0dc3d 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect @@ -128,14 +128,14 @@ TestMacroExpansionOtherFile: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./testdata/macroexpan/ref.h", - "USR": "c:@SA@NewType" + "File": "./testdata/macroexpan/ref.h" }, "Doc": null, "Parent": null, "Name": { "_Type": "Ident", - "Name": "NewType" + "Name": "NewType", + "USR": "c:@SA@NewType" }, "Type": { "_Type": "RecordType", @@ -163,7 +163,8 @@ TestMacroExpansionOtherFile: "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "__val" + "Name": "__val", + "USR": "c:@SA@NewType@FI@__val" }] }] }, diff --git a/_xtool/llcppsigfetch/parse/cvt_test/type_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/type_test/llgo.expect index cad17f839..ec6c550ae 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/type_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/type_test/llgo.expect @@ -118,14 +118,16 @@ Type: int &&: Type: Foo: { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@S@Foo" } Type: struct Foo: { "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@S@Foo" }, "Tag": 0 } @@ -148,7 +150,8 @@ Type: struct (unnamed struct at temp.h:1:1): "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:temp.h@S@temp.h@0@FI@x" }] }] }, @@ -157,14 +160,16 @@ Type: struct (unnamed struct at temp.h:1:1): Type: Foo: { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@U@Foo" } Type: union Foo: { "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@U@Foo" }, "Tag": 1 } @@ -187,7 +192,8 @@ Type: union (unnamed union at temp.h:1:1): "Access": 1, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:temp.h@U@temp.h@0@FI@x" }] }] }, @@ -196,14 +202,16 @@ Type: union (unnamed union at temp.h:1:1): Type: Foo: { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@E@Foo" } Type: enum Foo: { "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@E@Foo" }, "Tag": 2 } @@ -214,7 +222,8 @@ Type: enum (unnamed enum at temp.h:1:1): "_Type": "EnumItem", "Name": { "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:@E@temp.h@0@x" }, "Value": { "_Type": "BasicLit", @@ -226,14 +235,16 @@ Type: enum (unnamed enum at temp.h:1:1): Type: Foo: { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@S@Foo" } Type: class Foo: { "_Type": "TagExpr", "Name": { "_Type": "Ident", - "Name": "Foo" + "Name": "Foo", + "USR": "c:@S@Foo" }, "Tag": 3 } @@ -256,7 +267,8 @@ Type: class (unnamed class at temp.h:1:1): "Access": 3, "Names": [{ "_Type": "Ident", - "Name": "x" + "Name": "x", + "USR": "c:temp.h@S@temp.h@0@FI@x" }] }] }, @@ -267,17 +279,20 @@ Type: a::b::c: "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "c" + "Name": "c", + "USR": "c:@N@a@N@b@S@c" }, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@N@a@N@b" }, "Parent": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@N@a" } } } @@ -288,17 +303,20 @@ Type: class a::b::c: "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "c" + "Name": "c", + "USR": "c:@N@a@N@b@S@c" }, "Parent": { "_Type": "ScopingExpr", "X": { "_Type": "Ident", - "Name": "b" + "Name": "b", + "USR": "c:@N@a@N@b" }, "Parent": { "_Type": "Ident", - "Name": "a" + "Name": "a", + "USR": "c:@N@a" } } }, diff --git a/_xtool/llcppsigfetch/parse/dump.go b/_xtool/llcppsigfetch/parse/dump.go index 32b676064..ec6447f01 100644 --- a/_xtool/llcppsigfetch/parse/dump.go +++ b/_xtool/llcppsigfetch/parse/dump.go @@ -153,7 +153,6 @@ func MarshalASTDeclBase(decl ast.DeclBase, root *cjson.JSON) { loc := cjson.Object() loc.SetItem(c.Str("_Type"), stringField("Location")) loc.SetItem(c.Str("File"), stringField(decl.Loc.File)) - loc.SetItem(c.Str("USR"), stringField(decl.USR)) root.SetItem(c.Str("Loc"), loc) root.SetItem(c.Str("Doc"), MarshalASTExpr(decl.Doc)) root.SetItem(c.Str("Parent"), MarshalASTExpr(decl.Parent)) @@ -210,6 +209,7 @@ func MarshalASTExpr(t ast.Expr) *cjson.JSON { return cjson.Null() } root.SetItem(c.Str("Name"), stringField(d.Name)) + root.SetItem(c.Str("USR"), stringField(d.USR)) case *ast.TagExpr: root.SetItem(c.Str("_Type"), stringField("TagExpr")) root.SetItem(c.Str("Name"), MarshalASTExpr(d.Name)) diff --git a/_xtool/llcppsymg/clangutils/clangutils.go b/_xtool/llcppsymg/clangutils/clangutils.go index e32d9ebd1..3a608061c 100644 --- a/_xtool/llcppsymg/clangutils/clangutils.go +++ b/_xtool/llcppsymg/clangutils/clangutils.go @@ -82,13 +82,21 @@ func GetLocation(loc clang.SourceLocation) (file clang.File, line c.Uint, column return } +type ScopingPart struct { + Name string + USR string +} + // Traverse up the semantic parents -func BuildScopingParts(cursor clang.Cursor) []string { - var parts []string +func BuildScopingParts(cursor clang.Cursor) []*ScopingPart { + var parts []*ScopingPart for cursor.IsNull() != 1 && cursor.Kind != clang.CursorTranslationUnit { name := cursor.String() - qualified := c.GoString(name.CStr()) - parts = append([]string{qualified}, parts...) + qualified := &ScopingPart{ + Name: c.GoString(name.CStr()), + USR: clang.GoString(cursor.USR()), + } + parts = append([]*ScopingPart{qualified}, parts...) cursor = cursor.SemanticParent() name.Dispose() } diff --git a/_xtool/llcppsymg/parse/parse.go b/_xtool/llcppsymg/parse/parse.go index 8dac8138e..363180f7a 100644 --- a/_xtool/llcppsymg/parse/parse.go +++ b/_xtool/llcppsymg/parse/parse.go @@ -204,7 +204,7 @@ func (p *SymbolProcessor) genProtoName(cursor clang.Cursor) string { var builder strings.Builder for _, part := range scopingParts { - builder.WriteString(part) + builder.WriteString(part.Name) builder.WriteString("::") } diff --git a/ast/ast.go b/ast/ast.go index f692a9d43..cc2457bef 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -117,6 +117,7 @@ func (*BuiltinType) exprNode() {} // Name type Ident struct { Name string + USR string } func (*Ident) exprNode() {} @@ -274,7 +275,6 @@ type Location struct { } type DeclBase struct { - USR string Doc *CommentGroup // associated documentation; or nil Loc *Location Parent Expr // namespace or class