Skip to content

Commit

Permalink
llcppsigfetch:collect decl's usr
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed Jan 15, 2025
1 parent b358bd0 commit 5616ea7
Show file tree
Hide file tree
Showing 12 changed files with 221 additions and 109 deletions.
2 changes: 2 additions & 0 deletions _xtool/llcppsigfetch/parse/cvt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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,
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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,
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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,
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down
Loading

0 comments on commit 5616ea7

Please sign in to comment.