Support multiple base functions.

This commit is contained in:
Jacob Dufault 2017-12-18 22:15:46 -08:00
parent b4e8f8dd4f
commit 8098e4f01d
90 changed files with 324 additions and 86 deletions

View File

@ -368,7 +368,7 @@ std::string GetDocumentContentInRange(CXTranslationUnit cx_tu,
} // namespace
// static
int IndexFile::kCurrentVersion = 5;
int IndexFile::kCurrentVersion = 6;
IndexFile::IndexFile(const std::string& path) : id_cache(path), path(path) {
// TODO: Reconsider if we should still be reusing the same id_cache.
@ -1205,20 +1205,13 @@ void OnIndexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
clang_getOverriddenCursors(decl->cursor, &overridden,
&num_overridden);
// FIXME: this happens for destructors when there are multiple
// parent classes.
if (num_overridden > 1) {
std::cerr << "[indexer]: warning: multiple base overrides for "
<< func->def.detailed_name << std::endl;
}
for (unsigned i = 0; i < num_overridden; ++i) {
ClangCursor parent = overridden[i];
IndexFuncId parent_id = db->ToFuncId(parent.get_usr());
IndexFunc* parent_def = db->Resolve(parent_id);
func = db->Resolve(func_id); // ToFuncId invalidated func_def
func->def.base = parent_id;
func->def.base.push_back(parent_id);
parent_def->derived.push_back(func_id);
}

View File

@ -255,7 +255,7 @@ struct FuncDefDefinitionData {
optional<TypeId> declaring_type;
// Method this method overrides.
optional<FuncId> base;
std::vector<FuncId> base;
// Local variables defined in this function.
std::vector<VarId> locals;

View File

@ -34,15 +34,9 @@ struct CqueryBaseHandler : BaseMessageHandler<Ipc_CqueryBase> {
out.result = GetLsLocations(db, working_files, locations);
} else if (ref.idx.kind == SymbolKind::Func) {
QueryFunc& func = db->funcs[ref.idx.idx];
optional<QueryLocation> location =
GetBaseDefinitionOrDeclarationSpelling(db, func);
if (!location)
continue;
optional<lsLocation> ls_loc =
GetLsLocation(db, working_files, *location);
if (!ls_loc)
continue;
out.result.push_back(*ls_loc);
std::vector<QueryLocation> locations =
ToQueryLocation(db, func.def->base);
out.result = GetLsLocations(db, working_files, locations);
}
}
IpcManager::WriteStdout(IpcId::CqueryBase, out);

View File

@ -99,24 +99,28 @@ std::vector<Out_CqueryTypeHierarchyTree::TypeEntry>
BuildParentInheritanceHierarchyForFunc(QueryDatabase* db,
WorkingFiles* working_files,
QueryFuncId root) {
QueryFunc& root_func = db->funcs[root.id];
if (!root_func.def || !root_func.def->base)
return {};
QueryFunc& parent_func = db->funcs[root_func.def->base->id];
if (!parent_func.def)
return {};
Out_CqueryTypeHierarchyTree::TypeEntry parent_entry;
parent_entry.name = parent_func.def->detailed_name;
if (parent_func.def->definition_spelling)
parent_entry.location =
GetLsLocation(db, working_files, *parent_func.def->definition_spelling);
parent_entry.children = BuildParentInheritanceHierarchyForFunc(
db, working_files, *root_func.def->base);
std::vector<Out_CqueryTypeHierarchyTree::TypeEntry> entries;
entries.push_back(parent_entry);
QueryFunc& root_func = db->funcs[root.id];
if (!root_func.def || root_func.def->base.empty())
return {};
for (QueryFuncId parent_id : root_func.def->base) {
QueryFunc& parent_func = db->funcs[parent_id.id];
if (!parent_func.def)
continue;
Out_CqueryTypeHierarchyTree::TypeEntry parent_entry;
parent_entry.name = parent_func.def->detailed_name;
if (parent_func.def->definition_spelling)
parent_entry.location =
GetLsLocation(db, working_files, *parent_func.def->definition_spelling);
parent_entry.children = BuildParentInheritanceHierarchyForFunc(
db, working_files, parent_id);
entries.push_back(parent_entry);
}
return entries;
}

View File

@ -201,26 +201,32 @@ struct TextDocumentCodeLensHandler
false /*force_display*/);
// "Base"
optional<QueryLocation> base_loc =
GetBaseDefinitionOrDeclarationSpelling(db, func);
if (base_loc) {
optional<lsLocation> ls_base =
if (func.def->base.size() == 1) {
optional<QueryLocation> base_loc = GetDefinitionSpellingOfSymbol(db, func.def->base[0]);
if (base_loc) {
optional<lsLocation> ls_base =
GetLsLocation(db, working_files, *base_loc);
if (ls_base) {
optional<lsRange> range =
if (ls_base) {
optional<lsRange> range =
GetLsRange(common.working_file, ref.loc.range);
if (range) {
TCodeLens code_lens;
code_lens.range = *range;
code_lens.range.start.character += offset++;
code_lens.command = lsCommand<lsCodeLensCommandArguments>();
code_lens.command->title = "Base";
code_lens.command->command = "cquery.goto";
code_lens.command->arguments.uri = ls_base->uri;
code_lens.command->arguments.position = ls_base->range.start;
out.result.push_back(code_lens);
if (range) {
TCodeLens code_lens;
code_lens.range = *range;
code_lens.range.start.character += offset++;
code_lens.command = lsCommand<lsCodeLensCommandArguments>();
code_lens.command->title = "Base";
code_lens.command->command = "cquery.goto";
code_lens.command->arguments.uri = ls_base->uri;
code_lens.command->arguments.position = ls_base->range.start;
out.result.push_back(code_lens);
}
}
}
} else {
AddCodeLens("base", "base", &common,
ref.loc.OffsetStartColumn(1),
ToQueryLocation(db, func.def->base), nullopt,
false /*force_display*/);
}
break;

View File

@ -245,39 +245,24 @@ std::vector<QueryLocation> GetDeclarationsOfSymbolForGotoDefinition(
return {};
}
optional<QueryLocation> GetBaseDefinitionOrDeclarationSpelling(
QueryDatabase* db,
QueryFunc& func) {
if (!func.def->base)
return nullopt;
QueryFunc& base = db->funcs[func.def->base->id];
optional<QueryLocation> def;
if (base.def)
def = base.def->definition_spelling;
if (!def && !base.declarations.empty())
def = base.declarations[0];
return def;
}
bool HasCallersOnSelfOrBaseOrDerived(QueryDatabase* db, QueryFunc& root) {
// Check self.
if (!root.callers.empty())
return true;
// Check for base calls.
optional<QueryFuncId> func_id = root.def->base;
while (func_id) {
QueryFunc& func = db->funcs[func_id->id];
std::queue<QueryFuncId> queue;
PushRange(&queue, root.def->base);
while (!queue.empty()) {
QueryFunc& func = db->funcs[queue.front().id];
queue.pop();
if (!func.callers.empty())
return true;
if (!func.def)
break;
func_id = func.def->base;
if (func.def)
PushRange(&queue, func.def->base);
}
// Check for derived calls.
std::queue<QueryFuncId> queue;
PushRange(&queue, root.derived);
while (!queue.empty()) {
QueryFunc& func = db->funcs[queue.front().id];
@ -294,14 +279,15 @@ std::vector<QueryFuncRef> GetCallersForAllBaseFunctions(QueryDatabase* db,
QueryFunc& root) {
std::vector<QueryFuncRef> callers;
optional<QueryFuncId> func_id = root.def->base;
while (func_id) {
QueryFunc& func = db->funcs[func_id->id];
AddRange(&callers, func.callers);
std::queue<QueryFuncId> queue;
PushRange(&queue, root.def->base);
while (!queue.empty()) {
QueryFunc& func = db->funcs[queue.front().id];
queue.pop();
if (!func.def)
break;
func_id = func.def->base;
AddRange(&callers, func.callers);
if (func.def)
PushRange(&queue, func.def->base);
}
return callers;

View File

@ -33,9 +33,6 @@ std::vector<QueryLocation> GetUsesOfSymbol(QueryDatabase* db,
std::vector<QueryLocation> GetDeclarationsOfSymbolForGotoDefinition(
QueryDatabase* db,
const SymbolIdx& symbol);
optional<QueryLocation> GetBaseDefinitionOrDeclarationSpelling(
QueryDatabase* db,
QueryFunc& func);
bool HasCallersOnSelfOrBaseOrDerived(QueryDatabase* db, QueryFunc& root);
std::vector<QueryFuncRef> GetCallersForAllBaseFunctions(QueryDatabase* db,
QueryFunc& root);

View File

@ -120,7 +120,7 @@ void RunIndexTests() {
float memory_after = -1.;
{
// if (path != "tests/stl.cc") continue;
// if (path != "tests/inheritance/multiple_base_functions.cc") continue;
Config config;
FileConsumer::SharedState file_consumer_shared;

View File

@ -40,6 +40,7 @@ OUTPUT:
"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"],
@ -54,6 +55,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "6:6-6:9",
"definition_extent": "6:1-9:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -45,6 +45,7 @@ OUTPUT:
"definition_spelling": "3:3-3:6",
"definition_extent": "3:3-3:11",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["~2@8:7-8:8"],
@ -60,6 +61,7 @@ OUTPUT:
"definition_spelling": "4:3-4:7",
"definition_extent": "4:3-4:12",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -74,6 +76,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "7:6-7:9",
"definition_extent": "7:1-9:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -39,6 +39,7 @@ OUTPUT:
"definition_spelling": "2:3-2:7",
"definition_extent": "2:3-2:12",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["~1@6:8-6:11"],
@ -53,6 +54,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -35,6 +35,7 @@ OUTPUT:
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-4:11",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -70,6 +70,7 @@ OUTPUT: make_functions.h
"definition_spelling": "5:3-5:9",
"definition_extent": "5:3-5:14",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -85,6 +86,7 @@ OUTPUT: make_functions.h
"definition_spelling": "6:3-6:9",
"definition_extent": "6:3-6:17",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -100,6 +102,7 @@ OUTPUT: make_functions.h
"definition_spelling": "7:3-7:9",
"definition_extent": "7:3-7:32",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -115,6 +118,7 @@ OUTPUT: make_functions.h
"definition_spelling": "8:3-8:9",
"definition_extent": "8:3-8:30",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -218,6 +222,7 @@ OUTPUT: make_functions.cc
"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"],
@ -232,6 +237,7 @@ OUTPUT: make_functions.cc
"declarations": [],
"definition_spelling": "9:4-9:15",
"definition_extent": "9:1-11:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@17:3-17:14"],
@ -246,6 +252,7 @@ OUTPUT: make_functions.cc
"declarations": [],
"definition_spelling": "13:6-13:14",
"definition_extent": "13:1-18:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -258,6 +265,7 @@ OUTPUT: make_functions.cc
"detailed_name": "",
"hover": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["~-1@14:3-14:13"],
@ -270,6 +278,7 @@ OUTPUT: make_functions.cc
"detailed_name": "",
"hover": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["~-1@15:3-15:13"],
@ -282,6 +291,7 @@ OUTPUT: make_functions.cc
"detailed_name": "",
"hover": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["~-1@16:3-16:13"],
@ -294,6 +304,7 @@ OUTPUT: make_functions.cc
"detailed_name": "",
"hover": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["~-1@17:3-17:14"],

View File

@ -35,6 +35,7 @@ OUTPUT:
}],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-3:14",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -35,6 +35,7 @@ OUTPUT:
}],
"definition_spelling": "5:5-5:8",
"definition_extent": "5:1-5:36",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -41,6 +41,7 @@ OUTPUT:
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -59,6 +60,7 @@ OUTPUT:
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -79,6 +81,7 @@ OUTPUT:
"definition_spelling": "7:11-7:14",
"definition_extent": "7:1-7:19",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -19,6 +19,7 @@ OUTPUT:
"content": "void foo(int a, int b)",
"param_spellings": ["1:14-1:15", "1:21-1:22"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -23,6 +23,7 @@ OUTPUT:
}],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-3:14",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -16,6 +16,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-1:14",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -55,6 +55,7 @@ OUTPUT:
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [1],
"locals": [],
"callers": [],
@ -70,7 +71,7 @@ OUTPUT:
"definition_spelling": "5:8-5:11",
"definition_extent": "5:3-5:25",
"declaring_type": 1,
"base": 0,
"base": [0],
"derived": [],
"locals": [],
"callers": [],

View File

@ -34,6 +34,7 @@ OUTPUT:
"definition_spelling": "2:16-2:19",
"definition_extent": "2:3-2:28",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -0,0 +1,113 @@
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",
"hover": "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",
"hover": "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",
"hover": "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",
"hover": "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",
"hover": "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",
"hover": "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

@ -40,6 +40,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-12:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -52,6 +53,7 @@ OUTPUT:
"detailed_name": "",
"hover": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["0@9:14-9:15", "0@10:14-10:15", "0@11:14-11:15"],

View File

@ -27,6 +27,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "6:5-6:10",
"definition_extent": "6:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["1@12:5-12:10"],
@ -46,6 +47,7 @@ OUTPUT:
}],
"definition_spelling": "12:1-12:20",
"definition_extent": "12:1-12:20",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -41,6 +41,7 @@ OUTPUT:
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -41,6 +41,7 @@ OUTPUT:
"definition_spelling": "5:11-5:14",
"definition_extent": "5:1-5:25",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -34,6 +34,7 @@ OUTPUT:
"definition_spelling": "2:8-2:11",
"definition_extent": "2:3-2:16",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -96,6 +96,7 @@ OUTPUT: header.h
"declarations": [],
"definition_spelling": "10:6-10:10",
"definition_extent": "10:1-10:15",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -182,6 +183,7 @@ OUTPUT: impl.cc
"declarations": [],
"definition_spelling": "3:6-3:10",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -194,6 +196,7 @@ OUTPUT: impl.cc
"detailed_name": "",
"hover": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["0@4:3-4:7"],

View File

@ -23,6 +23,7 @@ OUTPUT: simple_header.h
"content": "void header()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -48,6 +49,7 @@ OUTPUT: simple_impl.cc
"declarations": [],
"definition_spelling": "3:6-3:10",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -60,6 +62,7 @@ OUTPUT: simple_impl.cc
"detailed_name": "",
"hover": "",
"declarations": [],
"base": [],
"derived": [],
"locals": [],
"callers": ["0@4:3-4:9"],

View File

@ -37,6 +37,7 @@ OUTPUT: static.h
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -76,6 +77,7 @@ OUTPUT: static.cc
"definition_spelling": "3:14-3:32",
"definition_extent": "3:1-3:37",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -21,6 +21,7 @@ OUTPUT:
"content": "void foo()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -21,6 +21,7 @@ OUTPUT:
"content": "void foo(int a, int b)",
"param_spellings": ["2:14-2:15", "2:21-2:22"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -18,6 +18,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "2:6-2:9",
"definition_extent": "2:1-2:14",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -39,6 +39,7 @@ OUTPUT:
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -43,6 +43,7 @@ OUTPUT:
"definition_spelling": "6:11-6:14",
"definition_extent": "6:1-6:19",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -36,6 +36,7 @@ OUTPUT:
"definition_spelling": "3:8-3:11",
"definition_extent": "3:3-3:16",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -29,6 +29,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "11:6-11:9",
"definition_extent": "11:1-14:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -25,6 +25,7 @@ OUTPUT:
"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"],
@ -39,6 +40,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "6:6-6:12",
"definition_extent": "6:1-10:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -49,6 +49,7 @@ OUTPUT:
"content": "+ (void)test;",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -68,6 +69,7 @@ OUTPUT:
}],
"definition_spelling": "8:9-8:25",
"definition_extent": "8:1-8:28",
"base": [],
"derived": [],
"locals": [],
"callers": ["4@14:13-14:29"],
@ -85,6 +87,7 @@ OUTPUT:
"content": "aProp",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -102,6 +105,7 @@ OUTPUT:
"content": "aProp",
"param_spellings": ["4:29-4:34"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["4@0:0-0:0"],
@ -116,6 +120,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "11:5-11:9",
"definition_extent": "11:1-16:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -38,6 +38,7 @@ OUTPUT:
"definition_spelling": "2:8-2:18",
"definition_extent": "2:3-2:27",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -56,6 +57,7 @@ OUTPUT:
"param_spellings": ["3:23-3:23"]
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -74,6 +76,7 @@ OUTPUT:
"param_spellings": ["4:22-4:23", "4:29-4:30"]
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -91,6 +94,7 @@ OUTPUT:
"content": "friend Foo &operator += (const Foo&, const Type&)",
"param_spellings": ["7:36-7:36", "7:49-7:49"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -77,6 +77,7 @@ OUTPUT:
"content": "std::vector<CompilationEntry> LoadCompilationEntriesFromDirectory(const std::string& project_directory)",
"param_spellings": ["12:86-12:103"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -54,6 +54,7 @@ OUTPUT: static_function_in_type.h
"param_spellings": ["6:32-6:32"]
}],
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -106,6 +107,7 @@ OUTPUT: static_function_in_type.cc
"definition_spelling": "5:11-5:19",
"definition_extent": "5:1-6:2",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -59,6 +59,7 @@ OUTPUT:
"definition_spelling": "8:11-8:14",
"definition_extent": "8:1-8:36",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -43,6 +43,7 @@ OUTPUT:
"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"],

View File

@ -54,6 +54,7 @@ OUTPUT:
"definition_spelling": "7:19-7:22",
"definition_extent": "6:1-7:24",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -40,6 +40,7 @@ OUTPUT:
"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"],

View File

@ -41,6 +41,7 @@ OUTPUT:
"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"],

View File

@ -25,6 +25,7 @@ OUTPUT:
"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"],

View File

@ -35,6 +35,7 @@ OUTPUT:
"content": "static func g",
"param_spellings": ["2:13-2:13", "2:13-2:13"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -42,6 +42,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "8:6-8:9",
"definition_extent": "8:1-10:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -39,6 +39,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:12",
"definition_extent": "1:1-1:17",
"base": [],
"derived": [],
"locals": [],
"callers": ["1@8:3-8:9"],
@ -59,6 +60,7 @@ OUTPUT:
"definition_spelling": "7:6-7:9",
"definition_extent": "7:1-9:2",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -25,6 +25,7 @@ OUTPUT:
"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"],
@ -39,6 +40,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "5:6-5:12",
"definition_extent": "5:1-7:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -30,6 +30,7 @@ OUTPUT:
"content": "void called()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["1@5:3-5:9"],
@ -44,6 +45,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "4:6-4:12",
"definition_extent": "4:1-6:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@9:3-9:9"],
@ -58,6 +60,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "8:6-8:9",
"definition_extent": "8:1-10:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -43,6 +43,7 @@ OUTPUT:
"param_spellings": ["2:15-2:16"]
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["~2@8:10-8:16"],
@ -57,6 +58,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "5:5-5:11",
"definition_extent": "5:1-5:27",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@8:10-8:16"],
@ -71,6 +73,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "7:9-7:15",
"definition_extent": "7:1-9:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -23,6 +23,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:13",
"definition_extent": "1:1-1:23",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@7:3-7:10"],
@ -37,6 +38,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:6-3:10",
"definition_extent": "3:1-3:15",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@6:13-6:17", "2@7:12-7:16"],
@ -51,6 +53,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -42,6 +42,7 @@ OUTPUT:
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["1@6:18-6:22"],
@ -56,6 +57,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-7:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -19,6 +19,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:12",
"definition_extent": "1:1-1:17",
"base": [],
"derived": [],
"locals": [],
"callers": ["1@3:3-3:9"],
@ -33,6 +34,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "2:6-2:12",
"definition_extent": "2:1-4:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -42,6 +42,7 @@ OUTPUT:
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["1@7:6-7:10"],
@ -56,6 +57,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -37,6 +37,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:12-1:18",
"definition_extent": "1:1-3:2",
"base": [],
"derived": [],
"locals": [],
"callers": ["-1@6:11-6:17"],

View File

@ -22,6 +22,7 @@ OUTPUT:
"content": "void foo()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["1@4:3-4:6"],
@ -36,6 +37,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:6-3:11",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -41,6 +41,7 @@ OUTPUT:
"param_spellings": []
}],
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": ["1@7:6-7:9"],
@ -55,6 +56,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "5:6-5:11",
"definition_extent": "5:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -25,6 +25,7 @@ OUTPUT:
"content": "void accept(T)",
"param_spellings": ["2:14-2:14"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["1@5:3-5:9", "1@6:3-6:9"],
@ -39,6 +40,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-7:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -54,6 +54,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "9:16-9:27",
"definition_extent": "9:1-12:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -148,6 +148,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "33:37-33:51",
"definition_extent": "33:1-33:92",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -162,6 +163,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "40:6-40:20",
"definition_extent": "40:1-40:28",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -176,6 +178,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "53:6-53:11",
"definition_extent": "53:1-55:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -196,6 +199,7 @@ OUTPUT:
"definition_spelling": "79:26-79:29",
"definition_extent": "79:1-79:51",
"declaring_type": 3,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -50,6 +50,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-7:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -47,6 +47,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-4:47",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -42,6 +42,7 @@ OUTPUT:
}],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-4:26",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -29,6 +29,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "2:6-2:9",
"definition_extent": "2:1-2:26",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -37,6 +37,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -71,6 +71,7 @@ OUTPUT:
}],
"definition_spelling": "5:7-5:10",
"definition_extent": "5:1-5:15",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -91,6 +92,7 @@ OUTPUT:
"definition_spelling": "12:12-12:15",
"definition_extent": "12:1-12:23",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -111,6 +113,7 @@ OUTPUT:
"definition_spelling": "13:11-13:16",
"definition_extent": "13:1-13:21",
"declaring_type": 1,
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -128,6 +131,7 @@ OUTPUT:
"content": "extern const Type& external()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -147,6 +151,7 @@ OUTPUT:
}],
"definition_spelling": "18:14-18:17",
"definition_extent": "18:1-18:22",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -101,6 +101,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "7:6-7:12",
"definition_extent": "7:1-7:21",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -115,6 +116,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "8:6-8:13",
"definition_extent": "8:1-8:23",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -129,6 +131,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "9:6-9:13",
"definition_extent": "9:1-9:23",
"base": [],
"derived": [],
"locals": [],
"callers": [],
@ -143,6 +146,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "10:6-10:13",
"definition_extent": "10:1-10:23",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -46,6 +46,7 @@ OUTPUT:
"definition_spelling": "5:11-5:15",
"definition_extent": "5:1-8:2",
"declaring_type": 0,
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -48,6 +48,7 @@ OUTPUT:
"content": "void called(int a)",
"param_spellings": ["1:17-1:18"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["2@14:3-14:9"],
@ -65,6 +66,7 @@ OUTPUT:
"content": "int gen()",
"param_spellings": []
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["2@14:14-14:17"],
@ -79,6 +81,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "12:6-12:9",
"definition_extent": "12:1-15:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -25,6 +25,7 @@ OUTPUT:
"content": "void called(int a)",
"param_spellings": ["1:17-1:18"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["2@6:3-6:9"],
@ -39,6 +40,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:5-3:8",
"definition_extent": "3:1-3:24",
"base": [],
"derived": [],
"locals": [],
"callers": ["2@6:10-6:13", "2@6:18-6:21"],
@ -53,6 +55,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "5:6-5:9",
"definition_extent": "5:1-7:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -23,6 +23,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:12",
"definition_extent": "1:1-1:17",
"base": [],
"derived": [],
"locals": [],
"callers": ["1@4:13-4:19", "1@7:3-7:9"],
@ -37,6 +38,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:6-3:12",
"definition_extent": "3:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -51,6 +51,7 @@ OUTPUT:
"content": "void accept(int)",
"param_spellings": ["7:16-7:16"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["2@14:3-14:9", "2@15:3-15:9", "2@17:3-17:9"],
@ -68,6 +69,7 @@ OUTPUT:
"content": "void accept(int*)",
"param_spellings": ["8:17-8:17"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["2@16:3-16:9"],
@ -82,6 +84,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "10:6-10:9",
"definition_extent": "10:1-18:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -42,6 +42,7 @@ OUTPUT:
"content": "void accept(int)",
"param_spellings": ["5:16-5:16"]
}],
"base": [],
"derived": [],
"locals": [],
"callers": ["1@8:3-8:9"],
@ -56,6 +57,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "7:6-7:9",
"definition_extent": "7:1-9:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -19,6 +19,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -17,6 +17,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-3:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -18,6 +18,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-4:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -23,6 +23,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-9:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -23,6 +23,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-8:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -20,6 +20,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -35,6 +35,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "2:6-2:7",
"definition_extent": "2:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -33,6 +33,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -31,6 +31,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-3:30",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -15,6 +15,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-1:22",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -23,6 +23,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-9:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -17,6 +17,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-3:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],

View File

@ -53,6 +53,7 @@ OUTPUT:
"declarations": [],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-5:2",
"base": [],
"derived": [],
"locals": [],
"callers": [],