Move tests to index_tests

This commit is contained in:
Jacob Dufault 2017-12-28 09:42:55 -08:00
parent 3ab2f2e2b7
commit 4781e9a53d
127 changed files with 2 additions and 8225 deletions

View File

@ -2041,7 +2041,7 @@ void IndexInit() {
}
void ClangSanityCheck() {
std::vector<const char*> args = {"clang", "tests/vars/class_member.cc"};
std::vector<const char*> args = {"clang", "index_tests/vars/class_member.cc"};
unsigned opts = 0;
CXIndex index = clang_createIndex(0, 1);
CXTranslationUnit tu;

View File

@ -124,7 +124,7 @@ void RunIndexTests(const std::string& filter_path) {
bool update_all = false;
ClangIndex index;
for (std::string path : GetFilesInFolder("tests", true /*recursive*/,
for (std::string path : GetFilesInFolder("index_tests", true /*recursive*/,
true /*add_folder_to_path*/)) {
if (!RunObjectiveCIndexTests() && EndsWithAny(path, {".m", ".mm"})) {
std::cout << "Skipping \"" << path << "\" since this platform does not "

View File

@ -1,10 +0,0 @@
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [],
"vars": []
}
*/

View File

@ -1,29 +0,0 @@
class Foo;
class Foo;
class Foo {};
class Foo;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "3:7-3:10",
"definition_extent": "3:1-3:13",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:7-1:10", "2:7-2:10", "3:7-3:10", "4:7-4:10"]
}],
"funcs": [],
"vars": []
}
*/

View File

@ -1,83 +0,0 @@
class Foo {
public:
Foo() {}
};
void foo() {
Foo f;
Foo* f2 = new Foo();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [0, 1],
"uses": ["1:7-1:10", "3:3-3:6", "7:3-7:6", "8:3-8:6", "8:17-8:20"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@Foo#",
"short_name": "Foo",
"detailed_name": "void Foo::Foo()",
"declarations": [],
"definition_spelling": "3:3-3:6",
"definition_extent": "3:3-3:11",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["~1@7:7-7:8", "1@8:17-8:20"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"declarations": [],
"definition_spelling": "6:6-6:9",
"definition_extent": "6:1-9:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["~0@7:7-7:8", "0@8:17-8:20"]
}],
"vars": [{
"id": 0,
"usr": "c:constructor.cc@56@F@foo#@f",
"short_name": "f",
"detailed_name": "Foo f",
"definition_spelling": "7:7-7:8",
"definition_extent": "7:3-7:8",
"variable_type": 0,
"cls": 1,
"uses": ["7:7-7:8"]
}, {
"id": 1,
"usr": "c:constructor.cc@66@F@foo#@f2",
"short_name": "f2",
"detailed_name": "Foo * f2",
"definition_spelling": "8:8-8:10",
"definition_extent": "8:3-8:22",
"variable_type": 0,
"cls": 1,
"uses": ["8:8-8:10"]
}]
}
*/

View File

@ -1,93 +0,0 @@
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": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-5:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0, 1],
"vars": [],
"instances": [0],
"uses": ["1:7-1:10", "3:3-3:6", "4:4-4:7", "8:3-8:6"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@Foo#",
"short_name": "Foo",
"detailed_name": "void Foo::Foo()",
"declarations": [],
"definition_spelling": "3:3-3:6",
"definition_extent": "3:3-3:11",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["~2@8:7-8:8"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@S@Foo@F@~Foo#",
"short_name": "~Foo",
"detailed_name": "void Foo::~Foo() noexcept",
"declarations": [],
"definition_spelling": "4:3-4:7",
"definition_extent": "4:3-4:12",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"declarations": [],
"definition_spelling": "7:6-7:9",
"definition_extent": "7:1-9:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["~0@8:7-8:8"]
}],
"vars": [{
"id": 0,
"usr": "c:destructor.cc@70@F@foo#@f",
"short_name": "f",
"detailed_name": "Foo f",
"definition_spelling": "8:7-8:8",
"definition_extent": "8:3-8:8",
"variable_type": 0,
"cls": 1,
"uses": ["8:7-8:8"]
}]
}
*/

View File

@ -1,82 +0,0 @@
struct Type {
Type() {}
};
void Make() {
Type foo0;
auto foo1 = Type();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Type",
"short_name": "Type",
"detailed_name": "Type",
"definition_spelling": "1:8-1:12",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [0, 1],
"uses": ["1:8-1:12", "2:3-2:7", "6:3-6:7", "7:15-7:19"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Type@F@Type#",
"short_name": "Type",
"detailed_name": "void Type::Type()",
"declarations": [],
"definition_spelling": "2:3-2:7",
"definition_extent": "2:3-2:12",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["~1@6:8-6:12", "1@7:15-7:19"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@Make#",
"short_name": "Make",
"detailed_name": "void Make()",
"declarations": [],
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["~0@6:8-6:12", "0@7:15-7:19"]
}],
"vars": [{
"id": 0,
"usr": "c:implicit_constructor.cc@51@F@Make#@foo0",
"short_name": "foo0",
"detailed_name": "Type foo0",
"definition_spelling": "6:8-6:12",
"definition_extent": "6:3-6:12",
"variable_type": 0,
"cls": 1,
"uses": ["6:8-6:12"]
}, {
"id": 1,
"usr": "c:implicit_constructor.cc@65@F@Make#@foo1",
"short_name": "foo1",
"detailed_name": "Type foo1",
"definition_spelling": "7:8-7:12",
"definition_extent": "7:3-7:21",
"variable_type": 0,
"cls": 1,
"uses": ["7:8-7:12"]
}]
}
*/

View File

@ -1,48 +0,0 @@
struct Foo {};
template<class T>
Foo::Foo() {}
/*
EXTRA_FLAGS:
-fms-compatibility
-fdelayed-template-parsing
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:8-1:11",
"definition_extent": "1:1-1:14",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["1:8-1:11", "4:6-4:9", "4:1-4:4"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@FT@>1#TFoo#v#",
"short_name": "Foo",
"detailed_name": "void Foo::Foo()",
"declarations": [],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-4:11",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,322 +0,0 @@
#include "make_functions.h"
template <typename T, typename... Args>
T* MakeUnique(Args&&... args) {
return nullptr;
}
template <typename T, typename... Args>
T* maKE_NoRefs(Args... args) {
return nullptr;
}
void caller22() {
MakeUnique<Foobar>();
MakeUnique<Foobar>(1);
MakeUnique<Foobar>(1, new Bar(), nullptr);
maKE_NoRefs<Foobar>(1, new Bar(), nullptr);
}
// TODO: Eliminate the extra entries in the "types" array here. They come from
// the template function definitions.
// Foobar is defined in a separate file to ensure that we can attribute
// MakeUnique calls across translation units.
/*
OUTPUT: make_functions.h
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Bar",
"short_name": "Bar",
"detailed_name": "Bar",
"definition_spelling": "1:8-1:11",
"definition_extent": "1:1-1:14",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:8-1:11", "7:17-7:20", "8:15-8:18"]
}, {
"id": 1,
"usr": "c:@S@Foobar",
"short_name": "Foobar",
"detailed_name": "Foobar",
"definition_spelling": "3:7-3:13",
"definition_extent": "3:1-9:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0, 1, 2, 3],
"vars": [],
"instances": [],
"uses": ["3:7-3:13", "5:3-5:9", "6:3-6:9", "7:3-7:9", "8:3-8:9"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foobar@F@Foobar#",
"short_name": "Foobar",
"detailed_name": "void Foobar::Foobar()",
"declarations": [],
"definition_spelling": "5:3-5:9",
"definition_extent": "5:3-5:14",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@S@Foobar@F@Foobar#I#",
"short_name": "Foobar",
"detailed_name": "void Foobar::Foobar(int)",
"declarations": [],
"definition_spelling": "6:3-6:9",
"definition_extent": "6:3-6:17",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:@S@Foobar@F@Foobar#&&I#*$@S@Bar#*b#",
"short_name": "Foobar",
"detailed_name": "void Foobar::Foobar(int &&, Bar *, bool *)",
"declarations": [],
"definition_spelling": "7:3-7:9",
"definition_extent": "7:3-7:32",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 3,
"is_operator": false,
"usr": "c:@S@Foobar@F@Foobar#I#*$@S@Bar#*b#",
"short_name": "Foobar",
"detailed_name": "void Foobar::Foobar(int, Bar *, bool *)",
"declarations": [],
"definition_spelling": "8:3-8:9",
"definition_extent": "8:3-8:30",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
OUTPUT: make_functions.cc
{
"includes": [{
"line": 1,
"resolved_path": "&make_functions.h"
}],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:make_functions.cc@41",
"short_name": "T",
"detailed_name": "T",
"definition_spelling": "3:20-3:21",
"definition_extent": "3:11-3:21",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["4:1-4:2"]
}, {
"id": 1,
"usr": "c:make_functions.cc@53",
"short_name": "Args",
"detailed_name": "Args",
"definition_spelling": "3:35-3:39",
"definition_extent": "3:23-3:39",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["4:15-4:19"]
}, {
"id": 2,
"usr": "c:make_functions.cc@139",
"short_name": "T",
"detailed_name": "T",
"definition_spelling": "8:20-8:21",
"definition_extent": "8:11-8:21",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["9:1-9:2"]
}, {
"id": 3,
"usr": "c:make_functions.cc@151",
"short_name": "Args",
"detailed_name": "Args",
"definition_spelling": "8:35-8:39",
"definition_extent": "8:23-8:39",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["9:16-9:20"]
}, {
"id": 4,
"usr": "c:@S@Foobar",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["14:14-14:20", "15:14-15:20", "16:14-16:20", "17:15-17:21"]
}, {
"id": 5,
"usr": "c:@S@Bar",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["16:29-16:32", "17:30-17:33"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@FT@>2#T#pTMakeUnique#P&&t0.1#*t0.0#",
"short_name": "MakeUnique",
"detailed_name": "T *MakeUnique(Args &&... args)",
"declarations": [],
"definition_spelling": "4:4-4:14",
"definition_extent": "4:1-6:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@14:3-14:13", "2@15:3-15:13", "2@16:3-16:13"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@FT@>2#T#pTmaKE_NoRefs#Pt0.1#*t0.0#",
"short_name": "maKE_NoRefs",
"detailed_name": "T *maKE_NoRefs(Args... args)",
"declarations": [],
"definition_spelling": "9:4-9:15",
"definition_extent": "9:1-11:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@17:3-17:14"],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:@F@caller22#",
"short_name": "caller22",
"detailed_name": "void caller22()",
"declarations": [],
"definition_spelling": "13:6-13:14",
"definition_extent": "13:1-18:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@14:3-14:13", "0@15:3-15:13", "0@16:3-16:13", "1@17:3-17:14"]
}, {
"id": 3,
"is_operator": false,
"usr": "c:@S@Foobar@F@Foobar#",
"short_name": "",
"detailed_name": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["~-1@14:3-14:13"],
"callees": []
}, {
"id": 4,
"is_operator": false,
"usr": "c:@S@Foobar@F@Foobar#I#",
"short_name": "",
"detailed_name": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["~-1@15:3-15:13"],
"callees": []
}, {
"id": 5,
"is_operator": false,
"usr": "c:@S@Foobar@F@Foobar#&&I#*$@S@Bar#*b#",
"short_name": "",
"detailed_name": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["~-1@16:3-16:13"],
"callees": []
}, {
"id": 6,
"is_operator": false,
"usr": "c:@S@Foobar@F@Foobar#I#*$@S@Bar#*b#",
"short_name": "",
"detailed_name": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["~-1@17:3-17:14"],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:make_functions.cc@86@FT@>2#T#pTMakeUnique#P&&t0.1#*t0.0#@args",
"short_name": "args",
"detailed_name": "Args &&... args",
"definition_spelling": "4:25-4:29",
"definition_extent": "4:15-4:29",
"cls": 1,
"uses": ["4:25-4:29"]
}, {
"id": 1,
"usr": "c:make_functions.cc@185@FT@>2#T#pTmaKE_NoRefs#Pt0.1#*t0.0#@args",
"short_name": "args",
"detailed_name": "Args... args",
"definition_spelling": "9:24-9:28",
"definition_extent": "9:16-9:28",
"cls": 1,
"uses": ["9:24-9:28"]
}]
}
*/

View File

@ -1,10 +0,0 @@
struct Bar {};
class Foobar {
public:
Foobar() {}
Foobar(int) {}
Foobar(int&&, Bar*, bool*) {}
Foobar(int, Bar*, bool*) {}
};

View File

@ -1,31 +0,0 @@
class Foo;
class Foo;
class Foo {};
class Foo;
/*
// NOTE: Separate decl/definition are not supported for classes. See source
// for comments.
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "3:7-3:10",
"definition_extent": "3:1-3:13",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:7-1:10", "2:7-2:10", "3:7-3:10", "4:7-4:10"]
}],
"funcs": [],
"vars": []
}
*/

View File

@ -1,38 +0,0 @@
class Foo {
int foo;
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0],
"instances": [],
"uses": ["1:7-1:10"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@FI@foo",
"short_name": "foo",
"detailed_name": "int Foo::foo",
"definition_spelling": "2:7-2:10",
"definition_extent": "2:3-2:10",
"declaring_type": 0,
"cls": 4,
"uses": ["2:7-2:10"]
}]
}
*/

View File

@ -1,41 +0,0 @@
class Foo {
static int foo;
};
int Foo::foo;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0],
"instances": [],
"uses": ["1:7-1:10", "5:5-5:8"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@foo",
"short_name": "foo",
"detailed_name": "int Foo::foo",
"declaration": "2:14-2:17",
"definition_spelling": "5:10-5:13",
"definition_extent": "5:1-5:13",
"declaring_type": 0,
"cls": 4,
"uses": ["2:14-2:17", "5:10-5:13"]
}]
}
*/

View File

@ -1,45 +0,0 @@
void foo();
void foo();
void foo() {}
void foo();
/*
// Note: we always use the latest seen ("most local") definition/declaration.
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"declarations": [{
"spelling": "1:6-1:9",
"extent": "1:1-1:11",
"content": "void foo()",
"param_spellings": []
}, {
"spelling": "2:6-2:9",
"extent": "2:1-2:11",
"content": "void foo()",
"param_spellings": []
}, {
"spelling": "4:6-4:9",
"extent": "4:1-4:11",
"content": "void foo()",
"param_spellings": []
}],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-3:14",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,63 +0,0 @@
int foo(int, int);
int foo(int aa,
int bb);
int foo(int aaa, int bbb);
int foo(int a, int b) { return 0; }
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#I#I#",
"short_name": "foo",
"detailed_name": "int foo(int a, int b)",
"declarations": [{
"spelling": "1:5-1:8",
"extent": "1:1-1:18",
"content": "int foo(int, int)",
"param_spellings": ["1:12-1:12", "1:17-1:17"]
}, {
"spelling": "2:5-2:8",
"extent": "2:1-3:16",
"content": "int foo(int aa,\n int bb)",
"param_spellings": ["2:13-2:15", "3:13-3:15"]
}, {
"spelling": "4:5-4:8",
"extent": "4:1-4:26",
"content": "int foo(int aaa, int bbb)",
"param_spellings": ["4:13-4:16", "4:22-4:25"]
}],
"definition_spelling": "5:5-5:8",
"definition_extent": "5:1-5:36",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:func_associated_function_params.cc@91@F@foo#I#I#@a",
"short_name": "a",
"detailed_name": "int a",
"definition_spelling": "5:13-5:14",
"definition_extent": "5:9-5:14",
"cls": 1,
"uses": ["5:13-5:14"]
}, {
"id": 1,
"usr": "c:func_associated_function_params.cc@98@F@foo#I#I#@b",
"short_name": "b",
"detailed_name": "int b",
"definition_spelling": "5:20-5:21",
"definition_extent": "5:16-5:21",
"cls": 1,
"uses": ["5:20-5:21"]
}]
}
*/

View File

@ -1,88 +0,0 @@
class Foo {
void declonly();
virtual void purevirtual() = 0;
void def();
};
void Foo::def() {}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-5:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0, 1, 2],
"vars": [],
"instances": [],
"uses": ["1:7-1:10", "7:6-7:9"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@declonly#",
"short_name": "declonly",
"detailed_name": "void Foo::declonly()",
"declarations": [{
"spelling": "2:8-2:16",
"extent": "2:3-2:18",
"content": "void declonly()",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@S@Foo@F@purevirtual#",
"short_name": "purevirtual",
"detailed_name": "void Foo::purevirtual()",
"declarations": [{
"spelling": "3:16-3:27",
"extent": "3:3-3:33",
"content": "virtual void purevirtual() = 0",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:@S@Foo@F@def#",
"short_name": "def",
"detailed_name": "void Foo::def()",
"declarations": [{
"spelling": "4:8-4:11",
"extent": "4:3-4:13",
"content": "void def()",
"param_spellings": []
}],
"definition_spelling": "7:11-7:14",
"definition_extent": "7:1-7:19",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,51 +0,0 @@
enum class Foo {
A,
B = 20
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@E@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:12-1:15",
"definition_extent": "1:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1],
"instances": [],
"uses": ["1:12-1:15"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@E@Foo@A",
"short_name": "A",
"detailed_name": "Foo::A",
"definition_spelling": "2:3-2:4",
"definition_extent": "2:3-2:4",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["2:3-2:4"]
}, {
"id": 1,
"usr": "c:@E@Foo@B",
"short_name": "B",
"detailed_name": "Foo::B",
"definition_spelling": "3:3-3:4",
"definition_extent": "3:3-3:9",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["3:3-3:4"]
}]
}
*/

View File

@ -1,51 +0,0 @@
enum Foo {
A,
B = 20
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@E@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1],
"instances": [],
"uses": ["1:6-1:9"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@E@Foo@A",
"short_name": "A",
"detailed_name": "Foo::A",
"definition_spelling": "2:3-2:4",
"definition_extent": "2:3-2:4",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["2:3-2:4"]
}, {
"id": 1,
"usr": "c:@E@Foo@B",
"short_name": "B",
"detailed_name": "Foo::B",
"definition_spelling": "3:3-3:4",
"definition_extent": "3:3-3:9",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["3:3-3:4"]
}]
}
*/

View File

@ -1,51 +0,0 @@
enum Foo : int {
A,
B = 20
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@E@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1],
"instances": [],
"uses": ["1:6-1:9"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@E@Foo@A",
"short_name": "A",
"detailed_name": "Foo::A",
"definition_spelling": "2:3-2:4",
"definition_extent": "2:3-2:4",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["2:3-2:4"]
}, {
"id": 1,
"usr": "c:@E@Foo@B",
"short_name": "B",
"detailed_name": "Foo::B",
"definition_spelling": "3:3-3:4",
"definition_extent": "3:3-3:9",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["3:3-3:4"]
}]
}
*/

View File

@ -1,63 +0,0 @@
enum class Foo {
A,
B = 20
};
Foo x = Foo::A;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@E@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:12-1:15",
"definition_extent": "1:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1],
"instances": [2],
"uses": ["1:12-1:15", "6:1-6:4", "6:9-6:12"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@E@Foo@A",
"short_name": "A",
"detailed_name": "Foo::A",
"definition_spelling": "2:3-2:4",
"definition_extent": "2:3-2:4",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["2:3-2:4", "6:14-6:15"]
}, {
"id": 1,
"usr": "c:@E@Foo@B",
"short_name": "B",
"detailed_name": "Foo::B",
"definition_spelling": "3:3-3:4",
"definition_extent": "3:3-3:9",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["3:3-3:4"]
}, {
"id": 2,
"usr": "c:@x",
"short_name": "x",
"detailed_name": "Foo x",
"definition_spelling": "6:5-6:6",
"definition_extent": "6:1-6:15",
"variable_type": 0,
"cls": 3,
"uses": ["6:5-6:6"]
}]
}
*/

View File

@ -1,96 +0,0 @@
enum A {};
enum B {};
template<typename T>
struct Foo {
struct Inner {};
};
Foo<A>::Inner a;
Foo<B> b;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@E@A",
"short_name": "A",
"detailed_name": "A",
"definition_spelling": "1:6-1:7",
"definition_extent": "1:1-1:10",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:6-1:7", "9:5-9:6"]
}, {
"id": 1,
"usr": "c:@E@B",
"short_name": "B",
"detailed_name": "B",
"definition_spelling": "2:6-2:7",
"definition_extent": "2:1-2:10",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["2:6-2:7", "10:5-10:6"]
}, {
"id": 2,
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "5:8-5:11",
"definition_extent": "5:1-7:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [1],
"uses": ["5:8-5:11", "9:1-9:4", "10:1-10:4"]
}, {
"id": 3,
"usr": "c:@ST>1#T@Foo@S@Inner",
"short_name": "Inner",
"detailed_name": "Foo::Inner",
"definition_spelling": "6:10-6:15",
"definition_extent": "6:3-6:18",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["6:10-6:15", "9:9-9:14"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"detailed_name": "Foo<A>::Inner a",
"definition_spelling": "9:15-9:16",
"definition_extent": "9:1-9:16",
"variable_type": 3,
"cls": 3,
"uses": ["9:15-9:16"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"detailed_name": "Foo<B> b",
"definition_spelling": "10:8-10:9",
"definition_extent": "10:1-10:9",
"variable_type": 2,
"cls": 3,
"uses": ["10:8-10:9"]
}]
}
*/

View File

@ -1,29 +0,0 @@
void foo(int a, int b);
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#I#I#",
"short_name": "foo",
"detailed_name": "void foo(int a, int b)",
"declarations": [{
"spelling": "1:6-1:9",
"extent": "1:1-1:23",
"content": "void foo(int a, int b)",
"param_spellings": ["1:14-1:15", "1:21-1:22"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,33 +0,0 @@
void foo();
void foo() {}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"declarations": [{
"spelling": "1:6-1:9",
"extent": "1:1-1:11",
"content": "void foo()",
"param_spellings": []
}],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-3:14",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,26 +0,0 @@
void foo() {}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-1:14",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,41 +0,0 @@
class Parent {};
class Derived : public Parent {};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Parent",
"short_name": "Parent",
"detailed_name": "Parent",
"definition_spelling": "1:7-1:13",
"definition_extent": "1:1-1:16",
"parents": [],
"derived": [1],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:7-1:13", "2:24-2:30"]
}, {
"id": 1,
"usr": "c:@S@Derived",
"short_name": "Derived",
"detailed_name": "Derived",
"definition_spelling": "2:7-2:14",
"definition_extent": "2:1-2:33",
"parents": [0],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["2:7-2:14"]
}],
"funcs": [],
"vars": []
}
*/

View File

@ -1,106 +0,0 @@
template<unsigned int C>
class Base1 {};
template<typename C>
class Base2 {};
template<unsigned int T>
class Derived1 : Base1<T> {};
template<typename T>
class Derived2 : Base2<T> {};
class Derived : Base1<3>, Base2<Derived>, Derived1<4>, Derived2<Derived> {};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@ST>1#Ni@Base1",
"short_name": "Base1",
"detailed_name": "Base1",
"definition_spelling": "2:7-2:12",
"definition_extent": "2:1-2:15",
"parents": [],
"derived": [2, 5],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["2:7-2:12", "8:18-8:23", "13:17-13:22"]
}, {
"id": 1,
"usr": "c:@ST>1#T@Base2",
"short_name": "Base2",
"detailed_name": "Base2",
"definition_spelling": "5:7-5:12",
"definition_extent": "5:1-5:15",
"parents": [],
"derived": [3, 5],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["5:7-5:12", "11:18-11:23", "13:27-13:32"]
}, {
"id": 2,
"usr": "c:@ST>1#Ni@Derived1",
"short_name": "Derived1",
"detailed_name": "Derived1",
"definition_spelling": "8:7-8:15",
"definition_extent": "8:1-8:29",
"parents": [0],
"derived": [5],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["8:7-8:15", "13:43-13:51"]
}, {
"id": 3,
"usr": "c:@ST>1#T@Derived2",
"short_name": "Derived2",
"detailed_name": "Derived2",
"definition_spelling": "11:7-11:15",
"definition_extent": "11:1-11:29",
"parents": [1],
"derived": [5],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["11:7-11:15", "13:56-13:64"]
}, {
"id": 4,
"usr": "c:class_inherit_templated_parent.cc@154",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["11:24-11:25"]
}, {
"id": 5,
"usr": "c:@S@Derived",
"short_name": "Derived",
"detailed_name": "Derived",
"definition_spelling": "13:7-13:14",
"definition_extent": "13:1-13:76",
"parents": [0, 1, 2, 3],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["13:7-13:14", "13:33-13:40", "13:65-13:72"]
}],
"funcs": [],
"vars": []
}
*/

View File

@ -1,71 +0,0 @@
class Root {};
class MiddleA : public Root {};
class MiddleB : public Root {};
class Derived : public MiddleA, public MiddleB {};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Root",
"short_name": "Root",
"detailed_name": "Root",
"definition_spelling": "1:7-1:11",
"definition_extent": "1:1-1:14",
"parents": [],
"derived": [1, 2],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:7-1:11", "2:24-2:28", "3:24-3:28"]
}, {
"id": 1,
"usr": "c:@S@MiddleA",
"short_name": "MiddleA",
"detailed_name": "MiddleA",
"definition_spelling": "2:7-2:14",
"definition_extent": "2:1-2:31",
"parents": [0],
"derived": [3],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["2:7-2:14", "4:24-4:31"]
}, {
"id": 2,
"usr": "c:@S@MiddleB",
"short_name": "MiddleB",
"detailed_name": "MiddleB",
"definition_spelling": "3:7-3:14",
"definition_extent": "3:1-3:31",
"parents": [0],
"derived": [3],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["3:7-3:14", "4:40-4:47"]
}, {
"id": 3,
"usr": "c:@S@Derived",
"short_name": "Derived",
"detailed_name": "Derived",
"definition_spelling": "4:7-4:14",
"definition_extent": "4:1-4:50",
"parents": [1, 2],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["4:7-4:14"]
}],
"funcs": [],
"vars": []
}
*/

View File

@ -1,78 +0,0 @@
class Root {
virtual void foo();
};
class Derived : public Root {
void foo() override {}
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Root",
"short_name": "Root",
"detailed_name": "Root",
"definition_spelling": "1:7-1:11",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [1],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["1:7-1:11", "4:24-4:28"]
}, {
"id": 1,
"usr": "c:@S@Derived",
"short_name": "Derived",
"detailed_name": "Derived",
"definition_spelling": "4:7-4:14",
"definition_extent": "4:1-6:2",
"parents": [0],
"derived": [],
"types": [],
"funcs": [1],
"vars": [],
"instances": [],
"uses": ["4:7-4:14"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Root@F@foo#",
"short_name": "foo",
"detailed_name": "void Root::foo()",
"declarations": [{
"spelling": "2:16-2:19",
"extent": "2:3-2:21",
"content": "virtual void foo()",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [1],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@S@Derived@F@foo#",
"short_name": "foo",
"detailed_name": "void Derived::foo()",
"declarations": [],
"definition_spelling": "5:8-5:11",
"definition_extent": "5:3-5:25",
"declaring_type": 1,
"base": [0],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,46 +0,0 @@
class IFoo {
virtual void foo() = 0;
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@IFoo",
"short_name": "IFoo",
"detailed_name": "IFoo",
"definition_spelling": "1:7-1:11",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["1:7-1:11"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@IFoo@F@foo#",
"short_name": "foo",
"detailed_name": "void IFoo::foo()",
"declarations": [{
"spelling": "2:16-2:19",
"extent": "2:3-2:25",
"content": "virtual void foo() = 0",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,107 +0,0 @@
struct Base0 {
virtual ~Base0() { }
};
struct Base1 {
virtual ~Base1() { }
};
struct Derived : Base0, Base1 {
~Derived() override { }
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Base0",
"short_name": "Base0",
"detailed_name": "Base0",
"definition_spelling": "1:8-1:13",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [2],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["1:8-1:13", "2:12-2:17", "7:18-7:23"]
}, {
"id": 1,
"usr": "c:@S@Base1",
"short_name": "Base1",
"detailed_name": "Base1",
"definition_spelling": "4:8-4:13",
"definition_extent": "4:1-6:2",
"parents": [],
"derived": [2],
"types": [],
"funcs": [1],
"vars": [],
"instances": [],
"uses": ["4:8-4:13", "5:12-5:17", "7:25-7:30"]
}, {
"id": 2,
"usr": "c:@S@Derived",
"short_name": "Derived",
"detailed_name": "Derived",
"definition_spelling": "7:8-7:15",
"definition_extent": "7:1-9:2",
"parents": [0, 1],
"derived": [],
"types": [],
"funcs": [2],
"vars": [],
"instances": [],
"uses": ["7:8-7:15", "8:4-8:11"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Base0@F@~Base0#",
"short_name": "~Base0",
"detailed_name": "void Base0::~Base0() noexcept",
"declarations": [],
"definition_spelling": "2:11-2:17",
"definition_extent": "2:3-2:23",
"declaring_type": 0,
"base": [],
"derived": [2],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@S@Base1@F@~Base1#",
"short_name": "~Base1",
"detailed_name": "void Base1::~Base1() noexcept",
"declarations": [],
"definition_spelling": "5:11-5:17",
"definition_extent": "5:3-5:23",
"declaring_type": 1,
"base": [],
"derived": [2],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:@S@Derived@F@~Derived#",
"short_name": "~Derived",
"detailed_name": "void Derived::~Derived() noexcept",
"declarations": [],
"definition_spelling": "8:3-8:11",
"definition_extent": "8:3-8:26",
"declaring_type": 2,
"base": [0, 1],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,89 +0,0 @@
void foo() {
int x;
auto dosomething = [&x](int y) {
++x;
++y;
};
dosomething(1);
dosomething(1);
dosomething(1);
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:lambda.cc@47@F@foo#@Sa",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [1],
"uses": []
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-12:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["1@9:14-9:15", "1@10:14-10:15", "1@11:14-11:15"]
}, {
"id": 1,
"is_operator": false,
"usr": "c:lambda.cc@57@F@foo#@Sa@F@operator()#I#1",
"short_name": "",
"detailed_name": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["0@9:14-9:15", "0@10:14-10:15", "0@11:14-11:15"],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:lambda.cc@16@F@foo#@x",
"short_name": "x",
"detailed_name": "int x",
"definition_spelling": "2:7-2:8",
"definition_extent": "2:3-2:8",
"cls": 1,
"uses": ["2:7-2:8", "5:7-5:8", "4:24-4:25"]
}, {
"id": 1,
"usr": "c:lambda.cc@28@F@foo#@dosomething",
"short_name": "dosomething",
"detailed_name": "lambda dosomething",
"definition_spelling": "4:8-4:19",
"definition_extent": "4:3-7:4",
"variable_type": 0,
"cls": 1,
"uses": ["4:8-4:19", "9:3-9:14", "10:3-10:14", "11:3-11:14"]
}, {
"id": 2,
"usr": "c:lambda.cc@52@F@foo#@Sa@F@operator()#I#1@y",
"short_name": "y",
"detailed_name": "int y",
"definition_spelling": "4:31-4:32",
"definition_extent": "4:27-4:32",
"cls": 4,
"uses": ["4:31-4:32", "6:7-6:8"]
}]
}
*/

View File

@ -1,75 +0,0 @@
#define FOO(aaa, bbb) \
int a();\
int a() { return aaa + bbb; }
int make1() {
return 3;
}
const int make2 = 5;
FOO(make1(), make2);
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@make1#",
"short_name": "make1",
"detailed_name": "int make1()",
"declarations": [],
"definition_spelling": "6:5-6:10",
"definition_extent": "6:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["1@12:5-12:10"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@a#",
"short_name": "a",
"detailed_name": "int a()",
"declarations": [{
"spelling": "12:1-12:20",
"extent": "12:1-12:20",
"content": "int a();\n int a() { return aaa + bbb; }\n\n\n int make1() {\n return 3;\n }\n const int make2 = 5;\n\n\n FOO(make1(), make2)",
"param_spellings": []
}],
"definition_spelling": "12:1-12:20",
"definition_extent": "12:1-12:20",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@12:5-12:10"]
}],
"vars": [{
"id": 0,
"usr": "c:complex.cc@make2",
"short_name": "make2",
"detailed_name": "const int make2",
"definition_spelling": "9:11-9:16",
"definition_extent": "9:1-9:20",
"cls": 3,
"uses": ["9:11-9:16", "12:14-12:19"]
}, {
"id": 1,
"usr": "c:complex.cc@8@macro@FOO",
"short_name": "FOO",
"detailed_name": "FOO",
"hover": "#define FOO(aaa, bbb)\n int a();\n int a() { return aaa + bbb; }",
"definition_spelling": "1:9-1:12",
"definition_extent": "1:9-3:32",
"cls": 2,
"uses": ["1:9-1:12", "12:1-12:4"]
}]
}
*/

View File

@ -1,62 +0,0 @@
#define A 5
#define DISALLOW(type) type(type&&) = delete;
struct Foo {
DISALLOW(Foo);
};
int x = A;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "4:8-4:11",
"definition_extent": "4:1-6:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["4:8-4:11"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@x",
"short_name": "x",
"detailed_name": "int x",
"definition_spelling": "8:5-8:6",
"definition_extent": "8:1-8:10",
"cls": 3,
"uses": ["8:5-8:6"]
}, {
"id": 1,
"usr": "c:foo.cc@8@macro@A",
"short_name": "A",
"detailed_name": "A",
"hover": "#define A 5",
"definition_spelling": "1:9-1:10",
"definition_extent": "1:9-1:12",
"cls": 2,
"uses": ["1:9-1:10", "8:9-8:10"]
}, {
"id": 2,
"usr": "c:foo.cc@21@macro@DISALLOW",
"short_name": "DISALLOW",
"detailed_name": "DISALLOW",
"hover": "#define DISALLOW(type) type(type&&) = delete;",
"definition_spelling": "2:9-2:17",
"definition_extent": "2:9-2:46",
"cls": 2,
"uses": ["2:9-2:17", "5:3-5:11"]
}]
}
*/

View File

@ -1,50 +0,0 @@
class Foo {
void foo();
};
/*
// NOTE: Lack of declaring_type in functions and funcs in Foo is okay, because
// those are processed when we find the definition for Foo::foo. Pure
// virtuals are treated specially and get added to the type immediately.
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["1:7-1:10"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@foo#",
"short_name": "foo",
"detailed_name": "void Foo::foo()",
"declarations": [{
"spelling": "2:8-2:11",
"extent": "2:3-2:13",
"content": "void foo()",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,50 +0,0 @@
class Foo {
void foo() const;
};
void Foo::foo() const {}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["1:7-1:10", "5:6-5:9"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@foo#1",
"short_name": "foo",
"detailed_name": "void Foo::foo() const",
"declarations": [{
"spelling": "2:8-2:11",
"extent": "2:3-2:19",
"content": "void foo() const",
"param_spellings": []
}],
"definition_spelling": "5:11-5:14",
"definition_extent": "5:1-5:25",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,43 +0,0 @@
class Foo {
void foo() {}
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["1:7-1:10"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@foo#",
"short_name": "foo",
"detailed_name": "void Foo::foo()",
"declarations": [],
"definition_spelling": "2:8-2:11",
"definition_extent": "2:3-2:16",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,87 +0,0 @@
enum Foo {
#include "funky_enum.h"
};
/*
// TODO: In the future try to have better support for types defined across
// multiple files.
OUTPUT: funky_enum.h
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@E@Foo",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1, 2],
"instances": [],
"uses": []
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@E@Foo@A",
"short_name": "A",
"detailed_name": "Foo::A",
"definition_spelling": "4:1-4:2",
"definition_extent": "4:1-4:2",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["4:1-4:2"]
}, {
"id": 1,
"usr": "c:@E@Foo@B",
"short_name": "B",
"detailed_name": "Foo::B",
"definition_spelling": "5:1-5:2",
"definition_extent": "5:1-5:2",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["5:1-5:2"]
}, {
"id": 2,
"usr": "c:@E@Foo@C",
"short_name": "C",
"detailed_name": "Foo::C",
"definition_spelling": "6:1-6:2",
"definition_extent": "6:1-6:2",
"variable_type": 0,
"declaring_type": 0,
"cls": 4,
"uses": ["6:1-6:2"]
}]
}
OUTPUT: funky_enum.cc
{
"includes": [{
"line": 2,
"resolved_path": "&funky_enum.h"
}],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@E@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:6-1:9"]
}],
"funcs": [],
"vars": []
}
*/

View File

@ -1,6 +0,0 @@
// This file cannot be built directory. It is included in an enum definition of
// another file.
A,
B,
C

View File

@ -1,18 +0,0 @@
#pragma once
struct Base {};
struct SameFileDerived : Base {};
using Foo0 = SameFileDerived;
template <typename T>
void Foo1() {}
template <typename T>
struct Foo2 {};
enum Foo3 { A, B, C };
int Foo4;
static int Foo5;

View File

@ -1,190 +0,0 @@
#include "header.h"
void Impl() {
Foo1<int>();
}
/*
OUTPUT: header.h
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Base",
"short_name": "Base",
"detailed_name": "Base",
"definition_spelling": "3:8-3:12",
"definition_extent": "3:1-3:15",
"parents": [],
"derived": [1],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["3:8-3:12", "5:26-5:30"]
}, {
"id": 1,
"usr": "c:@S@SameFileDerived",
"short_name": "SameFileDerived",
"detailed_name": "SameFileDerived",
"definition_spelling": "5:8-5:23",
"definition_extent": "5:1-5:33",
"parents": [0],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["5:8-5:23", "7:14-7:29"]
}, {
"id": 2,
"usr": "c:@Foo0",
"short_name": "Foo0",
"detailed_name": "Foo0",
"hover": "using Foo0 = SameFileDerived",
"definition_spelling": "7:7-7:11",
"definition_extent": "7:1-7:29",
"alias_of": 1,
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["7:7-7:11"]
}, {
"id": 3,
"usr": "c:@ST>1#T@Foo2",
"short_name": "Foo2",
"detailed_name": "Foo2",
"definition_spelling": "13:8-13:12",
"definition_extent": "13:1-13:15",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["13:8-13:12"]
}, {
"id": 4,
"usr": "c:@E@Foo3",
"short_name": "Foo3",
"detailed_name": "Foo3",
"definition_spelling": "15:6-15:10",
"definition_extent": "15:1-15:22",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1, 2],
"instances": [],
"uses": ["15:6-15:10"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@FT@>1#TFoo1#v#",
"short_name": "Foo1",
"detailed_name": "void Foo1()",
"declarations": [],
"definition_spelling": "10:6-10:10",
"definition_extent": "10:1-10:15",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@E@Foo3@A",
"short_name": "A",
"detailed_name": "Foo3::A",
"definition_spelling": "15:13-15:14",
"definition_extent": "15:13-15:14",
"variable_type": 4,
"declaring_type": 4,
"cls": 4,
"uses": ["15:13-15:14"]
}, {
"id": 1,
"usr": "c:@E@Foo3@B",
"short_name": "B",
"detailed_name": "Foo3::B",
"definition_spelling": "15:16-15:17",
"definition_extent": "15:16-15:17",
"variable_type": 4,
"declaring_type": 4,
"cls": 4,
"uses": ["15:16-15:17"]
}, {
"id": 2,
"usr": "c:@E@Foo3@C",
"short_name": "C",
"detailed_name": "Foo3::C",
"definition_spelling": "15:19-15:20",
"definition_extent": "15:19-15:20",
"variable_type": 4,
"declaring_type": 4,
"cls": 4,
"uses": ["15:19-15:20"]
}, {
"id": 3,
"usr": "c:@Foo4",
"short_name": "Foo4",
"detailed_name": "int Foo4",
"definition_spelling": "17:5-17:9",
"definition_extent": "17:1-17:9",
"cls": 3,
"uses": ["17:5-17:9"]
}, {
"id": 4,
"usr": "c:header.h@Foo5",
"short_name": "Foo5",
"detailed_name": "int Foo5",
"definition_spelling": "18:12-18:16",
"definition_extent": "18:1-18:16",
"cls": 3,
"uses": ["18:12-18:16"]
}]
}
OUTPUT: impl.cc
{
"includes": [{
"line": 1,
"resolved_path": "&header.h"
}],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@Impl#",
"short_name": "Impl",
"detailed_name": "void Impl()",
"declarations": [],
"definition_spelling": "3:6-3:10",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["1@4:3-4:7"]
}, {
"id": 1,
"is_operator": false,
"usr": "c:@FT@>1#TFoo1#v#",
"short_name": "",
"detailed_name": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["0@4:3-4:7"],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,3 +0,0 @@
#pragma once
void header();

View File

@ -1,70 +0,0 @@
#include "simple_header.h"
void impl() {
header();
}
/*
OUTPUT: simple_header.h
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@header#",
"short_name": "header",
"detailed_name": "void header()",
"declarations": [{
"spelling": "3:6-3:12",
"extent": "3:1-3:14",
"content": "void header()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
OUTPUT: simple_impl.cc
{
"includes": [{
"line": 1,
"resolved_path": "&simple_header.h"
}],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@impl#",
"short_name": "impl",
"detailed_name": "void impl()",
"declarations": [],
"definition_spelling": "3:6-3:10",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["1@4:3-4:9"]
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@header#",
"short_name": "",
"detailed_name": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["0@4:3-4:9"],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,84 +0,0 @@
#include "static.h"
void Buffer::CreateSharedBuffer() {}
/*
OUTPUT: static.h
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Buffer",
"short_name": "Buffer",
"detailed_name": "Buffer",
"definition_spelling": "3:8-3:14",
"definition_extent": "3:1-5:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["3:8-3:14"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Buffer@F@CreateSharedBuffer#S",
"short_name": "CreateSharedBuffer",
"detailed_name": "void Buffer::CreateSharedBuffer()",
"declarations": [{
"spelling": "4:15-4:33",
"extent": "4:3-4:35",
"content": "static void CreateSharedBuffer()",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
OUTPUT: static.cc
{
"includes": [{
"line": 1,
"resolved_path": "&static.h"
}],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Buffer",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["3:6-3:12"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Buffer@F@CreateSharedBuffer#S",
"short_name": "CreateSharedBuffer",
"detailed_name": "void Buffer::CreateSharedBuffer()",
"declarations": [],
"definition_spelling": "3:14-3:32",
"definition_extent": "3:1-3:37",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,5 +0,0 @@
#pragma once
struct Buffer {
static void CreateSharedBuffer();
};

View File

@ -1,31 +0,0 @@
namespace {
void foo();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:anonymous_function.cc@aN@F@foo#",
"short_name": "foo",
"detailed_name": "void (anon)::foo()",
"declarations": [{
"spelling": "2:6-2:9",
"extent": "2:1-2:11",
"content": "void foo()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,31 +0,0 @@
namespace hello {
void foo(int a, int b);
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@N@hello@F@foo#I#I#",
"short_name": "foo",
"detailed_name": "void hello::foo(int a, int b)",
"declarations": [{
"spelling": "2:6-2:9",
"extent": "2:1-2:23",
"content": "void foo(int a, int b)",
"param_spellings": ["2:14-2:15", "2:21-2:22"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,28 +0,0 @@
namespace hello {
void foo() {}
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@N@hello@F@foo#",
"short_name": "foo",
"detailed_name": "void hello::foo()",
"declarations": [],
"definition_spelling": "2:6-2:9",
"definition_extent": "2:1-2:14",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,48 +0,0 @@
namespace hello {
class Foo {
void foo();
};
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@N@hello@S@Foo",
"short_name": "Foo",
"detailed_name": "hello::Foo",
"definition_spelling": "2:7-2:10",
"definition_extent": "2:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["2:7-2:10"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@N@hello@S@Foo@F@foo#",
"short_name": "foo",
"detailed_name": "void hello::Foo::foo()",
"declarations": [{
"spelling": "3:8-3:11",
"extent": "3:3-3:13",
"content": "void foo()",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,52 +0,0 @@
namespace hello {
class Foo {
void foo();
};
void Foo::foo() {}
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@N@hello@S@Foo",
"short_name": "Foo",
"detailed_name": "hello::Foo",
"definition_spelling": "2:7-2:10",
"definition_extent": "2:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["2:7-2:10", "6:6-6:9"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@N@hello@S@Foo@F@foo#",
"short_name": "foo",
"detailed_name": "void hello::Foo::foo()",
"declarations": [{
"spelling": "3:8-3:11",
"extent": "3:3-3:13",
"content": "void foo()",
"param_spellings": []
}],
"definition_spelling": "6:11-6:14",
"definition_extent": "6:1-6:19",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,45 +0,0 @@
namespace hello {
class Foo {
void foo() {}
};
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@N@hello@S@Foo",
"short_name": "Foo",
"detailed_name": "hello::Foo",
"definition_spelling": "2:7-2:10",
"definition_extent": "2:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["2:7-2:10"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@N@hello@S@Foo@F@foo#",
"short_name": "foo",
"detailed_name": "void hello::Foo::foo()",
"declarations": [],
"definition_spelling": "3:8-3:11",
"definition_extent": "3:3-3:16",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,66 +0,0 @@
namespace foo {
namespace bar {
namespace baz {
int qux = 42;
}
}
}
namespace fbz = foo::bar::baz;
void func() {
int a = foo::bar::baz::qux;
int b = fbz::qux;
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@func#",
"short_name": "func",
"detailed_name": "void func()",
"declarations": [],
"definition_spelling": "11:6-11:10",
"definition_extent": "11:1-14:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@N@foo@N@bar@N@baz@qux",
"short_name": "qux",
"detailed_name": "int foo::bar::baz::qux",
"definition_spelling": "4:18-4:21",
"definition_extent": "4:14-4:26",
"cls": 3,
"uses": ["4:18-4:21", "12:26-12:29", "13:16-13:19"]
}, {
"id": 1,
"usr": "c:namespace_alias.cc@167@F@func#@a",
"short_name": "a",
"detailed_name": "int a",
"definition_spelling": "12:7-12:8",
"definition_extent": "12:3-12:29",
"cls": 1,
"uses": ["12:7-12:8"]
}, {
"id": 2,
"usr": "c:namespace_alias.cc@198@F@func#@b",
"short_name": "b",
"detailed_name": "int b",
"definition_spelling": "13:7-13:8",
"definition_extent": "13:3-13:19",
"cls": 1,
"uses": ["13:7-13:8"]
}]
}
*/

View File

@ -1,70 +0,0 @@
namespace ns {
int Foo;
void Accept(int a) {}
}
void Runner() {
ns::Accept(ns::Foo);
using namespace ns;
Accept(Foo);
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@N@ns@F@Accept#I#",
"short_name": "Accept",
"detailed_name": "void ns::Accept(int a)",
"declarations": [],
"definition_spelling": "3:8-3:14",
"definition_extent": "3:3-3:24",
"base": [],
"derived": [],
"locals": [],
"callers": ["1@7:7-7:13", "1@9:3-9:9"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@Runner#",
"short_name": "Runner",
"detailed_name": "void Runner()",
"declarations": [],
"definition_spelling": "6:6-6:12",
"definition_extent": "6:1-10:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@7:7-7:13", "0@9:3-9:9"]
}],
"vars": [{
"id": 0,
"usr": "c:@N@ns@Foo",
"short_name": "Foo",
"detailed_name": "int ns::Foo",
"definition_spelling": "2:7-2:10",
"definition_extent": "2:3-2:10",
"cls": 3,
"uses": ["2:7-2:10", "7:18-7:21", "9:10-9:13"]
}, {
"id": 1,
"usr": "c:namespace_reference.cc@42@N@ns@F@Accept#I#@a",
"short_name": "a",
"detailed_name": "int a",
"definition_spelling": "3:19-3:20",
"definition_extent": "3:15-3:20",
"cls": 1,
"uses": ["3:19-3:20"]
}]
}
*/

View File

@ -1,154 +0,0 @@
@interface AClass
+ (void)test;
- (void)anInstanceMethod;
@property (nonatomic) int aProp;
@end
@implementation AClass
+ (void)test {}
- (void)anInstanceMethod {}
@end
int main(void)
{
AClass *instance = [AClass init];
[instance anInstanceMethod];
instance.aProp = 12;
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:objc(cs)AClass",
"short_name": "AClass",
"detailed_name": "AClass",
"definition_spelling": "7:17-7:23",
"definition_extent": "7:1-10:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:12-1:18", "7:17-7:23", "14:3-14:9", "14:23-14:29"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:objc(cs)AClass(cm)test",
"short_name": "test",
"detailed_name": " AClass::test",
"declarations": [{
"spelling": "2:11-2:15",
"extent": "2:3-2:16",
"content": "+ (void)test;",
"param_spellings": []
}],
"definition_spelling": "8:9-8:13",
"definition_extent": "8:1-8:16",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:objc(cs)AClass(im)anInstanceMethod",
"short_name": "anInstanceMethod",
"detailed_name": " AClass::anInstanceMethod",
"declarations": [{
"spelling": "3:11-3:27",
"extent": "3:3-3:28",
"content": "- (void)anInstanceMethod;",
"param_spellings": []
}],
"definition_spelling": "9:9-9:25",
"definition_extent": "9:1-9:28",
"base": [],
"derived": [],
"locals": [],
"callers": ["4@15:13-15:29"],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:objc(cs)AClass(im)aProp",
"short_name": "aProp",
"detailed_name": " AClass::aProp",
"declarations": [{
"spelling": "0:0-0:0",
"extent": "4:29-4:34",
"content": "aProp",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 3,
"is_operator": false,
"usr": "c:objc(cs)AClass(im)setAProp:",
"short_name": "setAProp:",
"detailed_name": " AClass::setAProp:",
"declarations": [{
"spelling": "0:0-0:0",
"extent": "4:29-4:34",
"content": "aProp",
"param_spellings": ["4:29-4:34"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["4@0:0-0:0"],
"callees": []
}, {
"id": 4,
"is_operator": false,
"usr": "c:@F@main#",
"short_name": "main",
"detailed_name": "int main()",
"declarations": [],
"definition_spelling": "12:5-12:9",
"definition_extent": "12:1-17:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["1@15:13-15:29", "3@0:0-0:0"]
}],
"vars": [{
"id": 0,
"usr": "c:objc(cs)AClass(py)aProp",
"short_name": "aProp",
"detailed_name": "int AClass::aProp",
"declaration": "4:29-4:34",
"cls": 1,
"uses": ["4:29-4:34", "16:12-16:17"]
}, {
"id": 1,
"usr": "c:objc(cs)AClass@_aProp",
"short_name": "_aProp",
"detailed_name": "int AClass::_aProp",
"definition_spelling": "4:29-4:34",
"definition_extent": "4:29-4:34",
"cls": 1,
"uses": ["4:29-4:34"]
}, {
"id": 2,
"usr": "c:class.m@208@F@main#@instance",
"short_name": "instance",
"detailed_name": "AClass * instance",
"definition_spelling": "14:11-14:19",
"definition_extent": "14:3-14:35",
"cls": 1,
"uses": ["14:11-14:19", "15:4-15:12", "16:3-16:11"]
}]
}
*/

View File

@ -1,100 +0,0 @@
class Foo {
void operator()(int) { }
void operator()(bool);
int operator()(int a, int b);
};
Foo &operator += (const Foo&, const int&);
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-5:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0, 1, 2],
"vars": [],
"instances": [],
"uses": ["1:7-1:10", "7:1-7:4", "7:25-7:28"]
}],
"funcs": [{
"id": 0,
"is_operator": true,
"usr": "c:@S@Foo@F@operator()#I#",
"short_name": "operator()",
"detailed_name": "void Foo::operator()(int)",
"declarations": [],
"definition_spelling": "2:8-2:18",
"definition_extent": "2:3-2:27",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 1,
"is_operator": true,
"usr": "c:@S@Foo@F@operator()#b#",
"short_name": "operator()",
"detailed_name": "void Foo::operator()(bool)",
"declarations": [{
"spelling": "3:8-3:18",
"extent": "3:3-3:24",
"content": "void operator()(bool)",
"param_spellings": ["3:23-3:23"]
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 2,
"is_operator": true,
"usr": "c:@S@Foo@F@operator()#I#I#",
"short_name": "operator()",
"detailed_name": "int Foo::operator()(int a, int b)",
"declarations": [{
"spelling": "4:7-4:17",
"extent": "4:3-4:31",
"content": "int operator()(int a, int b)",
"param_spellings": ["4:22-4:23", "4:29-4:30"]
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 3,
"is_operator": true,
"usr": "c:@F@operator+=#&1$@S@Foo#&1I#",
"short_name": "operator+=",
"detailed_name": "Foo &operator+=(const Foo &, const int &)",
"declarations": [{
"spelling": "7:6-7:17",
"extent": "7:1-7:42",
"content": "Foo &operator += (const Foo&, const int&)",
"param_spellings": ["7:29-7:29", "7:41-7:41"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,81 +0,0 @@
#include <vector>
struct MergeableUpdate {
int a;
int b;
std::vector<int> to_add;
};
/*
TEXT_REPLACE:
c:@N@std@ST>2#T#T@vector <===> c:@N@std@N@__1@ST>2#T#T@vector
OUTPUT:
{
"includes": [{
"line": 1,
"resolved_path": "&vector"
}],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@MergeableUpdate",
"short_name": "MergeableUpdate",
"detailed_name": "MergeableUpdate",
"definition_spelling": "3:8-3:23",
"definition_extent": "3:1-7:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1, 2],
"instances": [],
"uses": ["3:8-3:23"]
}, {
"id": 1,
"usr": "c:@N@std@N@__1@ST>2#T#T@vector",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [2],
"uses": ["6:8-6:14"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@S@MergeableUpdate@FI@a",
"short_name": "a",
"detailed_name": "int MergeableUpdate::a",
"definition_spelling": "4:7-4:8",
"definition_extent": "4:3-4:8",
"declaring_type": 0,
"cls": 4,
"uses": ["4:7-4:8"]
}, {
"id": 1,
"usr": "c:@S@MergeableUpdate@FI@b",
"short_name": "b",
"detailed_name": "int MergeableUpdate::b",
"definition_spelling": "5:7-5:8",
"definition_extent": "5:3-5:8",
"declaring_type": 0,
"cls": 4,
"uses": ["5:7-5:8"]
}, {
"id": 2,
"usr": "c:@S@MergeableUpdate@FI@to_add",
"short_name": "to_add",
"detailed_name": "std::vector<int> MergeableUpdate::to_add",
"definition_spelling": "6:20-6:26",
"definition_extent": "6:3-6:26",
"variable_type": 1,
"declaring_type": 0,
"cls": 4,
"uses": ["6:20-6:26"]
}]
}
*/

View File

@ -1,124 +0,0 @@
#pragma once
#include <string>
#include <vector>
struct CompilationEntry {
std::string directory;
std::string filename;
std::vector<std::string> args;
};
std::vector<CompilationEntry> LoadCompilationEntriesFromDirectory(const std::string& project_directory);
/*
TEXT_REPLACE:
c:@N@std@T@string <===> c:@N@std@N@__1@T@string
c:@N@std@N@__cxx11@T@string <===> c:@N@std@N@__1@T@string
c:@N@std@ST>2#T#T@vector <===> c:@N@std@N@__1@ST>2#T#T@vector
c:@F@LoadCompilationEntriesFromDirectory#&1$@N@std@N@__1@S@basic_string>#C#$@N@std@N@__1@S@char_traits>#C#$@N@std@N@__1@S@allocator>#C# <===> c:@F@LoadCompilationEntriesFromDirectory#&1$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#
c:@F@LoadCompilationEntriesFromDirectory#&1$@N@std@N@__cxx11@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C# <===> c:@F@LoadCompilationEntriesFromDirectory#&1$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#
OUTPUT:
{
"includes": [{
"line": 3,
"resolved_path": "&string"
}, {
"line": 4,
"resolved_path": "&vector"
}],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@CompilationEntry",
"short_name": "CompilationEntry",
"detailed_name": "CompilationEntry",
"definition_spelling": "6:8-6:24",
"definition_extent": "6:1-10:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1, 2],
"instances": [],
"uses": ["6:8-6:24", "12:13-12:29"]
}, {
"id": 1,
"usr": "c:@N@std@N@__1@T@string",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0, 1],
"uses": ["7:8-7:14", "8:8-8:14", "9:20-9:26", "12:78-12:84"]
}, {
"id": 2,
"usr": "c:@N@std@N@__1@ST>2#T#T@vector",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [2],
"uses": ["9:8-9:14", "12:6-12:12"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@LoadCompilationEntriesFromDirectory#&1$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#",
"short_name": "LoadCompilationEntriesFromDirectory",
"detailed_name": "std::vector<CompilationEntry> LoadCompilationEntriesFromDirectory(const std::string &project_directory)",
"declarations": [{
"spelling": "12:31-12:66",
"extent": "12:1-12:104",
"content": "std::vector<CompilationEntry> LoadCompilationEntriesFromDirectory(const std::string& project_directory)",
"param_spellings": ["12:86-12:103"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@S@CompilationEntry@FI@directory",
"short_name": "directory",
"detailed_name": "std::string CompilationEntry::directory",
"definition_spelling": "7:15-7:24",
"definition_extent": "7:3-7:24",
"variable_type": 1,
"declaring_type": 0,
"cls": 4,
"uses": ["7:15-7:24"]
}, {
"id": 1,
"usr": "c:@S@CompilationEntry@FI@filename",
"short_name": "filename",
"detailed_name": "std::string CompilationEntry::filename",
"definition_spelling": "8:15-8:23",
"definition_extent": "8:3-8:23",
"variable_type": 1,
"declaring_type": 0,
"cls": 4,
"uses": ["8:15-8:23"]
}, {
"id": 2,
"usr": "c:@S@CompilationEntry@FI@args",
"short_name": "args",
"detailed_name": "std::vector<std::string> CompilationEntry::args",
"definition_spelling": "9:28-9:32",
"definition_extent": "9:3-9:32",
"variable_type": 2,
"declaring_type": 0,
"cls": 4,
"uses": ["9:28-9:32"]
}]
}
*/

View File

@ -1,122 +0,0 @@
#include "static_function_in_type.h"
namespace ns {
// static
void Foo::Register(Manager* m) {
}
}
/*
OUTPUT: static_function_in_type.h
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@N@ns@S@Manager",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["3:7-3:14", "6:24-6:31"]
}, {
"id": 1,
"usr": "c:@N@ns@S@Foo",
"short_name": "Foo",
"detailed_name": "ns::Foo",
"definition_spelling": "5:8-5:11",
"definition_extent": "5:1-7:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["5:8-5:11"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@N@ns@S@Foo@F@Register#*$@N@ns@S@Manager#S",
"short_name": "Register",
"detailed_name": "void ns::Foo::Register(ns::Manager *)",
"declarations": [{
"spelling": "6:15-6:23",
"extent": "6:3-6:33",
"content": "static void Register(Manager*)",
"param_spellings": ["6:32-6:32"]
}],
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
OUTPUT: static_function_in_type.cc
{
"includes": [{
"line": 1,
"resolved_path": "&static_function_in_type.h"
}],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@N@ns@S@Foo",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["5:6-5:9"]
}, {
"id": 1,
"usr": "c:@N@ns@S@Manager",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["5:20-5:27"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@N@ns@S@Foo@F@Register#*$@N@ns@S@Manager#S",
"short_name": "Register",
"detailed_name": "void ns::Foo::Register(ns::Manager *m)",
"declarations": [],
"definition_spelling": "5:11-5:19",
"definition_extent": "5:1-6:2",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:static_function_in_type.cc@86@N@ns@S@Foo@F@Register#*$@N@ns@S@Manager#S@m",
"short_name": "m",
"detailed_name": "ns::Manager * m",
"definition_spelling": "5:29-5:30",
"definition_extent": "5:20-5:30",
"variable_type": 1,
"cls": 1,
"uses": ["5:29-5:30"]
}]
}
*/

View File

@ -1,9 +0,0 @@
namespace ns {
class Manager;
struct Foo {
static void Register(Manager*);
};
} // namespace ns

View File

@ -1,25 +0,0 @@
#ifndef FOO
#define FOO
#endif
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:include_guard.cc@21@macro@FOO",
"short_name": "FOO",
"detailed_name": "FOO",
"hover": "#define FOO",
"definition_spelling": "2:9-2:12",
"definition_extent": "2:9-2:12",
"cls": 2,
"uses": ["2:9-2:12"]
}]
}
*/

View File

@ -1,25 +0,0 @@
#ifdef FOOBAR
void hello();
#endif
#if false
#endif
#if defined(OS_FOO)
#endif
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": ["2:1-4:7", "6:1-10:7", "12:1-14:7"],
"types": [],
"funcs": [],
"vars": []
}
*/

View File

@ -1,67 +0,0 @@
template<class T>
class Template {};
struct Foo {
void Bar(Template<double>&);
};
void Foo::Bar(Template<double>&) {}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@ST>1#T@Template",
"short_name": "Template",
"detailed_name": "Template",
"definition_spelling": "2:7-2:15",
"definition_extent": "2:1-2:18",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["2:7-2:15", "5:12-5:20", "8:15-8:23"]
}, {
"id": 1,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "4:8-4:11",
"definition_extent": "4:1-6:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["4:8-4:11", "8:6-8:9"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@Bar#&$@S@Template>#d#",
"short_name": "Bar",
"detailed_name": "void Foo::Bar(Template<double> &)",
"declarations": [{
"spelling": "5:8-5:11",
"extent": "5:3-5:30",
"content": "void Bar(Template<double>&)",
"param_spellings": ["5:29-5:29"]
}],
"definition_spelling": "8:11-8:14",
"definition_extent": "8:1-8:36",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,84 +0,0 @@
namespace ns {
enum VarType {};
template<typename _>
struct Holder {
static constexpr VarType static_var = (VarType)0x0;
};
template<typename _>
const typename VarType Holder<_>::static_var;
int Foo = Holder<int>::static_var;
int Foo2 = Holder<int>::static_var;
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@N@ns@E@VarType",
"short_name": "VarType",
"detailed_name": "ns::VarType",
"definition_spelling": "2:8-2:15",
"definition_extent": "2:3-2:18",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["2:8-2:15", "6:22-6:29", "6:44-6:51", "10:18-10:25"]
}, {
"id": 1,
"usr": "c:@N@ns@ST>1#T@Holder",
"short_name": "Holder",
"detailed_name": "ns::Holder",
"definition_spelling": "5:10-5:16",
"definition_extent": "5:3-7:4",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0],
"instances": [],
"uses": ["5:10-5:16", "10:26-10:32", "13:13-13:19", "14:14-14:20"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@N@ns@ST>1#T@Holder@static_var",
"short_name": "static_var",
"detailed_name": "const ns::VarType ns::Holder::static_var",
"declaration": "6:30-6:40",
"definition_spelling": "10:37-10:47",
"definition_extent": "9:3-10:47",
"variable_type": 0,
"declaring_type": 1,
"cls": 4,
"uses": ["6:30-6:40", "10:37-10:47", "13:26-13:36", "14:27-14:37"]
}, {
"id": 1,
"usr": "c:@N@ns@Foo",
"short_name": "Foo",
"detailed_name": "int ns::Foo",
"definition_spelling": "13:7-13:10",
"definition_extent": "13:3-13:36",
"cls": 3,
"uses": ["13:7-13:10"]
}, {
"id": 2,
"usr": "c:@N@ns@Foo2",
"short_name": "Foo2",
"detailed_name": "int ns::Foo2",
"definition_spelling": "14:7-14:11",
"definition_extent": "14:3-14:37",
"cls": 3,
"uses": ["14:7-14:11"]
}]
}
*/

View File

@ -1,70 +0,0 @@
namespace ns {
template<typename T>
struct Foo {
template<typename R>
static int foo() {
return 3;
}
};
int a = Foo<int>::foo<float>();
int b = Foo<bool>::foo<double>();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@N@ns@ST>1#T@Foo",
"short_name": "Foo",
"detailed_name": "ns::Foo",
"definition_spelling": "3:10-3:13",
"definition_extent": "3:3-8:4",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["3:10-3:13", "10:11-10:14", "11:11-11:14"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@N@ns@ST>1#T@Foo@FT@>1#Tfoo#I#S",
"short_name": "foo",
"detailed_name": "int ns::Foo::foo()",
"declarations": [],
"definition_spelling": "5:16-5:19",
"definition_extent": "5:5-7:6",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["-1@10:21-10:24", "-1@11:22-11:25"],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@N@ns@a",
"short_name": "a",
"detailed_name": "int ns::a",
"definition_spelling": "10:7-10:8",
"definition_extent": "10:3-10:33",
"cls": 3,
"uses": ["10:7-10:8"]
}, {
"id": 1,
"usr": "c:@N@ns@b",
"short_name": "b",
"detailed_name": "int ns::b",
"definition_spelling": "11:7-11:8",
"definition_extent": "11:3-11:35",
"cls": 3,
"uses": ["11:7-11:8"]
}]
}
*/

View File

@ -1,52 +0,0 @@
namespace ns {
template<typename T>
class Foo {};
Foo<int> a;
Foo<bool> b;
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@N@ns@ST>1#T@Foo",
"short_name": "Foo",
"detailed_name": "ns::Foo",
"definition_spelling": "3:9-3:12",
"definition_extent": "3:3-3:15",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0, 1],
"uses": ["3:9-3:12", "5:3-5:6", "6:3-6:6"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@N@ns@a",
"short_name": "a",
"detailed_name": "Foo<int> ns::a",
"definition_spelling": "5:12-5:13",
"definition_extent": "5:3-5:13",
"variable_type": 0,
"cls": 3,
"uses": ["5:12-5:13"]
}, {
"id": 1,
"usr": "c:@N@ns@b",
"short_name": "b",
"detailed_name": "Foo<bool> ns::b",
"definition_spelling": "6:13-6:14",
"definition_extent": "6:3-6:14",
"variable_type": 0,
"cls": 3,
"uses": ["6:13-6:14"]
}]
}
*/

View File

@ -1,68 +0,0 @@
template<class T>
class Template {
void Foo();
};
template<class T>
void Template<T>::Foo() {}
template<>
void Template<void>::Foo() {}
/*
// TODO: usage information on Template is bad.
// TODO: Foo() should have multiple definitions.
EXTRA_FLAGS:
-fms-compatibility
-fdelayed-template-parsing
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@ST>1#T@Template",
"short_name": "Template",
"detailed_name": "Template",
"definition_spelling": "2:7-2:15",
"definition_extent": "2:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["2:7-2:15", "7:6-7:14", "10:6-10:14"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@ST>1#T@Template@F@Foo#",
"short_name": "Foo",
"detailed_name": "void Template::Foo()",
"declarations": [{
"spelling": "3:8-3:11",
"extent": "3:3-3:13",
"content": "void Foo()",
"param_spellings": []
}, {
"spelling": "10:22-10:25",
"extent": "9:1-10:30",
"content": "template<>\n void Template<void>::Foo() {}",
"param_spellings": []
}],
"definition_spelling": "7:19-7:22",
"definition_extent": "6:1-7:24",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,67 +0,0 @@
template<typename T>
struct Foo {
static int foo() {
return 3;
}
};
int a = Foo<int>::foo();
int b = Foo<bool>::foo();
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "2:8-2:11",
"definition_extent": "2:1-6:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["2:8-2:11", "8:9-8:12", "9:9-9:12"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@ST>1#T@Foo@F@foo#S",
"short_name": "foo",
"detailed_name": "int Foo::foo()",
"declarations": [],
"definition_spelling": "3:14-3:17",
"definition_extent": "3:3-5:4",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["-1@8:19-8:22", "-1@9:20-9:23"],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"detailed_name": "int a",
"definition_spelling": "8:5-8:6",
"definition_extent": "8:1-8:24",
"cls": 3,
"uses": ["8:5-8:6"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"detailed_name": "int b",
"definition_spelling": "9:5-9:6",
"definition_extent": "9:1-9:25",
"cls": 3,
"uses": ["9:5-9:6"]
}]
}
*/

View File

@ -1,68 +0,0 @@
template<typename T>
struct Foo {
template<typename R>
static int foo() {
return 3;
}
};
int a = Foo<int>::foo<float>();
int b = Foo<bool>::foo<double>();
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "2:8-2:11",
"definition_extent": "2:1-7:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["2:8-2:11", "9:9-9:12", "10:9-10:12"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@ST>1#T@Foo@FT@>1#Tfoo#I#S",
"short_name": "foo",
"detailed_name": "int Foo::foo()",
"declarations": [],
"definition_spelling": "4:14-4:17",
"definition_extent": "4:3-6:4",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["-1@9:19-9:22", "-1@10:20-10:23"],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"detailed_name": "int a",
"definition_spelling": "9:5-9:6",
"definition_extent": "9:1-9:31",
"cls": 3,
"uses": ["9:5-9:6"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"detailed_name": "int b",
"definition_spelling": "10:5-10:6",
"definition_extent": "10:1-10:33",
"cls": 3,
"uses": ["10:5-10:6"]
}]
}
*/

View File

@ -1,115 +0,0 @@
enum A {};
enum B {};
template<typename T>
struct Foo {
struct Inner {};
};
Foo<A>::Inner a;
Foo<B>::Inner b;
#if false
EnumDecl A
EnumDecl B
ClassTemplate Foo
TemplateTypeParameter T
StructDecl Inner
VarDecl a
TemplateRef Foo
TypeRef enum A
TypeRef struct Foo<enum A>::Inner
CallExpr Inner
VarDecl b
TemplateRef Foo
TypeRef enum B
TypeRef struct Foo<enum B>::Inner
CallExpr Inner
#endif
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": ["12:1-28:7"],
"types": [{
"id": 0,
"usr": "c:@E@A",
"short_name": "A",
"detailed_name": "A",
"definition_spelling": "1:6-1:7",
"definition_extent": "1:1-1:10",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:6-1:7", "9:5-9:6"]
}, {
"id": 1,
"usr": "c:@E@B",
"short_name": "B",
"detailed_name": "B",
"definition_spelling": "2:6-2:7",
"definition_extent": "2:1-2:10",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["2:6-2:7", "10:5-10:6"]
}, {
"id": 2,
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "5:8-5:11",
"definition_extent": "5:1-7:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["5:8-5:11", "9:1-9:4", "10:1-10:4"]
}, {
"id": 3,
"usr": "c:@ST>1#T@Foo@S@Inner",
"short_name": "Inner",
"detailed_name": "Foo::Inner",
"definition_spelling": "6:10-6:15",
"definition_extent": "6:3-6:18",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0, 1],
"uses": ["6:10-6:15", "9:9-9:14", "10:9-10:14"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"detailed_name": "Foo<A>::Inner a",
"definition_spelling": "9:15-9:16",
"definition_extent": "9:1-9:16",
"variable_type": 3,
"cls": 3,
"uses": ["9:15-9:16"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"detailed_name": "Foo<B>::Inner b",
"definition_spelling": "10:15-10:16",
"definition_extent": "10:1-10:16",
"variable_type": 3,
"cls": 3,
"uses": ["10:15-10:16"]
}]
}
*/

View File

@ -1,58 +0,0 @@
template<typename T>
struct Foo {
static constexpr int var = 3;
};
int a = Foo<int>::var;
int b = Foo<bool>::var;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "2:8-2:11",
"definition_extent": "2:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["2:8-2:11", "6:9-6:12", "7:9-7:12"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@ST>1#T@Foo@var",
"short_name": "var",
"detailed_name": "const int Foo::var",
"declaration": "3:24-3:27",
"cls": 4,
"uses": ["3:24-3:27", "6:19-6:22", "7:20-7:23"]
}, {
"id": 1,
"usr": "c:@a",
"short_name": "a",
"detailed_name": "int a",
"definition_spelling": "6:5-6:6",
"definition_extent": "6:1-6:22",
"cls": 3,
"uses": ["6:5-6:6"]
}, {
"id": 2,
"usr": "c:@b",
"short_name": "b",
"detailed_name": "int b",
"definition_spelling": "7:5-7:6",
"definition_extent": "7:1-7:23",
"cls": 3,
"uses": ["7:5-7:6"]
}]
}
*/

View File

@ -1,53 +0,0 @@
template<typename T>
static int foo() {
return 3;
}
int a = foo<int>();
int b = foo<bool>();
// TODO: put template foo inside a namespace
// TODO: put template foo inside a template class inside a namespace
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:template_func_usage_folded_into_one.cc@FT@>1#Tfoo#I#",
"short_name": "foo",
"detailed_name": "int foo()",
"declarations": [],
"definition_spelling": "2:12-2:15",
"definition_extent": "2:1-4:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["-1@6:9-6:12", "-1@7:9-7:12"],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"detailed_name": "int a",
"definition_spelling": "6:5-6:6",
"definition_extent": "6:1-6:19",
"cls": 3,
"uses": ["6:5-6:6"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"detailed_name": "int b",
"definition_spelling": "7:5-7:6",
"definition_extent": "7:1-7:20",
"cls": 3,
"uses": ["7:5-7:6"]
}]
}
*/

View File

@ -1,50 +0,0 @@
template<typename T>
class Foo {};
Foo<int> a;
Foo<bool> b;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "2:7-2:10",
"definition_extent": "2:1-2:13",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0, 1],
"uses": ["2:7-2:10", "4:1-4:4", "5:1-5:4"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"detailed_name": "Foo<int> a",
"definition_spelling": "4:10-4:11",
"definition_extent": "4:1-4:11",
"variable_type": 0,
"cls": 3,
"uses": ["4:10-4:11"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"detailed_name": "Foo<bool> b",
"definition_spelling": "5:11-5:12",
"definition_extent": "5:1-5:12",
"variable_type": 0,
"cls": 3,
"uses": ["5:11-5:12"]
}]
}
*/

View File

@ -1,111 +0,0 @@
enum A {};
enum B {};
template<typename T>
T var = T();
A a = var<A>;
B b = var<B>;
// NOTE: libclang before 4.0 doesn't expose template usage on |var|.
#if false
EnumDecl A
EnumDecl B
UnexposedDecl var
VarDecl a
UnexposedExpr var
UnexposedExpr var
DeclRefExpr var
TypeRef enum A
UnexposedDecl var
VarDecl b
UnexposedExpr var
UnexposedExpr var
DeclRefExpr var
TypeRef enum B
UnexposedDecl var
#endif
/*
EXTRA_FLAGS:
-std=c++14
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": ["12:1-28:7"],
"types": [{
"id": 0,
"usr": "c:@E@A",
"short_name": "A",
"detailed_name": "A",
"definition_spelling": "1:6-1:7",
"definition_extent": "1:1-1:10",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [1],
"uses": ["1:6-1:7", "7:1-7:2", "7:11-7:12"]
}, {
"id": 1,
"usr": "c:@E@B",
"short_name": "B",
"detailed_name": "B",
"definition_spelling": "2:6-2:7",
"definition_extent": "2:1-2:10",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [2],
"uses": ["2:6-2:7", "8:1-8:2", "8:11-8:12"]
}, {
"id": 2,
"usr": "c:template_var_usage_folded_into_one.cc@35",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["5:1-5:2", "5:9-5:10"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@VT>1#T@var",
"short_name": "var",
"detailed_name": "T var",
"definition_spelling": "5:3-5:6",
"definition_extent": "5:1-5:12",
"cls": 3,
"uses": ["5:3-5:6", "7:7-7:10", "8:7-8:10"]
}, {
"id": 1,
"usr": "c:@a",
"short_name": "a",
"detailed_name": "A a",
"definition_spelling": "7:3-7:4",
"definition_extent": "7:1-7:13",
"variable_type": 0,
"cls": 3,
"uses": ["7:3-7:4"]
}, {
"id": 2,
"usr": "c:@b",
"short_name": "b",
"detailed_name": "B b",
"definition_spelling": "8:3-8:4",
"definition_extent": "8:1-8:13",
"variable_type": 1,
"cls": 3,
"uses": ["8:3-8:4"]
}]
}
*/

View File

@ -1,83 +0,0 @@
union vector3 {
struct { float x, y, z; };
float v[3];
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@U@vector3",
"short_name": "vector3",
"detailed_name": "vector3",
"definition_spelling": "1:7-1:14",
"definition_extent": "1:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [3],
"instances": [],
"uses": ["1:7-1:14"]
}, {
"id": 1,
"usr": "c:@U@vector3@Sa",
"short_name": "<anonymous>",
"detailed_name": "vector3::<anonymous>",
"definition_spelling": "2:3-2:9",
"definition_extent": "2:3-2:28",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1, 2],
"instances": [],
"uses": ["2:3-2:9"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@U@vector3@Sa@FI@x",
"short_name": "x",
"detailed_name": "float vector3::(anon struct)::x",
"definition_spelling": "2:18-2:19",
"definition_extent": "2:12-2:19",
"declaring_type": 1,
"cls": 4,
"uses": ["2:18-2:19"]
}, {
"id": 1,
"usr": "c:@U@vector3@Sa@FI@y",
"short_name": "y",
"detailed_name": "float vector3::(anon struct)::y",
"definition_spelling": "2:21-2:22",
"definition_extent": "2:12-2:22",
"declaring_type": 1,
"cls": 4,
"uses": ["2:21-2:22"]
}, {
"id": 2,
"usr": "c:@U@vector3@Sa@FI@z",
"short_name": "z",
"detailed_name": "float vector3::(anon struct)::z",
"definition_spelling": "2:24-2:25",
"definition_extent": "2:12-2:25",
"declaring_type": 1,
"cls": 4,
"uses": ["2:24-2:25"]
}, {
"id": 3,
"usr": "c:@U@vector3@FI@v",
"short_name": "v",
"detailed_name": "float [3] vector3::v",
"definition_spelling": "3:9-3:10",
"definition_extent": "3:3-3:13",
"declaring_type": 0,
"cls": 4,
"uses": ["3:9-3:10"]
}]
}
*/

View File

@ -1,45 +0,0 @@
typedef int (func)(const int *a, const int *b);
static func g;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:typedefs.cc@T@func",
"short_name": "func",
"detailed_name": "func",
"hover": "typedef int (func)(const int *a, const int *b)",
"definition_spelling": "1:14-1:18",
"definition_extent": "1:1-1:47",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:14-1:18", "2:8-2:12"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:typedefs.cc@F@g#*1I#S0_#",
"short_name": "g",
"detailed_name": "func g",
"declarations": [{
"spelling": "2:13-2:14",
"extent": "2:1-2:14",
"content": "static func g",
"param_spellings": ["2:13-2:13", "2:13-2:13"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,49 +0,0 @@
union Foo {
int a;
bool b;
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@U@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1],
"instances": [],
"uses": ["1:7-1:10"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@U@Foo@FI@a",
"short_name": "a",
"detailed_name": "int Foo::a",
"definition_spelling": "2:7-2:8",
"definition_extent": "2:3-2:8",
"declaring_type": 0,
"cls": 4,
"uses": ["2:7-2:8"]
}, {
"id": 1,
"usr": "c:@U@Foo@FI@b",
"short_name": "b",
"detailed_name": "bool Foo::b",
"definition_spelling": "3:8-3:9",
"definition_extent": "3:3-3:9",
"declaring_type": 0,
"cls": 4,
"uses": ["3:8-3:9"]
}]
}
*/

View File

@ -1,81 +0,0 @@
union Foo {
int a : 5;
bool b : 3;
};
Foo f;
void act(Foo*) {
f.a = 3;
}
/*
// TODO: instantiations on Foo should include parameter?
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@U@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:7-1:10",
"definition_extent": "1:1-4:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1],
"instances": [2],
"uses": ["1:7-1:10", "6:1-6:4", "8:10-8:13"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@act#*$@U@Foo#",
"short_name": "act",
"detailed_name": "void act(Foo *)",
"declarations": [],
"definition_spelling": "8:6-8:9",
"definition_extent": "8:1-10:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@U@Foo@FI@a",
"short_name": "a",
"detailed_name": "int Foo::a",
"definition_spelling": "2:7-2:8",
"definition_extent": "2:3-2:12",
"declaring_type": 0,
"cls": 4,
"uses": ["2:7-2:8", "9:5-9:6"]
}, {
"id": 1,
"usr": "c:@U@Foo@FI@b",
"short_name": "b",
"detailed_name": "bool Foo::b",
"definition_spelling": "3:8-3:9",
"definition_extent": "3:3-3:13",
"declaring_type": 0,
"cls": 4,
"uses": ["3:8-3:9"]
}, {
"id": 2,
"usr": "c:@f",
"short_name": "f",
"detailed_name": "Foo f",
"definition_spelling": "6:5-6:6",
"definition_extent": "6:1-6:6",
"variable_type": 0,
"cls": 3,
"uses": ["6:5-6:6", "9:3-9:4"]
}]
}
*/

View File

@ -1,68 +0,0 @@
void called() {}
struct Foo {
Foo();
};
Foo::Foo() {
called();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "3:8-3:11",
"definition_extent": "3:1-5:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [1],
"vars": [],
"instances": [],
"uses": ["3:8-3:11", "4:3-4:6", "7:6-7:9", "7:1-7:4"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@called#",
"short_name": "called",
"detailed_name": "void called()",
"declarations": [],
"definition_spelling": "1:6-1:12",
"definition_extent": "1:1-1:17",
"base": [],
"derived": [],
"locals": [],
"callers": ["1@8:3-8:9"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@S@Foo@F@Foo#",
"short_name": "Foo",
"detailed_name": "void Foo::Foo()",
"declarations": [{
"spelling": "4:3-4:6",
"extent": "4:3-4:8",
"content": "Foo()",
"param_spellings": []
}],
"definition_spelling": "7:6-7:9",
"definition_extent": "7:1-9:2",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@8:3-8:9"]
}],
"vars": []
}
*/

View File

@ -1,59 +0,0 @@
#define MACRO_CALL(e) e
bool called(bool a, bool b);
void caller() {
MACRO_CALL(called(true, true));
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@called#b#b#",
"short_name": "called",
"detailed_name": "bool called(bool a, bool b)",
"declarations": [{
"spelling": "3:6-3:12",
"extent": "3:1-3:28",
"content": "bool called(bool a, bool b)",
"param_spellings": ["3:18-3:19", "3:26-3:27"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["1@6:14-6:20"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@caller#",
"short_name": "caller",
"detailed_name": "void caller()",
"declarations": [],
"definition_spelling": "5:6-5:12",
"definition_extent": "5:1-7:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@6:14-6:20"]
}],
"vars": [{
"id": 0,
"usr": "c:func_called_from_macro_argument.cc@8@macro@MACRO_CALL",
"short_name": "MACRO_CALL",
"detailed_name": "MACRO_CALL",
"hover": "#define MACRO_CALL(e) e",
"definition_spelling": "1:9-1:19",
"definition_extent": "1:9-1:24",
"cls": 2,
"uses": ["1:9-1:19", "6:3-6:13"]
}]
}
*/

View File

@ -1,68 +0,0 @@
void called();
template <typename T>
void caller() {
called();
}
void foo() {
caller<int>();
}
/*
// NOTE: without caller<int>() instantation caller() is never visited so
// called() is never referenced.
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@called#",
"short_name": "called",
"detailed_name": "void called()",
"declarations": [{
"spelling": "1:6-1:12",
"extent": "1:1-1:14",
"content": "void called()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["1@5:3-5:9"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@FT@>1#Tcaller#v#",
"short_name": "caller",
"detailed_name": "void caller()",
"declarations": [],
"definition_spelling": "4:6-4:12",
"definition_extent": "4:1-6:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@9:3-9:9"],
"callees": ["0@5:3-5:9"]
}, {
"id": 2,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"declarations": [],
"definition_spelling": "8:6-8:9",
"definition_extent": "8:1-10:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["1@9:3-9:9"]
}],
"vars": []
}
*/

View File

@ -1,80 +0,0 @@
struct Wrapper {
Wrapper(int i);
};
int called() { return 1; }
Wrapper caller() {
return called();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Wrapper",
"short_name": "Wrapper",
"detailed_name": "Wrapper",
"definition_spelling": "1:8-1:15",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["1:8-1:15", "2:3-2:10", "7:1-7:8"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Wrapper@F@Wrapper#I#",
"short_name": "Wrapper",
"detailed_name": "void Wrapper::Wrapper(int i)",
"declarations": [{
"spelling": "2:3-2:10",
"extent": "2:3-2:17",
"content": "Wrapper(int i)",
"param_spellings": ["2:15-2:16"]
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["~2@8:10-8:16"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@called#",
"short_name": "called",
"detailed_name": "int called()",
"declarations": [],
"definition_spelling": "5:5-5:11",
"definition_extent": "5:1-5:27",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@8:10-8:16"],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:@F@caller#",
"short_name": "caller",
"detailed_name": "Wrapper caller()",
"declarations": [],
"definition_spelling": "7:9-7:15",
"definition_extent": "7:1-9:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["~0@8:10-8:16", "1@8:10-8:16"]
}],
"vars": []
}
*/

View File

@ -1,70 +0,0 @@
void consume(void (*)()) {}
void used() {}
void user() {
void (*x)() = &used;
consume(&used);
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@consume#*Fv#",
"short_name": "consume",
"detailed_name": "void consume(void (*)())",
"declarations": [],
"definition_spelling": "1:6-1:13",
"definition_extent": "1:1-1:28",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@7:3-7:10"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@used#",
"short_name": "used",
"detailed_name": "void used()",
"declarations": [],
"definition_spelling": "3:6-3:10",
"definition_extent": "3:1-3:15",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@6:18-6:22", "2@7:12-7:16"],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:@F@user#",
"short_name": "user",
"detailed_name": "void user()",
"declarations": [],
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["1@6:18-6:22", "0@7:3-7:10", "1@7:12-7:16"]
}],
"vars": [{
"id": 0,
"usr": "c:func_usage_addr_func.cc@66@F@user#@x",
"short_name": "x",
"detailed_name": "void (*)() x",
"definition_spelling": "6:10-6:11",
"definition_extent": "6:3-6:22",
"cls": 1,
"uses": ["6:10-6:11"]
}]
}
*/

View File

@ -1,74 +0,0 @@
struct Foo {
void Used();
};
void user() {
auto x = &Foo::Used;
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:8-1:11",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [],
"uses": ["1:8-1:11", "6:13-6:16"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@Used#",
"short_name": "Used",
"detailed_name": "void Foo::Used()",
"declarations": [{
"spelling": "2:8-2:12",
"extent": "2:3-2:14",
"content": "void Used()",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["1@6:18-6:22"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@user#",
"short_name": "user",
"detailed_name": "void user()",
"declarations": [],
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-7:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@6:18-6:22"]
}],
"vars": [{
"id": 0,
"usr": "c:func_usage_addr_method.cc@53@F@user#@x",
"short_name": "x",
"detailed_name": "void (Foo::*)() x",
"definition_spelling": "6:8-6:9",
"definition_extent": "6:3-6:22",
"cls": 1,
"uses": ["6:8-6:9"]
}]
}
*/

View File

@ -1,43 +0,0 @@
void called() {}
void caller() {
called();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@called#",
"short_name": "called",
"detailed_name": "void called()",
"declarations": [],
"definition_spelling": "1:6-1:12",
"definition_extent": "1:1-1:17",
"base": [],
"derived": [],
"locals": [],
"callers": ["1@3:3-3:9"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@caller#",
"short_name": "caller",
"detailed_name": "void caller()",
"declarations": [],
"definition_spelling": "2:6-2:12",
"definition_extent": "2:1-4:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@3:3-3:9"]
}],
"vars": []
}
*/

View File

@ -1,75 +0,0 @@
struct Foo {
void Used();
};
void user() {
Foo* f = nullptr;
f->Used();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:8-1:11",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [0],
"uses": ["1:8-1:11", "6:3-6:6"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@Used#",
"short_name": "Used",
"detailed_name": "void Foo::Used()",
"declarations": [{
"spelling": "2:8-2:12",
"extent": "2:3-2:14",
"content": "void Used()",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["1@7:6-7:10"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@user#",
"short_name": "user",
"detailed_name": "void user()",
"declarations": [],
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@7:6-7:10"]
}],
"vars": [{
"id": 0,
"usr": "c:func_usage_call_method.cc@53@F@user#@f",
"short_name": "f",
"detailed_name": "Foo * f",
"definition_spelling": "6:8-6:9",
"definition_extent": "6:3-6:19",
"variable_type": 0,
"cls": 1,
"uses": ["6:8-6:9", "7:3-7:4"]
}]
}
*/

View File

@ -1,56 +0,0 @@
static int helper() {
return 5;
}
class Foo {
int x = helper();
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "5:7-5:10",
"definition_extent": "5:1-7:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0],
"instances": [],
"uses": ["5:7-5:10"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:func_usage_class_inline_var_def.cc@F@helper#",
"short_name": "helper",
"detailed_name": "int helper()",
"declarations": [],
"definition_spelling": "1:12-1:18",
"definition_extent": "1:1-3:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["-1@6:11-6:17"],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@FI@x",
"short_name": "x",
"detailed_name": "int Foo::x",
"definition_spelling": "6:7-6:8",
"definition_extent": "6:3-6:19",
"declaring_type": 0,
"cls": 4,
"uses": ["6:7-6:8"]
}]
}
*/

View File

@ -1,46 +0,0 @@
void foo();
void usage() {
foo();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"declarations": [{
"spelling": "1:6-1:9",
"extent": "1:1-1:11",
"content": "void foo()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["1@4:3-4:6"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@usage#",
"short_name": "usage",
"detailed_name": "void usage()",
"declarations": [],
"definition_spelling": "3:6-3:11",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@4:3-4:6"]
}],
"vars": []
}
*/

View File

@ -1,74 +0,0 @@
struct Foo {
void foo();
};
void usage() {
Foo* f = nullptr;
f->foo();
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "1:8-1:11",
"definition_extent": "1:1-3:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [0],
"vars": [],
"instances": [0],
"uses": ["1:8-1:11", "6:3-6:6"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@S@Foo@F@foo#",
"short_name": "foo",
"detailed_name": "void Foo::foo()",
"declarations": [{
"spelling": "2:8-2:11",
"extent": "2:3-2:13",
"content": "void foo()",
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["1@7:6-7:9"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@usage#",
"short_name": "usage",
"detailed_name": "void usage()",
"declarations": [],
"definition_spelling": "5:6-5:11",
"definition_extent": "5:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@7:6-7:9"]
}],
"vars": [{
"id": 0,
"usr": "c:func_usage_forward_decl_method.cc@53@F@usage#@f",
"short_name": "f",
"detailed_name": "Foo * f",
"definition_spelling": "6:8-6:9",
"definition_extent": "6:3-6:19",
"variable_type": 0,
"cls": 1,
"uses": ["6:8-6:9", "7:3-7:4"]
}]
}
*/

View File

@ -1,63 +0,0 @@
template<typename T>
void accept(T);
void foo() {
accept(1);
accept(true);
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:func_usage_template_func.cc@9",
"short_name": "T",
"detailed_name": "T",
"definition_spelling": "1:19-1:20",
"definition_extent": "1:10-1:20",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["2:13-2:14"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@FT@>1#Taccept#t0.0#v#",
"short_name": "accept",
"detailed_name": "void accept(T)",
"declarations": [{
"spelling": "2:6-2:12",
"extent": "2:1-2:15",
"content": "void accept(T)",
"param_spellings": ["2:14-2:14"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["1@5:3-5:9", "1@6:3-6:9"],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "void foo()",
"declarations": [],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-7:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": ["0@5:3-5:9", "0@6:3-6:9"]
}],
"vars": []
}
*/

View File

@ -1,94 +0,0 @@
template<typename T>
class unique_ptr {};
struct S {};
static unique_ptr<bool> f0;
static unique_ptr<S> f1;
unique_ptr<S>* return_type() {
unique_ptr<S>* local;
return nullptr;
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@ST>1#T@unique_ptr",
"short_name": "unique_ptr",
"detailed_name": "unique_ptr",
"definition_spelling": "2:7-2:17",
"definition_extent": "2:1-2:20",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0, 1, 2],
"uses": ["2:7-2:17", "6:8-6:18", "7:8-7:18", "9:1-9:11", "10:3-10:13"]
}, {
"id": 1,
"usr": "c:@S@S",
"short_name": "S",
"detailed_name": "S",
"definition_spelling": "4:8-4:9",
"definition_extent": "4:1-4:12",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["4:8-4:9", "7:19-7:20", "9:12-9:13", "10:14-10:15"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@return_type#",
"short_name": "return_type",
"detailed_name": "unique_ptr<S> *return_type()",
"declarations": [],
"definition_spelling": "9:16-9:27",
"definition_extent": "9:1-12:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_as_template_parameter.cc@f0",
"short_name": "f0",
"detailed_name": "unique_ptr<bool> f0",
"definition_spelling": "6:25-6:27",
"definition_extent": "6:1-6:27",
"variable_type": 0,
"cls": 3,
"uses": ["6:25-6:27"]
}, {
"id": 1,
"usr": "c:type_usage_as_template_parameter.cc@f1",
"short_name": "f1",
"detailed_name": "unique_ptr<S> f1",
"definition_spelling": "7:22-7:24",
"definition_extent": "7:1-7:24",
"variable_type": 0,
"cls": 3,
"uses": ["7:22-7:24"]
}, {
"id": 2,
"usr": "c:type_usage_as_template_parameter.cc@153@F@return_type#@local",
"short_name": "local",
"detailed_name": "unique_ptr<S> * local",
"definition_spelling": "10:18-10:23",
"definition_extent": "10:3-10:23",
"variable_type": 0,
"cls": 1,
"uses": ["10:18-10:23"]
}]
}
*/

View File

@ -1,221 +0,0 @@
template<typename T, typename B>
class unique_ptr;
struct S1;
struct S2;
#if false
VarDecl f
TemplateRef unique_ptr
TemplateRef unique_ptr
TypeRef struct S1
TypeRef struct S2
TypeRef struct S2
#endif
extern unique_ptr<unique_ptr<S1, S2>, S2> f;
#if false
FunctionDecl as_return_type
TemplateRef unique_ptr
TemplateRef unique_ptr
TypeRef struct S1
TypeRef struct S2
TypeRef struct S2
ParmDecl
TemplateRef unique_ptr
TypeRef struct S1
TypeRef struct S2
CompoundStmt
ReturnStmt
UnexposedExpr
CXXNullPtrLiteralExpr
#endif
unique_ptr<unique_ptr<S1, S2>, S2>* as_return_type(unique_ptr<S1, S2>*) { return nullptr; }
#if false
FunctionDecl no_return_type
ParmDecl
CompoundStmt
#endif
void no_return_type(int) {}
#if false
FunctionDecl empty
CompoundStmt
DeclStmt
VarDecl local
TemplateRef unique_ptr
TemplateRef unique_ptr
TypeRef struct S1
TypeRef struct S2
TypeRef struct S2
#endif
void empty() {
unique_ptr<unique_ptr<S1, S2>, S2>* local;
}
#if false
ClassDecl Foo
CXXMethod foo
TemplateRef unique_ptr
TypeRef struct S1
TypeRef struct S2
#endif
class Foo {
unique_ptr<S1, S2>* foo();
};
#if false
CXXMethod foo
TemplateRef unique_ptr
TypeRef struct S1
TypeRef struct S2
TypeRef class Foo
CompoundStmt
ReturnStmt
UnexposedExpr
CXXNullPtrLiteralExpr
#endif
unique_ptr<S1, S2>* Foo::foo() { return nullptr; }
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": ["7:1-14:7", "17:1-32:7", "35:1-39:7", "42:1-52:7", "57:1-63:7", "68:1-78:7"],
"types": [{
"id": 0,
"usr": "c:@ST>2#T#T@unique_ptr",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0, 1],
"uses": ["2:7-2:17", "15:8-15:18", "15:19-15:29", "33:1-33:11", "33:12-33:22", "33:52-33:62", "54:3-54:13", "54:14-54:24", "65:3-65:13", "79:1-79:11"]
}, {
"id": 1,
"usr": "c:@S@S1",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["4:8-4:10", "15:30-15:32", "33:23-33:25", "33:63-33:65", "54:25-54:27", "65:14-65:16", "79:12-79:14"]
}, {
"id": 2,
"usr": "c:@S@S2",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["5:8-5:10", "15:34-15:36", "15:39-15:41", "33:27-33:29", "33:32-33:34", "33:67-33:69", "54:29-54:31", "54:34-54:36", "65:18-65:20", "79:16-79:18"]
}, {
"id": 3,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "64:7-64:10",
"definition_extent": "64:1-66:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [3],
"vars": [],
"instances": [],
"uses": ["64:7-64:10", "79:21-79:24"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@as_return_type#*$@S@unique_ptr>#$@S@S1#$@S@S2#",
"short_name": "as_return_type",
"detailed_name": "unique_ptr<unique_ptr<S1, S2>, S2> *as_return_type(unique_ptr<S1, S2> *)",
"declarations": [],
"definition_spelling": "33:37-33:51",
"definition_extent": "33:1-33:92",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@F@no_return_type#I#",
"short_name": "no_return_type",
"detailed_name": "void no_return_type(int)",
"declarations": [],
"definition_spelling": "40:6-40:20",
"definition_extent": "40:1-40:28",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:@F@empty#",
"short_name": "empty",
"detailed_name": "void empty()",
"declarations": [],
"definition_spelling": "53:6-53:11",
"definition_extent": "53:1-55:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 3,
"is_operator": false,
"usr": "c:@S@Foo@F@foo#",
"short_name": "foo",
"detailed_name": "unique_ptr<S1, S2> *Foo::foo()",
"declarations": [{
"spelling": "65:23-65:26",
"extent": "65:3-65:28",
"content": "unique_ptr<S1, S2>* foo()",
"param_spellings": []
}],
"definition_spelling": "79:26-79:29",
"definition_extent": "79:1-79:51",
"declaring_type": 3,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:@f",
"short_name": "f",
"detailed_name": "unique_ptr<unique_ptr<S1, S2>, S2> f",
"declaration": "15:43-15:44",
"variable_type": 0,
"cls": 3,
"uses": ["15:43-15:44"]
}, {
"id": 1,
"usr": "c:type_usage_as_template_parameter_complex.cc@1062@F@empty#@local",
"short_name": "local",
"detailed_name": "unique_ptr<unique_ptr<S1, S2>, S2> * local",
"definition_spelling": "54:39-54:44",
"definition_extent": "54:3-54:44",
"variable_type": 0,
"cls": 1,
"uses": ["54:39-54:44"]
}]
}
*/

View File

@ -1,53 +0,0 @@
template<typename T>
class unique_ptr {};
struct S;
static unique_ptr<S> foo;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@ST>1#T@unique_ptr",
"short_name": "unique_ptr",
"detailed_name": "unique_ptr",
"definition_spelling": "2:7-2:17",
"definition_extent": "2:1-2:20",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["2:7-2:17", "6:8-6:18"]
}, {
"id": 1,
"usr": "c:@S@S",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["4:8-4:9", "6:19-6:20"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:type_usage_as_template_parameter_simple.cc@foo",
"short_name": "foo",
"detailed_name": "unique_ptr<S> foo",
"definition_spelling": "6:22-6:25",
"definition_extent": "6:1-6:25",
"variable_type": 0,
"cls": 3,
"uses": ["6:22-6:25"]
}]
}
*/

View File

@ -1,36 +0,0 @@
struct T {};
extern T t;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@T",
"short_name": "T",
"detailed_name": "T",
"definition_spelling": "1:8-1:9",
"definition_extent": "1:1-1:12",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["1:8-1:9", "3:8-3:9"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@t",
"short_name": "t",
"detailed_name": "T t",
"declaration": "3:10-3:11",
"variable_type": 0,
"cls": 3,
"uses": ["3:10-3:11"]
}]
}
*/

View File

@ -1,80 +0,0 @@
struct ForwardType;
struct ImplementedType {};
struct Foo {
ForwardType* a;
ImplementedType b;
};
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@ForwardType",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["1:8-1:19", "5:3-5:14"]
}, {
"id": 1,
"usr": "c:@S@ImplementedType",
"short_name": "ImplementedType",
"detailed_name": "ImplementedType",
"definition_spelling": "2:8-2:23",
"definition_extent": "2:1-2:26",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [1],
"uses": ["2:8-2:23", "6:3-6:18"]
}, {
"id": 2,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "4:8-4:11",
"definition_extent": "4:1-7:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [0, 1],
"instances": [],
"uses": ["4:8-4:11"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@FI@a",
"short_name": "a",
"detailed_name": "ForwardType * Foo::a",
"definition_spelling": "5:16-5:17",
"definition_extent": "5:3-5:17",
"variable_type": 0,
"declaring_type": 2,
"cls": 4,
"uses": ["5:16-5:17"]
}, {
"id": 1,
"usr": "c:@S@Foo@FI@b",
"short_name": "b",
"detailed_name": "ImplementedType Foo::b",
"definition_spelling": "6:19-6:20",
"definition_extent": "6:3-6:20",
"variable_type": 1,
"declaring_type": 2,
"cls": 4,
"uses": ["6:19-6:20"]
}]
}
*/

View File

@ -1,78 +0,0 @@
struct ForwardType;
struct ImplementedType {};
void Foo() {
ForwardType* a;
ImplementedType b;
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@ForwardType",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["1:8-1:19", "5:3-5:14"]
}, {
"id": 1,
"usr": "c:@S@ImplementedType",
"short_name": "ImplementedType",
"detailed_name": "ImplementedType",
"definition_spelling": "2:8-2:23",
"definition_extent": "2:1-2:26",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [1],
"uses": ["2:8-2:23", "6:3-6:18"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@Foo#",
"short_name": "Foo",
"detailed_name": "void Foo()",
"declarations": [],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-7:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_local.cc@67@F@Foo#@a",
"short_name": "a",
"detailed_name": "ForwardType * a",
"definition_spelling": "5:16-5:17",
"definition_extent": "5:3-5:17",
"variable_type": 0,
"cls": 1,
"uses": ["5:16-5:17"]
}, {
"id": 1,
"usr": "c:type_usage_declare_local.cc@86@F@Foo#@b",
"short_name": "b",
"detailed_name": "ImplementedType b",
"definition_spelling": "6:19-6:20",
"definition_extent": "6:3-6:20",
"variable_type": 1,
"cls": 1,
"uses": ["6:19-6:20"]
}]
}
*/

View File

@ -1,75 +0,0 @@
struct ForwardType;
struct ImplementedType {};
void foo(ForwardType* f, ImplementedType a) {}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@ForwardType",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["1:8-1:19", "4:10-4:21"]
}, {
"id": 1,
"usr": "c:@S@ImplementedType",
"short_name": "ImplementedType",
"detailed_name": "ImplementedType",
"definition_spelling": "2:8-2:23",
"definition_extent": "2:1-2:26",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [1],
"uses": ["2:8-2:23", "4:26-4:41"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#*$@S@ForwardType#$@S@ImplementedType#",
"short_name": "foo",
"detailed_name": "void foo(ForwardType *f, ImplementedType a)",
"declarations": [],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-4:47",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_param.cc@60@F@foo#*$@S@ForwardType#$@S@ImplementedType#@f",
"short_name": "f",
"detailed_name": "ForwardType * f",
"definition_spelling": "4:23-4:24",
"definition_extent": "4:10-4:24",
"variable_type": 0,
"cls": 1,
"uses": ["4:23-4:24"]
}, {
"id": 1,
"usr": "c:type_usage_declare_param.cc@76@F@foo#*$@S@ForwardType#$@S@ImplementedType#@a",
"short_name": "a",
"detailed_name": "ImplementedType a",
"definition_spelling": "4:42-4:43",
"definition_extent": "4:26-4:43",
"variable_type": 1,
"cls": 1,
"uses": ["4:42-4:43"]
}]
}
*/

View File

@ -1,61 +0,0 @@
struct Foo;
void foo(Foo* f, Foo*);
void foo(Foo* f, Foo*) {}
/*
// TODO: No interesting usage on prototype. But maybe that's ok!
// TODO: We should have the same variable declared for both prototype and
// declaration. So it should have a usage marker on both. Then we could
// rename parameters!
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["1:8-1:11", "3:10-3:13", "3:18-3:21", "4:10-4:13", "4:18-4:21"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#*$@S@Foo#S0_#",
"short_name": "foo",
"detailed_name": "void foo(Foo *f, Foo *)",
"declarations": [{
"spelling": "3:6-3:9",
"extent": "3:1-3:23",
"content": "void foo(Foo* f, Foo*)",
"param_spellings": ["3:15-3:16", "3:22-3:22"]
}],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-4:26",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_param_prototype.cc@49@F@foo#*$@S@Foo#S0_#@f",
"short_name": "f",
"detailed_name": "Foo * f",
"definition_spelling": "4:15-4:16",
"definition_extent": "4:10-4:16",
"variable_type": 0,
"cls": 1,
"uses": ["4:15-4:16"]
}]
}
*/

View File

@ -1,38 +0,0 @@
struct ForwardType;
void foo(ForwardType*) {}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@ForwardType",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:8-1:19", "2:10-2:21"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#*$@S@ForwardType#",
"short_name": "foo",
"detailed_name": "void foo(ForwardType *)",
"declarations": [],
"definition_spelling": "2:6-2:9",
"definition_extent": "2:1-2:26",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

View File

@ -1,106 +0,0 @@
struct Type {};
void foo(Type& a0, const Type& a1) {
Type a2;
Type* a3;
const Type* a4;
const Type* const a5 = nullptr;
}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Type",
"short_name": "Type",
"detailed_name": "Type",
"definition_spelling": "1:8-1:12",
"definition_extent": "1:1-1:15",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0, 1, 2, 3, 4, 5],
"uses": ["1:8-1:12", "3:10-3:14", "3:26-3:30", "4:3-4:7", "5:3-5:7", "6:9-6:13", "7:9-7:13"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#&$@S@Type#&1S1_#",
"short_name": "foo",
"detailed_name": "void foo(Type &a0, const Type &a1)",
"declarations": [],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_qualifiers.cc@28@F@foo#&$@S@Type#&1S1_#@a0",
"short_name": "a0",
"detailed_name": "Type & a0",
"definition_spelling": "3:16-3:18",
"definition_extent": "3:10-3:18",
"variable_type": 0,
"cls": 1,
"uses": ["3:16-3:18"]
}, {
"id": 1,
"usr": "c:type_usage_declare_qualifiers.cc@38@F@foo#&$@S@Type#&1S1_#@a1",
"short_name": "a1",
"detailed_name": "const Type & a1",
"definition_spelling": "3:32-3:34",
"definition_extent": "3:20-3:34",
"variable_type": 0,
"cls": 1,
"uses": ["3:32-3:34"]
}, {
"id": 2,
"usr": "c:type_usage_declare_qualifiers.cc@59@F@foo#&$@S@Type#&1S1_#@a2",
"short_name": "a2",
"detailed_name": "Type a2",
"definition_spelling": "4:8-4:10",
"definition_extent": "4:3-4:10",
"variable_type": 0,
"cls": 1,
"uses": ["4:8-4:10"]
}, {
"id": 3,
"usr": "c:type_usage_declare_qualifiers.cc@71@F@foo#&$@S@Type#&1S1_#@a3",
"short_name": "a3",
"detailed_name": "Type * a3",
"definition_spelling": "5:9-5:11",
"definition_extent": "5:3-5:11",
"variable_type": 0,
"cls": 1,
"uses": ["5:9-5:11"]
}, {
"id": 4,
"usr": "c:type_usage_declare_qualifiers.cc@84@F@foo#&$@S@Type#&1S1_#@a4",
"short_name": "a4",
"detailed_name": "const Type * a4",
"definition_spelling": "6:15-6:17",
"definition_extent": "6:3-6:17",
"variable_type": 0,
"cls": 1,
"uses": ["6:15-6:17"]
}, {
"id": 5,
"usr": "c:type_usage_declare_qualifiers.cc@103@F@foo#&$@S@Type#&1S1_#@a5",
"short_name": "a5",
"detailed_name": "const Type *const a5",
"definition_spelling": "7:21-7:23",
"definition_extent": "7:3-7:33",
"variable_type": 0,
"cls": 1,
"uses": ["7:21-7:23"]
}]
}
*/

View File

@ -1,36 +0,0 @@
struct Type {};
static Type t;
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Type",
"short_name": "Type",
"detailed_name": "Type",
"definition_spelling": "1:8-1:12",
"definition_extent": "1:1-1:15",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [0],
"uses": ["1:8-1:12", "2:8-2:12"]
}],
"funcs": [],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_static.cc@t",
"short_name": "t",
"detailed_name": "Type t",
"definition_spelling": "2:13-2:14",
"definition_extent": "2:1-2:14",
"variable_type": 0,
"cls": 3,
"uses": ["2:13-2:14"]
}]
}
*/

View File

@ -1,155 +0,0 @@
struct Type;
Type* foo();
Type* foo();
Type* foo() {}
class Foo {
Type* Get(int);
void Empty();
};
Type* Foo::Get(int) {}
void Foo::Empty() {}
extern const Type& external();
static Type* bar();
static Type* bar() {}
/*
OUTPUT:
{
"includes": [],
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:@S@Type",
"short_name": "",
"detailed_name": "",
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
"uses": ["1:8-1:12", "3:1-3:5", "4:1-4:5", "5:1-5:5", "8:3-8:7", "12:1-12:5", "15:14-15:18", "17:8-17:12", "18:8-18:12"]
}, {
"id": 1,
"usr": "c:@S@Foo",
"short_name": "Foo",
"detailed_name": "Foo",
"definition_spelling": "7:7-7:10",
"definition_extent": "7:1-10:2",
"parents": [],
"derived": [],
"types": [],
"funcs": [1, 2],
"vars": [],
"instances": [],
"uses": ["7:7-7:10", "12:7-12:10", "13:6-13:9"]
}],
"funcs": [{
"id": 0,
"is_operator": false,
"usr": "c:@F@foo#",
"short_name": "foo",
"detailed_name": "Type *foo()",
"declarations": [{
"spelling": "3:7-3:10",
"extent": "3:1-3:12",
"content": "Type* foo()",
"param_spellings": []
}, {
"spelling": "4:7-4:10",
"extent": "4:1-4:12",
"content": "Type* foo()",
"param_spellings": []
}],
"definition_spelling": "5:7-5:10",
"definition_extent": "5:1-5:15",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 1,
"is_operator": false,
"usr": "c:@S@Foo@F@Get#I#",
"short_name": "Get",
"detailed_name": "Type *Foo::Get(int)",
"declarations": [{
"spelling": "8:9-8:12",
"extent": "8:3-8:17",
"content": "Type* Get(int)",
"param_spellings": ["8:16-8:16"]
}],
"definition_spelling": "12:12-12:15",
"definition_extent": "12:1-12:23",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 2,
"is_operator": false,
"usr": "c:@S@Foo@F@Empty#",
"short_name": "Empty",
"detailed_name": "void Foo::Empty()",
"declarations": [{
"spelling": "9:8-9:13",
"extent": "9:3-9:15",
"content": "void Empty()",
"param_spellings": []
}],
"definition_spelling": "13:11-13:16",
"definition_extent": "13:1-13:21",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 3,
"is_operator": false,
"usr": "c:@F@external#",
"short_name": "external",
"detailed_name": "const Type &external()",
"declarations": [{
"spelling": "15:20-15:28",
"extent": "15:1-15:30",
"content": "extern const Type& external()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 4,
"is_operator": false,
"usr": "c:type_usage_on_return_type.cc@F@bar#",
"short_name": "bar",
"detailed_name": "Type *bar()",
"declarations": [{
"spelling": "17:14-17:17",
"extent": "17:1-17:19",
"content": "static Type* bar()",
"param_spellings": []
}],
"definition_spelling": "18:14-18:17",
"definition_extent": "18:1-18:22",
"base": [],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}],
"vars": []
}
*/

Some files were not shown because too many files have changed in this diff Show More