| 1 |
void called(int a); |
| 2 |
|
| 3 |
int gen(); |
| 4 |
|
| 5 |
struct Foo { |
| 6 |
static int static_var; |
| 7 |
int field_var; |
| 8 |
}; |
| 9 |
|
| 10 |
int Foo::static_var = 0; |
| 11 |
|
| 12 |
void foo() { |
| 13 |
int a = 5; |
| 14 |
called(a + gen() + Foo().field_var + Foo::static_var); |
| 15 |
} |
| 16 |
|
| 17 |
/* |
| 18 |
OUTPUT: |
| 19 |
{ |
| 20 |
"includes": [], |
| 21 |
"skipped_ranges": [], |
| 22 |
"usr2func": [{ |
| 23 |
"usr": 4259594751088586730, |
| 24 |
"detailed_name": "void foo()", |
| 25 |
"qual_name_offset": 5, |
| 26 |
"short_name": "foo", |
| 27 |
"spell": "12:6-12:9|12:1-15:2|2|-1", |
| 28 |
"bases": [], |
| 29 |
"vars": [8039186520399841081], |
| 30 |
"callees": ["14:3-14:9|18319417758892371313|3|16420", "14:14-14:17|11404602816585117695|3|16420"], |
| 31 |
"kind": 12, |
| 32 |
"parent_kind": 1, |
| 33 |
"storage": 0, |
| 34 |
"declarations": [], |
| 35 |
"derived": [], |
| 36 |
"uses": [] |
| 37 |
}, { |
| 38 |
"usr": 11404602816585117695, |
| 39 |
"detailed_name": "int gen()", |
| 40 |
"qual_name_offset": 4, |
| 41 |
"short_name": "gen", |
| 42 |
"bases": [], |
| 43 |
"vars": [], |
| 44 |
"callees": [], |
| 45 |
"kind": 12, |
| 46 |
"parent_kind": 0, |
| 47 |
"storage": 0, |
| 48 |
"declarations": ["3:5-3:8|3:1-3:10|1|-1"], |
| 49 |
"derived": [], |
| 50 |
"uses": ["14:14-14:17|16420|-1"] |
| 51 |
}, { |
| 52 |
"usr": 18319417758892371313, |
| 53 |
"detailed_name": "void called(int a)", |
| 54 |
"qual_name_offset": 5, |
| 55 |
"short_name": "called", |
| 56 |
"bases": [], |
| 57 |
"vars": [6112882821797148411], |
| 58 |
"callees": [], |
| 59 |
"kind": 12, |
| 60 |
"parent_kind": 0, |
| 61 |
"storage": 0, |
| 62 |
"declarations": ["1:6-1:12|1:1-1:19|1|-1"], |
| 63 |
"derived": [], |
| 64 |
"uses": ["14:3-14:9|16420|-1"] |
| 65 |
}], |
| 66 |
"usr2type": [{ |
| 67 |
"usr": 452, |
| 68 |
"detailed_name": "", |
| 69 |
"qual_name_offset": 0, |
| 70 |
"short_name": "", |
| 71 |
"bases": [], |
| 72 |
"funcs": [], |
| 73 |
"types": [], |
| 74 |
"vars": [], |
| 75 |
"alias_of": 0, |
| 76 |
"kind": 0, |
| 77 |
"parent_kind": 0, |
| 78 |
"declarations": [], |
| 79 |
"derived": [], |
| 80 |
"instances": [6112882821797148411, 11489549839875479478, 9648311402855509901, 11489549839875479478, |
| 81 |
8039186520399841081], "uses": [] |
| 82 |
}, { |
| 83 |
"usr": 15041163540773201510, |
| 84 |
"detailed_name": "struct Foo {}", |
| 85 |
"qual_name_offset": 7, |
| 86 |
"short_name": "Foo", |
| 87 |
"spell": "5:8-5:11|5:1-8:2|2|-1", |
| 88 |
"bases": [], |
| 89 |
"funcs": [], |
| 90 |
"types": [], |
| 91 |
"vars": [{ |
| 92 |
"L": 9648311402855509901, |
| 93 |
"R": 0 |
| 94 |
}], |
| 95 |
"alias_of": 0, |
| 96 |
"kind": 23, |
| 97 |
"parent_kind": 1, |
| 98 |
"declarations": [], |
| 99 |
"derived": [], |
| 100 |
"instances": [], |
| 101 |
"uses": ["10:5-10:8|4|-1", "14:22-14:25|4|-1", "14:40-14:43|4|-1"] |
| 102 |
}], |
| 103 |
"usr2var": [{ |
| 104 |
"usr": 6112882821797148411, |
| 105 |
"detailed_name": "int a", |
| 106 |
"qual_name_offset": 4, |
| 107 |
"short_name": "a", |
| 108 |
"spell": "1:17-1:18|1:13-1:18|1026|-1", |
| 109 |
"type": 452, |
| 110 |
"kind": 253, |
| 111 |
"parent_kind": 12, |
| 112 |
"storage": 0, |
| 113 |
"declarations": [], |
| 114 |
"uses": [] |
| 115 |
}, { |
| 116 |
"usr": 8039186520399841081, |
| 117 |
"detailed_name": "int a", |
| 118 |
"qual_name_offset": 4, |
| 119 |
"short_name": "a", |
| 120 |
"hover": "int a = 5", |
| 121 |
"spell": "13:7-13:8|13:3-13:12|2|-1", |
| 122 |
"type": 452, |
| 123 |
"kind": 13, |
| 124 |
"parent_kind": 12, |
| 125 |
"storage": 0, |
| 126 |
"declarations": [], |
| 127 |
"uses": ["14:10-14:11|12|-1"] |
| 128 |
}, { |
| 129 |
"usr": 9648311402855509901, |
| 130 |
"detailed_name": "int Foo::field_var", |
| 131 |
"qual_name_offset": 4, |
| 132 |
"short_name": "field_var", |
| 133 |
"spell": "7:7-7:16|7:3-7:16|1026|-1", |
| 134 |
"type": 452, |
| 135 |
"kind": 8, |
| 136 |
"parent_kind": 23, |
| 137 |
"storage": 0, |
| 138 |
"declarations": [], |
| 139 |
"uses": ["14:28-14:37|12|-1"] |
| 140 |
}, { |
| 141 |
"usr": 11489549839875479478, |
| 142 |
"detailed_name": "static int Foo::static_var", |
| 143 |
"qual_name_offset": 11, |
| 144 |
"short_name": "static_var", |
| 145 |
"spell": "10:10-10:20|10:1-10:24|1026|-1", |
| 146 |
"type": 452, |
| 147 |
"kind": 8, |
| 148 |
"parent_kind": 23, |
| 149 |
"storage": 2, |
| 150 |
"declarations": ["6:14-6:24|6:3-6:24|1025|-1"], |
| 151 |
"uses": ["14:45-14:55|12|-1"] |
| 152 |
}] |
| 153 |
} |
| 154 |
*/ |