diff --git a/_xtool/llcppsigfetch/parse/cvt.go b/_xtool/llcppsigfetch/parse/cvt.go index efdf84c52..7567d02ae 100644 --- a/_xtool/llcppsigfetch/parse/cvt.go +++ b/_xtool/llcppsigfetch/parse/cvt.go @@ -177,7 +177,9 @@ 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, }, 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 915d6609e..50390494c 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,7 +6,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@Foo" }, "Doc": null, "Parent": null, @@ -48,7 +49,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@bar" }, "Doc": null, "Parent": null, @@ -84,7 +86,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@sqlite3_pcache_page" }, "Doc": null, "Parent": null, @@ -105,7 +108,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@sqlite3_pcache_page" }, "Doc": null, "Parent": null, @@ -144,7 +148,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@sqlite3_pcache" }, "Doc": null, "Parent": null, @@ -165,7 +170,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@sqlite3_pcache_methods2" }, "Doc": null, "Parent": null, @@ -186,7 +192,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@sqlite3_pcache_methods2" }, "Doc": null, "Parent": null, @@ -325,7 +332,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@sqlite3_file" }, "Doc": null, "Parent": null, @@ -346,7 +354,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@sqlite3_file" }, "Doc": null, "Parent": null, @@ -384,7 +393,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@sqlite3_io_methods" }, "Doc": null, "Parent": null, @@ -471,7 +481,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@lua_State" }, "Doc": null, "Parent": null, @@ -492,7 +503,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@lua_Debug" }, "Doc": null, "Parent": null, @@ -513,7 +525,8 @@ "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@F@lua_getstack" }, "Doc": null, "Parent": null, @@ -595,7 +608,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/forwarddecl.h" + "File": "./hfile/forwarddecl.h", + "USR": "c:@S@lua_Debug" }, "Doc": null, "Parent": null, @@ -681,7 +695,8 @@ "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "./hfile/def.h" + "File": "./hfile/def.h", + "USR": "c:@F@f" }, "Doc": null, "Parent": null, @@ -740,7 +755,8 @@ "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./hfile/impl.h" + "File": "./hfile/impl.h", + "USR": "c:@S@foo" }, "Doc": null, "Parent": null, 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 48dab79c9..dfbe67602 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,7 +7,8 @@ TestClassDecl Case 1: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A" }, "Doc": null, "Parent": null, @@ -68,7 +69,8 @@ TestClassDecl Case 2: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A" }, "Doc": null, "Parent": null, @@ -117,7 +119,8 @@ TestClassDecl Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A@F@foo#I#d#" }, "Doc": null, "Parent": { @@ -183,7 +186,8 @@ TestClassDecl Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A@F@vafoo#I.#" }, "Doc": null, "Parent": { @@ -256,7 +260,8 @@ TestClassDecl Case 3: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A" }, "Doc": null, "Parent": null, @@ -275,7 +280,8 @@ TestClassDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A@F@A#" }, "Doc": null, "Parent": { @@ -311,7 +317,8 @@ TestClassDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A@F@A#" }, "Doc": null, "Parent": { @@ -347,7 +354,8 @@ TestClassDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A@F@~A#" }, "Doc": null, "Parent": { @@ -383,7 +391,8 @@ TestClassDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A@F@foo#S" }, "Doc": null, "Parent": { @@ -431,7 +440,8 @@ TestClassDecl Case 4: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Base" }, "Doc": null, "Parent": null, @@ -450,7 +460,8 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Base@F@Base#" }, "Doc": null, "Parent": { @@ -486,7 +497,8 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Base@F@~Base#" }, "Doc": null, "Parent": { @@ -522,7 +534,8 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Base@F@foo#" }, "Doc": null, "Parent": { @@ -560,7 +573,8 @@ TestClassDecl Case 4: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Derived" }, "Doc": null, "Parent": null, @@ -579,7 +593,8 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Derived@F@Derived#" }, "Doc": null, "Parent": { @@ -615,7 +630,8 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Derived@F@~Derived#" }, "Doc": null, "Parent": { @@ -651,7 +667,8 @@ TestClassDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Derived@F@foo#" }, "Doc": null, "Parent": { @@ -699,7 +716,8 @@ TestClassDecl Case 5: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@N@A@S@Foo" }, "Doc": null, "Parent": { @@ -723,7 +741,8 @@ TestClassDecl Case 5: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@N@A@S@Foo@F@bar#" }, "Doc": null, "Parent": { 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 6c769412c..8cc75687f 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,7 +7,8 @@ TestDoc Case 1: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": null, "Parent": null, @@ -50,7 +51,8 @@ TestDoc Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": null, "Parent": null, @@ -93,7 +95,8 @@ TestDoc Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": { "_Type": "CommentGroup", @@ -142,7 +145,8 @@ TestDoc Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": { "_Type": "CommentGroup", @@ -191,7 +195,8 @@ TestDoc Case 5: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": { "_Type": "CommentGroup", @@ -240,7 +245,8 @@ TestDoc Case 6: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": { "_Type": "CommentGroup", @@ -292,7 +298,8 @@ TestDoc Case 7: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": { "_Type": "CommentGroup", @@ -344,7 +351,8 @@ TestDoc Case 8: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": { "_Type": "CommentGroup", @@ -396,7 +404,8 @@ TestDoc Case 9: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": { "_Type": "CommentGroup", @@ -454,7 +463,8 @@ TestDoc Case 10: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Foo" }, "Doc": null, "Parent": null, @@ -548,7 +558,8 @@ TestDoc Case 11: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Doc" }, "Doc": null, "Parent": null, @@ -684,7 +695,8 @@ TestDoc Case 11: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Doc@F@Foo#" }, "Doc": { "_Type": "CommentGroup", 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 23f9c577c..85daa82aa 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,7 +7,8 @@ TestEnumDecl Case 1: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@Ea@a" }, "Doc": null, "Parent": null, @@ -63,7 +64,8 @@ TestEnumDecl Case 2: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@E@Foo" }, "Doc": null, "Parent": null, @@ -122,7 +124,8 @@ TestEnumDecl Case 3: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@E@Foo" }, "Doc": null, "Parent": null, @@ -181,7 +184,8 @@ TestEnumDecl Case 4: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@E@Foo" }, "Doc": null, "Parent": null, 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 8cf9e26e6..10b524c95 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,7 +7,8 @@ TestFuncDecl Case 1: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": null, "Parent": null, @@ -50,7 +51,8 @@ TestFuncDecl Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#I#" }, "Doc": null, "Parent": null, @@ -108,7 +110,8 @@ TestFuncDecl Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#I.#" }, "Doc": null, "Parent": null, @@ -176,7 +179,8 @@ TestFuncDecl Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#I#d#" }, "Doc": null, "Parent": null, @@ -252,7 +256,8 @@ TestFuncDecl Case 5: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@F@add#I#I#" }, "Doc": null, "Parent": null, @@ -325,7 +330,8 @@ TestFuncDecl Case 6: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@fntype" }, "Doc": null, "Parent": null, @@ -349,7 +355,8 @@ TestFuncDecl Case 6: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": null, "Parent": null, @@ -392,7 +399,8 @@ TestFuncDecl Case 7: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@fntype" }, "Doc": null, "Parent": null, @@ -428,7 +436,8 @@ TestFuncDecl Case 7: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@fntype2" }, "Doc": null, "Parent": null, @@ -444,7 +453,8 @@ TestFuncDecl Case 7: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#L#" }, "Doc": null, "Parent": null, @@ -499,7 +509,8 @@ TestFuncDecl Case 8: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@OSSL_CORE_HANDLE" }, "Doc": null, "Parent": null, @@ -520,7 +531,8 @@ TestFuncDecl Case 8: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@OSSL_DISPATCH" }, "Doc": null, "Parent": null, @@ -541,7 +553,8 @@ TestFuncDecl Case 8: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@OSSL_provider_init_fn" }, "Doc": null, "Parent": null, @@ -628,7 +641,8 @@ TestFuncDecl Case 8: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@OSSL_provider_init#*1$@S@OSSL_CORE_HANDLE#*1$@S@OSSL_DISPATCH#*S2_#**v#" }, "Doc": null, "Parent": null, 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 66093d7fb..c2ca3be5a 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,7 +7,8 @@ TestScope Case 1: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@F@foo#" }, "Doc": null, "Parent": null, @@ -50,7 +51,8 @@ TestScope Case 2: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@N@a@F@foo#" }, "Doc": null, "Parent": { @@ -96,7 +98,8 @@ TestScope Case 3: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@N@a@N@b@F@foo#" }, "Doc": null, "Parent": { @@ -149,7 +152,8 @@ TestScope Case 4: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@a" }, "Doc": null, "Parent": null, @@ -168,7 +172,8 @@ TestScope Case 4: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@a@F@foo#" }, "Doc": null, "Parent": { @@ -216,7 +221,8 @@ TestScope Case 5: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@N@a@S@b" }, "Doc": null, "Parent": { @@ -238,7 +244,8 @@ TestScope Case 5: "_Type": "FuncDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@N@a@S@b@F@foo#" }, "Doc": null, "Parent": { 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 3440c6e36..bb7d04180 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,7 +7,8 @@ TestStructDecl Case 1: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@Sa" }, "Doc": null, "Parent": null, @@ -50,7 +51,8 @@ TestStructDecl Case 2: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A" }, "Doc": null, "Parent": null, @@ -111,7 +113,8 @@ TestStructDecl Case 3: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A" }, "Doc": null, "Parent": null, @@ -172,7 +175,8 @@ TestStructDecl Case 4: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@A" }, "Doc": null, "Parent": null, @@ -267,7 +271,8 @@ TestStructDecl Case 5: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@S@Person" }, "Doc": null, "Parent": null, 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 19eab45a0..364cad8f6 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,7 +7,8 @@ TestTypeDefDecl Case 1: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@INT" }, "Doc": null, "Parent": null, @@ -34,7 +35,8 @@ TestTypeDefDecl Case 2: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@INT" }, "Doc": null, "Parent": null, @@ -51,7 +53,8 @@ TestTypeDefDecl Case 2: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@STANDARD_INT" }, "Doc": null, "Parent": null, @@ -77,7 +80,8 @@ TestTypeDefDecl Case 3: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@INT" }, "Doc": null, "Parent": null, @@ -94,7 +98,8 @@ TestTypeDefDecl Case 3: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@IntPtr" }, "Doc": null, "Parent": null, @@ -114,7 +119,8 @@ TestTypeDefDecl Case 3: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@IntArr" }, "Doc": null, "Parent": null, @@ -145,7 +151,8 @@ TestTypeDefDecl Case 4: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@Foo" }, "Doc": null, "Parent": null, @@ -216,7 +223,8 @@ TestTypeDefDecl Case 5: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@Foo" }, "Doc": null, "Parent": null, @@ -267,7 +275,8 @@ TestTypeDefDecl Case 5: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@Bar" }, "Doc": null, "Parent": null, @@ -334,7 +343,8 @@ TestTypeDefDecl Case 6: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@N@A@S@Foo" }, "Doc": null, "Parent": { @@ -373,7 +383,8 @@ TestTypeDefDecl Case 6: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@N@A@T@MyClass" }, "Doc": null, "Parent": { @@ -403,7 +414,8 @@ TestTypeDefDecl Case 6: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@N@A@T@MyClassPtr" }, "Doc": null, "Parent": { @@ -436,7 +448,8 @@ TestTypeDefDecl Case 6: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@N@A@T@MyClassArray" }, "Doc": null, "Parent": { @@ -480,7 +493,8 @@ TestTypeDefDecl Case 7: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@SA@MyStruct" }, "Doc": null, "Parent": null, @@ -526,7 +540,8 @@ TestTypeDefDecl Case 8: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@UA@MyUnion" }, "Doc": null, "Parent": null, @@ -572,7 +587,8 @@ TestTypeDefDecl Case 9: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@EA@MyEnum" }, "Doc": null, "Parent": null, @@ -631,7 +647,8 @@ TestTypeDefDecl Case 10: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@SA@MyStruct" }, "Doc": null, "Parent": null, @@ -667,7 +684,8 @@ TestTypeDefDecl Case 10: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@MyStruct2" }, "Doc": null, "Parent": null, @@ -687,7 +705,8 @@ TestTypeDefDecl Case 10: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@StructPtr" }, "Doc": null, "Parent": null, @@ -710,7 +729,8 @@ TestTypeDefDecl Case 10: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@StructArr" }, "Doc": null, "Parent": null, @@ -744,7 +764,8 @@ TestTypeDefDecl Case 11: "_Type": "EnumTypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@EA@MyEnum" }, "Doc": null, "Parent": null, @@ -793,7 +814,8 @@ TestTypeDefDecl Case 11: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@MyEnum2" }, "Doc": null, "Parent": null, @@ -813,7 +835,8 @@ TestTypeDefDecl Case 11: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@EnumPtr" }, "Doc": null, "Parent": null, @@ -836,7 +859,8 @@ TestTypeDefDecl Case 11: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@T@EnumArr" }, "Doc": null, "Parent": null, @@ -870,7 +894,8 @@ TestTypeDefDecl Case 12: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@N@A@N@B@SA@MyStruct" }, "Doc": null, "Parent": { @@ -916,7 +941,8 @@ TestTypeDefDecl Case 12: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@N@A@N@B@T@MyStruct2" }, "Doc": null, "Parent": { @@ -960,7 +986,8 @@ TestTypeDefDecl Case 12: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@N@A@N@B@T@StructPtr" }, "Doc": null, "Parent": { @@ -1007,7 +1034,8 @@ TestTypeDefDecl Case 12: "_Type": "TypedefDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@N@A@N@B@T@StructArr" }, "Doc": null, "Parent": { 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 7263896db..ba5da7d65 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,7 +7,8 @@ TestUnionDecl Case 1: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:temp.h@Ua" }, "Doc": null, "Parent": null, @@ -65,7 +66,8 @@ TestUnionDecl Case 2: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@U@A" }, "Doc": null, "Parent": null, @@ -126,7 +128,8 @@ TestUnionDecl Case 3: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "temp.h" + "File": "temp.h", + "USR": "c:@U@OuterUnion" }, "Doc": null, "Parent": null, diff --git a/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect b/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect index 2705b5020..fd12cb075 100644 --- a/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect +++ b/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect @@ -128,7 +128,8 @@ TestMacroExpansionOtherFile: "_Type": "TypeDecl", "Loc": { "_Type": "Location", - "File": "./testdata/macroexpan/ref.h" + "File": "./testdata/macroexpan/ref.h", + "USR": "c:@SA@NewType" }, "Doc": null, "Parent": null, diff --git a/_xtool/llcppsigfetch/parse/dump.go b/_xtool/llcppsigfetch/parse/dump.go index c00b6ed35..32b676064 100644 --- a/_xtool/llcppsigfetch/parse/dump.go +++ b/_xtool/llcppsigfetch/parse/dump.go @@ -153,6 +153,7 @@ 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))