| 1 |
union Foo { |
| 2 |
int a : 5; |
| 3 |
bool b : 3; |
| 4 |
}; |
| 5 |
|
| 6 |
Foo f; |
| 7 |
|
| 8 |
void act(Foo*) { |
| 9 |
f.a = 3; |
| 10 |
} |
| 11 |
|
| 12 |
/* |
| 13 |
// TODO: instantiations on Foo should include parameter? |
| 14 |
|
| 15 |
OUTPUT: |
| 16 |
{ |
| 17 |
"includes": [], |
| 18 |
"skipped_ranges": [], |
| 19 |
"usr2func": [{ |
| 20 |
"usr": 13982179977217945200, |
| 21 |
"detailed_name": "void act(Foo *)", |
| 22 |
"qual_name_offset": 5, |
| 23 |
"short_name": "act", |
| 24 |
"spell": "8:6-8:9|8:1-10:2|2|-1", |
| 25 |
"bases": [], |
| 26 |
"vars": [], |
| 27 |
"callees": [], |
| 28 |
"kind": 12, |
| 29 |
"parent_kind": 1, |
| 30 |
"storage": 0, |
| 31 |
"declarations": [], |
| 32 |
"derived": [], |
| 33 |
"uses": [] |
| 34 |
}], |
| 35 |
"usr2type": [{ |
| 36 |
"usr": 436, |
| 37 |
"detailed_name": "", |
| 38 |
"qual_name_offset": 0, |
| 39 |
"short_name": "", |
| 40 |
"bases": [], |
| 41 |
"funcs": [], |
| 42 |
"types": [], |
| 43 |
"vars": [], |
| 44 |
"alias_of": 0, |
| 45 |
"kind": 0, |
| 46 |
"parent_kind": 0, |
| 47 |
"declarations": [], |
| 48 |
"derived": [], |
| 49 |
"instances": [8804696910588009104], |
| 50 |
"uses": [] |
| 51 |
}, { |
| 52 |
"usr": 452, |
| 53 |
"detailed_name": "", |
| 54 |
"qual_name_offset": 0, |
| 55 |
"short_name": "", |
| 56 |
"bases": [], |
| 57 |
"funcs": [], |
| 58 |
"types": [], |
| 59 |
"vars": [], |
| 60 |
"alias_of": 0, |
| 61 |
"kind": 0, |
| 62 |
"parent_kind": 0, |
| 63 |
"declarations": [], |
| 64 |
"derived": [], |
| 65 |
"instances": [9529311430721959843], |
| 66 |
"uses": [] |
| 67 |
}, { |
| 68 |
"usr": 8501689086387244262, |
| 69 |
"detailed_name": "union Foo {}", |
| 70 |
"qual_name_offset": 6, |
| 71 |
"short_name": "Foo", |
| 72 |
"spell": "1:7-1:10|1:1-4:2|2|-1", |
| 73 |
"bases": [], |
| 74 |
"funcs": [], |
| 75 |
"types": [], |
| 76 |
"vars": [{ |
| 77 |
"L": 9529311430721959843, |
| 78 |
"R": 0 |
| 79 |
}, { |
| 80 |
"L": 8804696910588009104, |
| 81 |
"R": 0 |
| 82 |
}], |
| 83 |
"alias_of": 0, |
| 84 |
"kind": 5, |
| 85 |
"parent_kind": 1, |
| 86 |
"declarations": [], |
| 87 |
"derived": [], |
| 88 |
"instances": [2933643612409209903], |
| 89 |
"uses": ["6:1-6:4|4|-1", "8:10-8:13|4|-1"] |
| 90 |
}], |
| 91 |
"usr2var": [{ |
| 92 |
"usr": 2933643612409209903, |
| 93 |
"detailed_name": "Foo f", |
| 94 |
"qual_name_offset": 4, |
| 95 |
"short_name": "f", |
| 96 |
"spell": "6:5-6:6|6:1-6:6|2|-1", |
| 97 |
"type": 8501689086387244262, |
| 98 |
"kind": 13, |
| 99 |
"parent_kind": 1, |
| 100 |
"storage": 0, |
| 101 |
"declarations": [], |
| 102 |
"uses": ["9:3-9:4|4|-1"] |
| 103 |
}, { |
| 104 |
"usr": 8804696910588009104, |
| 105 |
"detailed_name": "bool Foo::b : 3", |
| 106 |
"qual_name_offset": 5, |
| 107 |
"short_name": "b", |
| 108 |
"spell": "3:8-3:9|3:3-3:13|1026|-1", |
| 109 |
"type": 436, |
| 110 |
"kind": 8, |
| 111 |
"parent_kind": 5, |
| 112 |
"storage": 0, |
| 113 |
"declarations": [], |
| 114 |
"uses": [] |
| 115 |
}, { |
| 116 |
"usr": 9529311430721959843, |
| 117 |
"detailed_name": "int Foo::a : 5", |
| 118 |
"qual_name_offset": 4, |
| 119 |
"short_name": "a", |
| 120 |
"spell": "2:7-2:8|2:3-2:12|1026|-1", |
| 121 |
"type": 452, |
| 122 |
"kind": 8, |
| 123 |
"parent_kind": 5, |
| 124 |
"storage": 0, |
| 125 |
"declarations": [], |
| 126 |
"uses": ["9:5-9:6|20|-1"] |
| 127 |
}] |
| 128 |
} |
| 129 |
*/ |