llcppsigfetch:field access & static field

This commit is contained in:
luoliwoshang
2024-08-28 14:51:36 +08:00
parent 9351a1f900
commit 7d0b47c5cb
9 changed files with 127 additions and 15 deletions

View File

@@ -15,11 +15,13 @@ func TestClassDecl() {
};`,
`class A {
public:
int a;
static int a;
int b;
float foo(int a,double b);
private:
void bar();
static void bar();
protected:
void bar2();
};`,
`class A {
public:

View File

@@ -27,6 +27,8 @@ TestClassDecl Case 1:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "a"
}]
@@ -41,6 +43,8 @@ TestClassDecl Case 1:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "b"
}]
@@ -82,6 +86,8 @@ TestClassDecl Case 2:
"Comment": {
"List": []
},
"IsStatic": true,
"Access": 1,
"Names": [{
"Name": "a"
}]
@@ -96,6 +102,8 @@ TestClassDecl Case 2:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "b"
}]
@@ -127,6 +135,8 @@ TestClassDecl Case 2:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"Name": "a"
}]
@@ -141,6 +151,8 @@ TestClassDecl Case 2:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"Name": "b"
}]

View File

@@ -63,6 +63,8 @@ TestFuncDecl Case 2:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"Name": "a"
}]
@@ -108,6 +110,8 @@ TestFuncDecl Case 3:
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": []
}, {
"Type": {
@@ -120,6 +124,8 @@ TestFuncDecl Case 3:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"Name": "a"
}]
@@ -171,6 +177,8 @@ TestFuncDecl Case 4:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"Name": "a"
}]
@@ -185,6 +193,8 @@ TestFuncDecl Case 4:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"Name": "b"
}]
@@ -238,6 +248,8 @@ TestFuncDecl Case 5:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"Name": "a"
}]
@@ -252,6 +264,8 @@ TestFuncDecl Case 5:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"Name": "b"
}]

View File

@@ -25,6 +25,8 @@ TestStructDecl Case 1:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "a"
}]
@@ -66,6 +68,8 @@ TestStructDecl Case 2:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "a"
}]
@@ -80,6 +84,8 @@ TestStructDecl Case 2:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "b"
}]
@@ -121,6 +127,8 @@ TestStructDecl Case 3:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "a"
}]
@@ -135,6 +143,8 @@ TestStructDecl Case 3:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "b"
}]
@@ -176,6 +186,8 @@ TestStructDecl Case 4:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "a"
}]
@@ -190,6 +202,8 @@ TestStructDecl Case 4:
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": []
}, {
"Type": {
@@ -198,6 +212,8 @@ TestStructDecl Case 4:
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": []
}]
},
@@ -213,6 +229,8 @@ TestStructDecl Case 4:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "Foo"
}]
@@ -254,6 +272,8 @@ TestStructDecl Case 5:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "age"
}]
@@ -272,6 +292,8 @@ TestStructDecl Case 5:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "year"
}]
@@ -286,6 +308,8 @@ TestStructDecl Case 5:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "day"
}]
@@ -300,6 +324,8 @@ TestStructDecl Case 5:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "month"
}]
@@ -313,6 +339,8 @@ TestStructDecl Case 5:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "birthday"
}]

View File

@@ -85,6 +85,8 @@ TestTypeDefDecl Case 3:
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": []
}, {
"Type": {
@@ -93,12 +95,16 @@ TestTypeDefDecl Case 3:
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": []
}, {
"Type": {
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": []
}]
},

View File

@@ -25,6 +25,8 @@ TestUnionDecl Case 1:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "a"
}]
@@ -39,6 +41,8 @@ TestUnionDecl Case 1:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "b"
}]
@@ -80,6 +84,8 @@ TestUnionDecl Case 2:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "a"
}]
@@ -94,6 +100,8 @@ TestUnionDecl Case 2:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "b"
}]
@@ -135,6 +143,8 @@ TestUnionDecl Case 3:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "i"
}]
@@ -149,6 +159,8 @@ TestUnionDecl Case 3:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "f"
}]
@@ -167,6 +179,8 @@ TestUnionDecl Case 3:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "c"
}]
@@ -181,6 +195,8 @@ TestUnionDecl Case 3:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "s"
}]
@@ -194,6 +210,8 @@ TestUnionDecl Case 3:
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "inner"
}]

View File

@@ -120,6 +120,8 @@ Type: struct (unnamed struct at temp.h:1:1):
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "x"
}]
@@ -153,6 +155,8 @@ Type: union (unnamed union at temp.h:1:1):
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"Name": "x"
}]
@@ -209,6 +213,8 @@ Type: class (unnamed class at temp.h:1:1):
"Comment": {
"List": []
},
"IsStatic": false,
"Access": 3,
"Names": [{
"Name": "x"
}]
@@ -258,6 +264,8 @@ Type: int (*)(int, char):
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": []
}, {
"Type": {
@@ -266,6 +274,8 @@ Type: int (*)(int, char):
},
"Doc": null,
"Comment": null,
"IsStatic": false,
"Access": 0,
"Names": []
}]
},