2018-03-31 03:16:33 +00:00
|
|
|
class Foo {
|
|
|
|
public:
|
|
|
|
Foo() {}
|
|
|
|
~Foo() {};
|
|
|
|
};
|
|
|
|
|
|
|
|
void foo() {
|
|
|
|
Foo f;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: Support destructors (notice how the dtor has no usages listed).
|
|
|
|
// - check if variable is a pointer. if so, do *not* insert dtor
|
|
|
|
// - check if variable is normal type. if so, insert dtor
|
|
|
|
// - scan for statements that look like dtors in function def handler
|
|
|
|
// - figure out some way to support w/ unique_ptrs?
|
|
|
|
/*
|
|
|
|
OUTPUT:
|
|
|
|
{
|
|
|
|
"includes": [],
|
2018-07-07 23:56:47 +00:00
|
|
|
"skipped_ranges": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"usr2func": [{
|
2018-03-31 03:16:33 +00:00
|
|
|
"usr": 3385168158331140247,
|
2018-06-01 23:51:39 +00:00
|
|
|
"detailed_name": "Foo::Foo()",
|
|
|
|
"qual_name_offset": 0,
|
2018-03-31 03:16:33 +00:00
|
|
|
"short_name": "Foo",
|
|
|
|
"kind": 9,
|
2018-06-01 23:51:39 +00:00
|
|
|
"storage": 0,
|
2018-03-31 03:16:33 +00:00
|
|
|
"declarations": [],
|
2018-07-10 06:40:26 +00:00
|
|
|
"spell": "3:3-3:6|15041163540773201510|2|1026",
|
2018-04-30 04:49:03 +00:00
|
|
|
"extent": "3:3-3:11|15041163540773201510|2|0",
|
2018-03-31 03:16:33 +00:00
|
|
|
"bases": [],
|
|
|
|
"derived": [],
|
|
|
|
"vars": [],
|
2018-07-21 06:27:47 +00:00
|
|
|
"uses": ["8:7-8:8|4259594751088586730|3|16676"],
|
2018-03-31 03:16:33 +00:00
|
|
|
"callees": []
|
|
|
|
}, {
|
2018-04-30 04:49:03 +00:00
|
|
|
"usr": 4259594751088586730,
|
|
|
|
"detailed_name": "void foo()",
|
2018-04-06 00:00:07 +00:00
|
|
|
"qual_name_offset": 5,
|
2018-04-30 04:49:03 +00:00
|
|
|
"short_name": "foo",
|
|
|
|
"kind": 12,
|
2018-06-01 23:51:39 +00:00
|
|
|
"storage": 0,
|
2018-03-31 03:16:33 +00:00
|
|
|
"declarations": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"spell": "7:6-7:9|0|1|2",
|
|
|
|
"extent": "7:1-9:2|0|1|0",
|
2018-03-31 03:16:33 +00:00
|
|
|
"bases": [],
|
|
|
|
"derived": [],
|
2018-07-08 19:49:27 +00:00
|
|
|
"vars": [1893354193220338759],
|
2018-03-31 03:16:33 +00:00
|
|
|
"uses": [],
|
2018-07-21 06:27:47 +00:00
|
|
|
"callees": ["8:7-8:8|3385168158331140247|3|16676", "8:7-8:8|3385168158331140247|3|16676"]
|
2018-03-31 03:16:33 +00:00
|
|
|
}, {
|
2018-04-30 04:49:03 +00:00
|
|
|
"usr": 7440261702884428359,
|
2018-06-01 23:51:39 +00:00
|
|
|
"detailed_name": "Foo::~Foo() noexcept",
|
|
|
|
"qual_name_offset": 0,
|
2018-04-30 04:49:03 +00:00
|
|
|
"short_name": "~Foo",
|
|
|
|
"kind": 6,
|
2018-06-01 23:51:39 +00:00
|
|
|
"storage": 0,
|
2018-03-31 03:16:33 +00:00
|
|
|
"declarations": [],
|
2018-07-10 06:40:26 +00:00
|
|
|
"spell": "4:3-4:4|15041163540773201510|2|1026",
|
2018-04-30 04:49:03 +00:00
|
|
|
"extent": "4:3-4:12|15041163540773201510|2|0",
|
2018-03-31 03:16:33 +00:00
|
|
|
"bases": [],
|
|
|
|
"derived": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"vars": [],
|
2018-03-31 03:16:33 +00:00
|
|
|
"uses": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"callees": []
|
|
|
|
}],
|
|
|
|
"usr2type": [{
|
|
|
|
"usr": 15041163540773201510,
|
2018-07-07 23:56:47 +00:00
|
|
|
"detailed_name": "class Foo {}",
|
|
|
|
"qual_name_offset": 6,
|
2018-04-30 04:49:03 +00:00
|
|
|
"short_name": "Foo",
|
|
|
|
"kind": 5,
|
2018-07-07 23:56:47 +00:00
|
|
|
"declarations": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"spell": "1:7-1:10|0|1|2",
|
|
|
|
"extent": "1:1-5:2|0|1|0",
|
|
|
|
"alias_of": 0,
|
|
|
|
"bases": [],
|
|
|
|
"derived": [],
|
|
|
|
"types": [],
|
|
|
|
"funcs": [3385168158331140247, 7440261702884428359],
|
|
|
|
"vars": [],
|
|
|
|
"instances": [1893354193220338759],
|
2018-07-21 06:27:47 +00:00
|
|
|
"uses": ["3:3-3:6|15041163540773201510|2|4", "4:4-4:7|15041163540773201510|2|4", "8:3-8:6|4259594751088586730|3|4"]
|
2018-03-31 03:16:33 +00:00
|
|
|
}],
|
2018-04-30 04:49:03 +00:00
|
|
|
"usr2var": [{
|
|
|
|
"usr": 1893354193220338759,
|
2018-03-31 03:16:33 +00:00
|
|
|
"detailed_name": "Foo f",
|
2018-04-06 00:00:07 +00:00
|
|
|
"qual_name_offset": 4,
|
2018-03-31 03:16:33 +00:00
|
|
|
"short_name": "f",
|
|
|
|
"declarations": [],
|
2018-04-30 04:49:03 +00:00
|
|
|
"spell": "8:7-8:8|4259594751088586730|3|2",
|
|
|
|
"extent": "8:3-8:8|4259594751088586730|3|0",
|
|
|
|
"type": 15041163540773201510,
|
2018-03-31 03:16:33 +00:00
|
|
|
"uses": [],
|
|
|
|
"kind": 13,
|
2018-06-01 23:51:39 +00:00
|
|
|
"storage": 0
|
2018-03-31 03:16:33 +00:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
*/
|