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