Store range information in index

This commit is contained in:
Jacob Dufault 2017-04-05 01:06:18 -07:00
parent ed8fc33cbe
commit e3058da622
108 changed files with 1300 additions and 2026 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@ Debug
x64
build
libcxx
CACHE
waf-*
.lock-waf*
.waf*

View File

@ -103,6 +103,55 @@ std::string Join(const std::vector<std::string>& elements, std::string sep) {
return result;
}
optional<QueryableRange> GetDefinitionSpellingOfUsr(QueryableDatabase* db, const Usr& usr) {
SymbolIdx symbol = db->usr_to_symbol[usr];
switch (symbol.kind) {
case SymbolKind::Type: {
QueryableTypeDef* def = &db->types[symbol.idx];
return def->def.definition_spelling;
}
case SymbolKind::Func: {
QueryableFuncDef* def = &db->funcs[symbol.idx];
return def->def.definition_spelling;
}
case SymbolKind::Var: {
QueryableVarDef* def = &db->vars[symbol.idx];
return def->def.definition_spelling;
}
case SymbolKind::File:
case SymbolKind::Invalid: {
assert(false && "unexpected");
break;
}
}
return nullopt;
}
optional<QueryableRange> GetDefinitionExtentOfUsr(QueryableDatabase* db, const Usr& usr) {
SymbolIdx symbol = db->usr_to_symbol[usr];
switch (symbol.kind) {
case SymbolKind::Type: {
QueryableTypeDef* def = &db->types[symbol.idx];
return def->def.definition_extent;
}
case SymbolKind::Func: {
QueryableFuncDef* def = &db->funcs[symbol.idx];
return def->def.definition_extent;
}
case SymbolKind::Var: {
QueryableVarDef* def = &db->vars[symbol.idx];
return def->def.definition_extent;
}
case SymbolKind::File:
case SymbolKind::Invalid: {
assert(false && "unexpected");
break;
}
}
return nullopt;
}
template<typename T>
void SendOutMessageToClient(IpcMessageQueue* queue, T& response) {
std::ostringstream sstream;
@ -283,37 +332,38 @@ QueryableFile* FindFile(QueryableDatabase* db, const std::string& filename) {
return nullptr;
}
lsLocation GetLsLocation(const QueryableLocation& location) {
lsRange GetLsRange(const QueryableRange& location) {
return lsRange(
lsPosition(location.start.line - 1, location.start.column - 1),
lsPosition(location.end.line - 1, location.end.column - 1));
}
lsLocation GetLsLocation(const QueryableRange& location) {
return lsLocation(
lsDocumentUri::FromPath(location.path),
lsRange(lsPosition(location.line - 1, location.column - 1)));
lsDocumentUri::FromPath(location.start.path),
GetLsRange(location));
}
void AddCodeLens(std::vector<TCodeLens>* result,
QueryableLocation loc,
const std::vector<QueryableLocation>& uses,
QueryableRange loc,
const std::vector<QueryableRange>& uses,
bool exclude_loc,
bool only_interesting,
const char* singular,
const char* plural) {
TCodeLens code_lens;
code_lens.range.start.line = loc.line - 1;
code_lens.range.start.character = loc.column - 1;
// TODO: store range information.
code_lens.range.end.line = code_lens.range.start.line;
code_lens.range.end.character = code_lens.range.start.character;
code_lens.range = GetLsRange(loc);
code_lens.command = lsCommand<lsCodeLensCommandArguments>();
code_lens.command->command = "superindex.showReferences";
code_lens.command->arguments.uri = lsDocumentUri::FromPath(loc.path);
code_lens.command->arguments.uri = lsDocumentUri::FromPath(loc.start.path);
code_lens.command->arguments.position = code_lens.range.start;
// Add unique uses.
std::unordered_set<lsLocation> unique_uses;
for (const QueryableLocation& use : uses) {
for (const QueryableRange& use : uses) {
if (exclude_loc && use == loc)
continue;
if (only_interesting && !use.interesting)
if (only_interesting && !use.start.interesting)
continue;
unique_uses.insert(GetLsLocation(use));
}
@ -321,7 +371,7 @@ void AddCodeLens(std::vector<TCodeLens>* result,
unique_uses.end());
// User visible label
int num_usages = unique_uses.size();
size_t num_usages = unique_uses.size();
code_lens.command->title = std::to_string(num_usages) + " ";
if (num_usages == 1)
code_lens.command->title += singular;
@ -333,61 +383,31 @@ void AddCodeLens(std::vector<TCodeLens>* result,
}
void AddCodeLens(std::vector<TCodeLens>* result,
QueryableLocation loc,
QueryableRange loc,
const std::vector<UsrRef>& uses,
bool exclude_loc,
bool only_interesting,
const char* singular,
const char* plural) {
std::vector<QueryableLocation> uses0;
std::vector<QueryableRange> uses0;
uses0.reserve(uses.size());
for (const UsrRef& use : uses)
uses0.push_back(use.loc);
AddCodeLens(result, loc, uses0, exclude_loc, only_interesting, singular, plural);
}
optional<QueryableLocation> GetDefinitionOfUsr(QueryableDatabase* db, const Usr& usr) {
SymbolIdx symbol = db->usr_to_symbol[usr];
switch (symbol.kind) {
case SymbolKind::Type: {
QueryableTypeDef* def = &db->types[symbol.idx];
if (def->def.definition)
return def->def.definition.value();
break;
}
case SymbolKind::Func: {
QueryableFuncDef* def = &db->funcs[symbol.idx];
if (def->def.definition)
return def->def.definition.value();
break;
}
case SymbolKind::Var: {
QueryableVarDef* def = &db->vars[symbol.idx];
if (def->def.definition)
return def->def.definition.value();
break;
}
case SymbolKind::File:
case SymbolKind::Invalid: {
assert(false && "unexpected");
break;
}
}
return nullopt;
}
void AddCodeLens(std::vector<TCodeLens>* result,
QueryableDatabase* db,
QueryableLocation loc,
QueryableRange loc,
const std::vector<Usr>& usrs,
bool exclude_loc,
bool only_interesting,
const char* singular,
const char* plural) {
std::vector<QueryableLocation> uses0;
std::vector<QueryableRange> uses0;
uses0.reserve(usrs.size());
for (const Usr& usr : usrs) {
optional<QueryableLocation> loc = GetDefinitionOfUsr(db, usr);
optional<QueryableRange> loc = GetDefinitionSpellingOfUsr(db, usr);
if (loc)
uses0.push_back(loc.value());
}
@ -495,27 +515,16 @@ void QueryDbMainLoop(
// if we store range information instead of hacking it.
int target_line = msg->params.position.line + 1;
int target_column = msg->params.position.character + 1;
int best_dist = INT_MAX;
for (const UsrRef& ref : file->all_symbols) {
if (ref.loc.line == target_line) {
if (ref.loc.column > target_column)
continue;
int dist = target_column - ref.loc.column;
if (dist < best_dist) {
optional<QueryableLocation> location = GetDefinitionOfUsr(db, ref.usr);
if (location) {
best_dist = dist;
response.result.clear();
if (ref.loc.start.line >= target_line && ref.loc.end.line <= target_line &&
ref.loc.start.column <= target_column && ref.loc.end.column >= target_column) {
optional<QueryableRange> location = GetDefinitionSpellingOfUsr(db, ref.usr);
if (location)
response.result.push_back(GetLsLocation(location.value()));
}
if (dist == 0)
break;
}
}
}
SendOutMessageToClient(language_client, response);
break;
@ -538,14 +547,7 @@ void QueryDbMainLoop(
SymbolIdx symbol = db->usr_to_symbol[ref.usr];
lsSymbolInformation info;
info.location.range.start.line =
ref.loc.line - 1; // TODO: cleanup indexer to negate by 1.
info.location.range.start.character =
ref.loc.column - 1; // TODO: cleanup indexer to negate by 1.
// TODO: store range information.
info.location.range.end.line = info.location.range.start.line;
info.location.range.end.character =
info.location.range.start.character;
info.location = GetLsLocation(ref.loc);
// TODO: cleanup namespace/naming so there is only one SymbolKind.
switch (symbol.kind) {
@ -612,31 +614,34 @@ void QueryDbMainLoop(
switch (symbol.kind) {
case SymbolKind::Type: {
QueryableTypeDef& def = db->types[symbol.idx];
AddCodeLens(&response.result, ref.loc.OffsetColumn(0), def.uses,
false /*exclude_loc*/, true /*only_interesting*/, "reference",
"references");
AddCodeLens(&response.result, db, ref.loc.OffsetColumn(1), def.derived,
AddCodeLens(&response.result, ref.loc.OffsetStartColumn(0), def.uses,
false /*exclude_loc*/, false /*only_interesting*/, "ref",
"refs");
AddCodeLens(&response.result, ref.loc.OffsetStartColumn(1), def.uses,
false /*exclude_loc*/, true /*only_interesting*/, "iref",
"irefs");
AddCodeLens(&response.result, db, ref.loc.OffsetStartColumn(2), def.derived,
false /*exclude_loc*/, false /*only_interesting*/, "derived", "derived");
AddCodeLens(&response.result, db, ref.loc.OffsetColumn(2), def.instantiations,
AddCodeLens(&response.result, db, ref.loc.OffsetStartColumn(3), def.instantiations,
false /*exclude_loc*/, false /*only_interesting*/, "instantiation", "instantiations");
break;
}
case SymbolKind::Func: {
QueryableFuncDef& def = db->funcs[symbol.idx];
//AddCodeLens(&response.result, ref.loc.OffsetColumn(0), def.uses,
//AddCodeLens(&response.result, ref.loc.OffsetStartColumn(0), def.uses,
// false /*exclude_loc*/, false /*only_interesting*/, "reference",
// "references");
AddCodeLens(&response.result, ref.loc.OffsetColumn(1), def.callers,
AddCodeLens(&response.result, ref.loc.OffsetStartColumn(1), def.callers,
true /*exclude_loc*/, false /*only_interesting*/, "caller", "callers");
//AddCodeLens(&response.result, ref.loc.OffsetColumn(2), def.def.callees,
// false /*exclude_loc*/, false /*only_interesting*/, "callee", "callees");
AddCodeLens(&response.result, db, ref.loc.OffsetColumn(3), def.derived,
AddCodeLens(&response.result, db, ref.loc.OffsetStartColumn(3), def.derived,
false /*exclude_loc*/, false /*only_interesting*/, "derived", "derived");
break;
}
case SymbolKind::Var: {
QueryableVarDef& def = db->vars[symbol.idx];
AddCodeLens(&response.result, ref.loc.OffsetColumn(0), def.uses,
AddCodeLens(&response.result, ref.loc.OffsetStartColumn(0), def.uses,
true /*exclude_loc*/, false /*only_interesting*/, "reference",
"references");
break;
@ -683,11 +688,9 @@ void QueryDbMainLoop(
info.name = def.def.qualified_name;
info.kind = lsSymbolKind::Class;
if (def.def.definition.has_value()) {
info.location.uri.SetPath(def.def.definition->path);
info.location.range.start.line = def.def.definition->line - 1;
info.location.range.start.character =
def.def.definition->column - 1;
if (def.def.definition_extent.has_value()) {
info.location.uri.SetPath(def.def.definition_extent->start.path);
info.location.range = GetLsRange(def.def.definition_extent.value());
}
break;
}
@ -705,11 +708,8 @@ void QueryDbMainLoop(
info.kind = lsSymbolKind::Function;
}
if (def.def.definition.has_value()) {
info.location.uri.SetPath(def.def.definition->path);
info.location.range.start.line = def.def.definition->line - 1;
info.location.range.start.character =
def.def.definition->column - 1;
if (def.def.definition_extent.has_value()) {
info.location = GetLsLocation(def.def.definition_extent.value());
}
break;
}
@ -718,11 +718,8 @@ void QueryDbMainLoop(
info.name = def.def.qualified_name;
info.kind = lsSymbolKind::Variable;
if (def.def.definition.has_value()) {
info.location.uri.SetPath(def.def.definition->path);
info.location.range.start.line = def.def.definition->line - 1;
info.location.range.start.character =
def.def.definition->column - 1;
if (def.def.definition_extent.has_value()) {
info.location = GetLsLocation(def.def.definition_extent.value());
}
break;
}
@ -732,11 +729,6 @@ void QueryDbMainLoop(
}
};
// TODO: store range information.
info.location.range.end.line = info.location.range.start.line;
info.location.range.end.character =
info.location.range.start.character;
response.result.push_back(info);
}
}

View File

@ -83,13 +83,18 @@ IndexedTypeDef::IndexedTypeDef(TypeId id, const std::string& usr)
// std::cerr << "Creating type with usr " << usr << std::endl;
}
void AddUsage(std::vector<Location>& uses,
Location loc,
void AddUsage(std::vector<Range>& uses,
Range loc,
bool insert_if_not_present = true) {
if (loc.start.column == 7 && loc.start.line == 7)
std::cerr << "break;";
// TODO: think about if we need to also consider |uses[i].end|
// First thought makes me think no, we don't.
for (int i = uses.size() - 1; i >= 0; --i) {
if (uses[i].IsEqualTo(loc)) {
if (loc.interesting)
uses[i].interesting = true;
if (uses[i].start == loc.start) {
if (loc.start.interesting)
uses[i].start.interesting = true;
return;
}
}
@ -98,83 +103,53 @@ void AddUsage(std::vector<Location>& uses,
uses.push_back(loc);
}
std::string Location::ToPrettyString(IdCache* id_cache) {
// Output looks like this:
//
// *1:2:3
//
// * => interesting
// 1 => file id
// 2 => line
// 3 => column
IdCache::IdCache(const std::string& primary_file)
: primary_file(primary_file) {}
std::string result;
if (interesting)
result += '*';
result += id_cache->file_id_to_file_path[raw_file_id];
result += ':';
result += std::to_string(line);
result += ':';
result += std::to_string(column);
return result;
Range IdCache::ForceResolve(const CXSourceRange& range, bool interesting) {
CXSourceLocation start = clang_getRangeStart(range);
CXSourceLocation end = clang_getRangeEnd(range);
unsigned int start_line, start_column;
clang_getSpellingLocation(start, nullptr, &start_line, &start_column, nullptr);
unsigned int end_line, end_column;
clang_getSpellingLocation(end, nullptr, &end_line, &end_column, nullptr);
return Range(
Position(interesting, start_line, start_column) /*start*/,
Position(interesting, end_line, end_column) /*end*/);
}
IdCache::IdCache(const std::string& primary_file) : primary_file(primary_file) {
// Reserve id 0 for unfound.
file_path_to_file_id[""] = FileId(0);
file_id_to_file_path[FileId(0)] = "";
Range IdCache::ForceResolveSpelling(const CXCursor& cx_cursor, bool interesting) {
CXSourceRange cx_range = clang_Cursor_getSpellingNameRange(cx_cursor, 0, 0);
return ForceResolve(cx_range, interesting);
}
Location IdCache::ForceResolve(const CXSourceLocation& cx_loc, bool interesting) {
CXFile file;
unsigned int line, column, offset;
clang_getSpellingLocation(cx_loc, &file, &line, &column, &offset);
FileId file_id(-1);
if (file != nullptr) {
std::string path = clang::ToString(clang_getFileName(file));
auto it = file_path_to_file_id.find(path);
if (it != file_path_to_file_id.end()) {
file_id = it->second;
}
else {
file_id = FileId(file_path_to_file_id.size());
file_path_to_file_id[path] = file_id;
file_id_to_file_path[file_id] = path;
}
}
return Location(interesting, file_id, line, column);
}
Location IdCache::ForceResolve(const CXIdxLoc& cx_idx_loc, bool interesting) {
CXSourceLocation cx_loc = clang_indexLoc_getCXSourceLocation(cx_idx_loc);
return ForceResolve(cx_loc, interesting);
}
Location IdCache::ForceResolve(const CXCursor& cx_cursor, bool interesting) {
return ForceResolve(clang_getCursorLocation(cx_cursor), interesting);
}
optional<Location> IdCache::Resolve(const CXSourceLocation& cx_loc, bool interesting) {
optional<Range> IdCache::ResolveSpelling(const CXCursor& cx_cursor, bool interesting) {
CXSourceLocation cx_loc = clang_getCursorLocation(cx_cursor);
if (!clang_Location_isFromMainFile(cx_loc))
return nullopt;
return ForceResolve(cx_loc, interesting);
return ForceResolveSpelling(cx_cursor, interesting);
}
optional<Location> IdCache::Resolve(const CXIdxLoc& cx_idx_loc, bool interesting) {
CXSourceLocation cx_loc = clang_indexLoc_getCXSourceLocation(cx_idx_loc);
return Resolve(cx_loc, interesting);
optional<Range> IdCache::ResolveSpelling(const clang::Cursor& cursor, bool interesting) {
return ResolveSpelling(cursor.cx_cursor, interesting);
}
optional<Location> IdCache::Resolve(const CXCursor& cx_cursor, bool interesting) {
return Resolve(clang_getCursorLocation(cx_cursor), interesting);
Range IdCache::ForceResolveExtent(const CXCursor& cx_cursor, bool interesting) {
CXSourceRange cx_range = clang_getCursorExtent(cx_cursor);
return ForceResolve(cx_range, interesting);
}
optional<Location> IdCache::Resolve(const clang::Cursor& cursor, bool interesting) {
return Resolve(cursor.cx_cursor, interesting);
optional<Range> IdCache::ResolveExtent(const CXCursor& cx_cursor, bool interesting) {
CXSourceLocation cx_loc = clang_getCursorLocation(cx_cursor);
if (!clang_Location_isFromMainFile(cx_loc))
return nullopt;
return ForceResolveExtent(cx_cursor, interesting);
}
optional<Range> IdCache::ResolveExtent(const clang::Cursor& cursor, bool interesting) {
return ResolveExtent(cursor.cx_cursor, interesting);
}
template <typename T>
@ -229,11 +204,9 @@ struct IndexParam {
IndexedFile* db;
NamespaceHelper* ns;
// Record the last type usage location we recorded. Clang will sometimes
// visit the same expression twice so we wan't to avoid double-reporting
// usage information for those locations.
Location last_type_usage_location;
Location last_func_usage_location;
// Record last func usage we reported, as clang will record the reference
// twice. We don't want to double report.
Range last_func_usage_location;
IndexParam(IndexedFile* db, NamespaceHelper* ns) : db(db), ns(ns) {}
};
@ -253,11 +226,19 @@ void diagnostic(CXClientData client_data,
std::string spelling =
clang::ToString(clang_getDiagnosticSpelling(diagnostic));
Location location = param->db->id_cache.ForceResolve(
clang_getDiagnosticLocation(diagnostic), false /*interesting*/);
std::cerr << location.ToPrettyString(&param->db->id_cache) << ": "
<< spelling << std::endl;
// Fetch location
CXFile file;
unsigned int line, column;
CXSourceLocation location = clang_getDiagnosticLocation(diagnostic);
clang_getSpellingLocation(location, &file, &line, &column, nullptr);
// Fetch path, print.
if (file != nullptr) {
std::string path = clang::ToString(clang_getFileName(file));
std::cerr << path << ':';
}
std::cerr << line << ':' << column << ": " << spelling << std::endl;
clang_disposeDiagnostic(diagnostic);
}
@ -405,7 +386,7 @@ void VisitDeclForTypeUsageVisitorHandler(clang::Cursor cursor,
IndexedTypeDef* ref_type_def = db->Resolve(ref_type_id);
// TODO: Should we even be visiting this if the file is not from the main
// def? Try adding assert on |loc| later.
optional<Location> loc = db->id_cache.Resolve(cursor, true /*interesting*/);
optional<Range> loc = db->id_cache.ResolveSpelling(cursor, true /*interesting*/);
if (loc)
AddUsage(ref_type_def->uses, loc.value());
}
@ -655,7 +636,7 @@ clang::VisiterResult AddDeclInitializerUsagesVisitor(clang::Cursor cursor,
if (ref_usr == "")
break;
optional<Location> loc = db->id_cache.Resolve(cursor, false /*interesting*/);
optional<Range> loc = db->id_cache.ResolveSpelling(cursor, false /*interesting*/);
// std::cerr << "Adding usage to id=" << ref_id.id << " usr=" << ref_usr
// << " at " << loc.ToString() << std::endl;
if (loc) {
@ -673,6 +654,19 @@ void AddDeclInitializerUsages(IndexedFile* db, clang::Cursor decl_cursor) {
decl_cursor.VisitChildren(&AddDeclInitializerUsagesVisitor, db);
}
bool AreEqualLocations(CXIdxLoc loc, CXCursor cursor) {
// clang_getCursorExtent
// clang_Cursor_getSpellingNameRange
return clang_equalLocations(
clang_indexLoc_getCXSourceLocation(loc),
//clang_getRangeStart(clang_getCursorExtent(cursor)));
clang_getRangeStart(clang_Cursor_getSpellingNameRange(cursor, 0, 0)));
}
// TODO TODO TODO TODO
// INDEX SPELLING
void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// TODO: we can minimize processing for cursors which return false for
// clang_Location_isFromMainFile (ie, only add usages)
@ -681,6 +675,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
if (is_system_def)
return;
assert(AreEqualLocations(decl->loc, decl->cursor));
IndexParam* param = static_cast<IndexParam*>(client_data);
IndexedFile* db = param->db;
NamespaceHelper* ns = param->ns;
@ -699,9 +695,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
case CXIdxEntity_Field:
case CXIdxEntity_Variable:
case CXIdxEntity_CXXStaticVariable: {
optional<Location> decl_loc =
db->id_cache.Resolve(decl->loc, false /*interesting*/);
if (!decl_loc)
optional<Range> decl_loc_spelling = db->id_cache.ResolveSpelling(decl->cursor, false /*interesting*/);
if (!decl_loc_spelling)
break;
clang::Cursor decl_cursor = decl->cursor;
@ -725,11 +720,14 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
ns->QualifiedName(decl->semanticContainer, var_def->def.short_name);
//}
if (decl->isDefinition)
var_def->def.definition = decl_loc.value();
else
var_def->def.declaration = decl_loc.value();
AddUsage(var_def->uses, decl_loc.value());
if (decl->isDefinition) {
var_def->def.definition_spelling = db->id_cache.ForceResolveSpelling(decl->cursor, false /*interesting*/);
var_def->def.definition_extent = db->id_cache.ForceResolveExtent(decl->cursor, false /*interesting*/);;
}
else {
var_def->def.declaration = db->id_cache.ForceResolveSpelling(decl->cursor, false /*interesting*/);
}
AddUsage(var_def->uses, decl_loc_spelling.value());
// std::cerr << std::endl << "Visiting declaration" << std::endl;
// Dump(decl_cursor);
@ -778,9 +776,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
case CXIdxEntity_CXXInstanceMethod:
case CXIdxEntity_CXXStaticMethod:
case CXIdxEntity_CXXConversionFunction: {
optional<Location> decl_loc =
db->id_cache.Resolve(decl->loc, false /*interesting*/);
if (!decl_loc)
optional<Range> decl_loc_spelling = db->id_cache.ResolveSpelling(decl->cursor, false /*interesting*/);
if (!decl_loc_spelling)
break;
clang::Cursor decl_cursor = decl->cursor;
@ -790,7 +787,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
FuncId func_id = db->ToFuncId(resolved.cx_cursor);
IndexedFuncDef* func_def = db->Resolve(func_id);
AddUsage(func_def->uses, decl_loc.value());
AddUsage(func_def->uses, decl_loc_spelling.value());
// We don't actually need to know the return type, but we need to mark it
// as an interesting usage.
AddDeclTypeUsages(db, decl_cursor, true /*is_interesting*/,
@ -799,10 +796,13 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// TODO: support multiple definitions per function; right now we are
// hacking the 'declarations' field by
// adding a definition when we really don't have one.
if (decl->isDefinition && !func_def->def.definition.has_value())
func_def->def.definition = decl_loc.value();
else
func_def->declarations.push_back(decl_loc.value());
if (decl->isDefinition && !func_def->def.definition_extent.has_value()) {
func_def->def.definition_spelling = db->id_cache.ForceResolveSpelling(decl->cursor, false /*interesting*/);
func_def->def.definition_extent = db->id_cache.ForceResolveExtent(decl->cursor, false /*interesting*/);
}
else {
func_def->declarations.push_back(db->id_cache.ForceResolveSpelling(decl->cursor, false /*interesting*/));
}
// If decl_cursor != resolved, then decl_cursor is a template
// specialization. We
@ -837,7 +837,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// Mark a type reference at the ctor/dtor location.
// TODO: Should it be interesting?
if (is_ctor_or_dtor) {
Location type_usage_loc = decl_loc.value();
Range type_usage_loc = decl_loc_spelling.value();
AddUsage(declaring_type_def->uses, type_usage_loc);
}
@ -927,8 +927,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
case CXIdxEntity_Typedef:
case CXIdxEntity_CXXTypeAlias: {
optional<Location> decl_loc = db->id_cache.Resolve(decl->loc, true /*interesting*/);
if (!decl_loc)
optional<Range> decl_loc_spelling = db->id_cache.ResolveSpelling(decl->cursor, true /*interesting*/);
if (!decl_loc_spelling)
break;
// Note we want to fetch the first TypeRef. Running
@ -948,8 +948,9 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
type_def->def.qualified_name =
ns->QualifiedName(decl->semanticContainer, type_def->def.short_name);
type_def->def.definition = decl_loc.value().WithInteresting(false);
AddUsage(type_def->uses, decl_loc.value());
type_def->def.definition_spelling = db->id_cache.ResolveSpelling(decl->cursor, false /*interesting*/);
type_def->def.definition_extent = db->id_cache.ResolveExtent(decl->cursor, false /*interesting*/);
AddUsage(type_def->uses, decl_loc_spelling.value());
break;
}
@ -957,8 +958,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
case CXIdxEntity_Union:
case CXIdxEntity_Struct:
case CXIdxEntity_CXXClass: {
optional<Location> decl_loc = db->id_cache.Resolve(decl->loc, true /*interesting*/);
if (!decl_loc)
optional<Range> decl_loc_spelling = db->id_cache.ResolveSpelling(decl->cursor, true /*interesting*/);
if (!decl_loc_spelling)
break;
TypeId type_id = db->ToTypeId(decl->entityInfo->USR);
@ -986,8 +987,9 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// }
assert(decl->isDefinition);
type_def->def.definition = decl_loc.value().WithInteresting(false);
AddUsage(type_def->uses, decl_loc.value());
type_def->def.definition_spelling = db->id_cache.ResolveSpelling(decl->cursor, false /*interesting*/);
type_def->def.definition_extent = db->id_cache.ResolveExtent(decl->cursor, false /*interesting*/);
AddUsage(type_def->uses, decl_loc_spelling.value());
// type_def->alias_of
// type_def->funcs
@ -1023,7 +1025,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
std::cerr
<< "!! Unhandled indexDeclaration: "
<< clang::Cursor(decl->cursor).ToString() << " at "
<< db->id_cache.ForceResolve(decl->loc, false /*interesting*/).ToString()
<< db->id_cache.ForceResolveSpelling(decl->cursor, false /*interesting*/).start.ToString()
<< std::endl;
std::cerr << " entityInfo->kind = " << decl->entityInfo->kind
<< std::endl;
@ -1057,6 +1059,8 @@ bool IsFunction(CXCursorKind kind) {
void indexEntityReference(CXClientData client_data,
const CXIdxEntityRefInfo* ref) {
//assert(AreEqualLocations(ref->loc, ref->cursor));
// if (clang_Location_isInSystemHeader(clang_getCursorLocation(ref->cursor)) ||
// clang_Location_isInSystemHeader(
// clang_getCursorLocation(ref->referencedEntity->cursor)))
@ -1087,8 +1091,8 @@ void indexEntityReference(CXClientData client_data,
case CXIdxEntity_CXXStaticVariable:
case CXIdxEntity_Variable:
case CXIdxEntity_Field: {
optional<Location> loc = db->id_cache.Resolve(ref->loc, false /*interesting*/);
if (!loc)
optional<Range> loc_spelling = db->id_cache.ResolveSpelling(ref->cursor, false /*interesting*/);
if (!loc_spelling)
break;
clang::Cursor referenced = ref->referencedEntity->cursor;
@ -1096,7 +1100,7 @@ void indexEntityReference(CXClientData client_data,
VarId var_id = db->ToVarId(referenced.get_usr());
IndexedVarDef* var_def = db->Resolve(var_id);
AddUsage(var_def->uses, loc.value());
AddUsage(var_def->uses, loc_spelling.value());
break;
}
@ -1115,16 +1119,15 @@ void indexEntityReference(CXClientData client_data,
// int x = Gen();
// }
// Don't report duplicate usages.
// TODO: search full history?
optional<Location> loc = db->id_cache.Resolve(ref->loc, false /*interesting*/);
if (!loc)
optional<Range> loc_spelling = db->id_cache.ResolveSpelling(ref->cursor, false /*interesting*/);
if (!loc_spelling)
break;
// TODO: cleanup/remove this
if (param->last_func_usage_location == loc.value())
// Don't report duplicate usages.
if (param->last_func_usage_location == loc_spelling.value())
break;
param->last_func_usage_location = loc.value();
param->last_func_usage_location = loc_spelling.value();
// Note: be careful, calling db->ToFuncId invalidates the FuncDef* ptrs.
FuncId called_id = db->ToFuncId(ref->referencedEntity->USR);
@ -1133,12 +1136,12 @@ void indexEntityReference(CXClientData client_data,
IndexedFuncDef* caller_def = db->Resolve(caller_id);
IndexedFuncDef* called_def = db->Resolve(called_id);
caller_def->def.callees.push_back(FuncRef(called_id, loc.value()));
called_def->callers.push_back(FuncRef(caller_id, loc.value()));
AddUsage(called_def->uses, loc.value());
caller_def->def.callees.push_back(FuncRef(called_id, loc_spelling.value()));
called_def->callers.push_back(FuncRef(caller_id, loc_spelling.value()));
AddUsage(called_def->uses, loc_spelling.value());
} else {
IndexedFuncDef* called_def = db->Resolve(called_id);
AddUsage(called_def->uses, loc.value());
AddUsage(called_def->uses, loc_spelling.value());
}
// For constructor/destructor, also add a usage against the type. Clang
@ -1148,9 +1151,15 @@ void indexEntityReference(CXClientData client_data,
clang::Cursor ref_cursor = ref->cursor;
if (ref->referencedEntity->kind == CXIdxEntity_CXXConstructor ||
ref->referencedEntity->kind == CXIdxEntity_CXXDestructor) {
Location parent_loc = db->id_cache.ForceResolve(ref->parentEntity->cursor,
//CXFile file;
//unsigned int line, column, offset;
//clang_getSpellingLocation(clang_indexLoc_getCXSourceLocation(ref->loc), &file, &line, &column, &offset);
Range parent_loc = db->id_cache.ForceResolveSpelling(ref->parentEntity->cursor,
true /*interesting*/);
if (!parent_loc.IsEqualTo(loc.value())) {
if (parent_loc.start != loc_spelling->start) {
IndexedFuncDef* called_def = db->Resolve(called_id);
// I suspect it is possible for the declaring type to be null
// when the class is invalid.
@ -1158,7 +1167,7 @@ void indexEntityReference(CXClientData client_data,
// assert(called_def->def.declaring_type.has_value());
IndexedTypeDef* type_def =
db->Resolve(called_def->def.declaring_type.value());
AddUsage(type_def->uses, loc.value().WithInteresting(true));
AddUsage(type_def->uses, loc_spelling.value().WithInteresting(true), false /*insert_if_not_present*/);
}
}
}
@ -1171,8 +1180,8 @@ void indexEntityReference(CXClientData client_data,
case CXIdxEntity_Union:
case CXIdxEntity_Struct:
case CXIdxEntity_CXXClass: {
optional<Location> loc = db->id_cache.Resolve(ref->loc, false /*interesting*/);
if (!loc)
optional<Range> loc_spelling = db->id_cache.ResolveSpelling(ref->cursor, false /*interesting*/);
if (!loc_spelling)
break;
clang::Cursor referenced = ref->referencedEntity->cursor;
@ -1197,7 +1206,7 @@ void indexEntityReference(CXClientData client_data,
// Foo f;
// }
//
AddUsage(referenced_def->uses, loc.value());
AddUsage(referenced_def->uses, loc_spelling.value());
break;
}
@ -1205,7 +1214,7 @@ void indexEntityReference(CXClientData client_data,
std::cerr
<< "!! Unhandled indexEntityReference: " << cursor.ToString()
<< " at "
<< db->id_cache.ForceResolve(ref->loc, false /*interesting*/).ToString()
<< db->id_cache.ForceResolveSpelling(ref->cursor, false /*interesting*/).start.ToString()
<< std::endl;
std::cerr << " ref->referencedEntity->kind = "
<< ref->referencedEntity->kind << std::endl;
@ -1214,7 +1223,7 @@ void indexEntityReference(CXClientData client_data,
<< ref->parentEntity->kind << std::endl;
std::cerr
<< " ref->loc = "
<< db->id_cache.ForceResolve(ref->loc, false /*interesting*/).ToString()
<< db->id_cache.ForceResolveSpelling(ref->cursor, false /*interesting*/).start.ToString()
<< std::endl;
std::cerr << " ref->kind = " << ref->kind << std::endl;
if (ref->parentEntity)

View File

@ -1,7 +1,8 @@
#pragma once
#include "utils.h"
#include "position.h"
#include "serializer.h"
#include "utils.h"
#include "libclangmm/clangmm.h"
#include "libclangmm/Utility.h"
@ -50,173 +51,20 @@ bool operator==(const Id<T>& a, const Id<T>& b) {
}
struct _FakeFileType {};
using FileId = Id<_FakeFileType>;
using TypeId = Id<IndexedTypeDef>;
using FuncId = Id<IndexedFuncDef>;
using VarId = Id<IndexedVarDef>;
struct IdCache;
struct Location {
// TODO: cleanup types (make this type smaller).
bool interesting;
int64_t raw_file_id;
int32_t line;
int32_t column;
Location() {
interesting = false;
raw_file_id = -1;
line = -1;
column = -1;
}
Location(bool interesting, FileId file, int32_t line, int32_t column) {
this->interesting = interesting;
this->raw_file_id = file.id;
this->line = line;
this->column = column;
}
FileId file_id() const { return FileId(raw_file_id); }
explicit Location(const char* encoded) : Location() {
if (*encoded == '*') {
interesting = true;
++encoded;
}
assert(encoded);
raw_file_id = strtol(encoded, nullptr, 10);
while (*encoded && *encoded != ':')
++encoded;
if (*encoded == ':')
++encoded;
assert(encoded);
line = atoi(encoded);
while (*encoded && *encoded != ':')
++encoded;
if (*encoded == ':')
++encoded;
assert(encoded);
column = atoi(encoded);
}
std::string ToPrettyString(IdCache* id_cache);
std::string ToString() {
// Output looks like this:
//
// *1:2:3
//
// * => interesting
// 1 => file id
// 2 => line
// 3 => column
std::string result;
if (interesting)
result += '*';
result += std::to_string(raw_file_id);
result += ':';
result += std::to_string(line);
result += ':';
result += std::to_string(column);
return result;
}
// Compare two Locations and check if they are equal. Ignores the value of
// |interesting|.
// operator== doesn't seem to work properly...
bool IsEqualTo(const Location& o) const {
// When comparing, ignore the value of |interesting|.
return raw_file_id == o.raw_file_id && line == o.line && column == o.column;
}
bool operator==(const Location& o) const { return IsEqualTo(o); }
bool operator<(const Location& o) const {
return interesting < o.interesting && raw_file_id < o.raw_file_id &&
line < o.line && column < o.column;
}
Location WithInteresting(bool interesting) {
Location result = *this;
result.interesting = interesting;
return result;
}
};
#if false
// TODO: Move off of this weird wrapper, use struct with custom wrappers
// directly.
BEGIN_BITFIELD_TYPE(Location, uint64_t)
ADD_BITFIELD_MEMBER(interesting, /*start:*/ 0, /*len:*/ 1); // 2 values
ADD_BITFIELD_MEMBER(raw_file_group, /*start:*/ 1, /*len:*/ 4); // 16 values, ok if they wrap around.
ADD_BITFIELD_MEMBER(raw_file_id, /*start:*/ 5, /*len:*/ 25); // 33,554,432 values
ADD_BITFIELD_MEMBER(line, /*start:*/ 30, /*len:*/ 20); // 1,048,576 values
ADD_BITFIELD_MEMBER(column, /*start:*/ 50, /*len:*/ 14); // 16,384 values
Location(bool interesting, FileId file, uint32_t line, uint32_t column) {
this->interesting = interesting;
this->raw_file_group = file.group;
this->raw_file_id = file.id;
this->line = line;
this->column = column;
}
FileId file_id() {
return FileId(raw_file_id, raw_file_group);
}
std::string ToString() {
// Output looks like this:
//
// *1:2:3
//
// * => interesting
// 1 => file id
// 2 => line
// 3 => column
std::string result;
if (interesting)
result += '*';
result += std::to_string(raw_file_id);
result += ':';
result += std::to_string(line);
result += ':';
result += std::to_string(column);
return result;
}
// Compare two Locations and check if they are equal. Ignores the value of
// |interesting|.
// operator== doesn't seem to work properly...
bool IsEqualTo(const Location& o) {
// When comparing, ignore the value of |interesting|.
return (wrapper.value >> 1) == (o.wrapper.value >> 1);
}
Location WithInteresting(bool interesting) {
Location result = *this;
result.interesting = interesting;
return result;
}
END_BITFIELD_TYPE()
#endif
template <typename T>
struct Ref {
Id<T> id;
Location loc;
Range loc;
Ref() {} // For serialization.
Ref(Id<T> id, Location loc) : id(id), loc(loc) {}
Ref(Id<T> id, Range loc) : id(id), loc(loc) {}
bool operator==(const Ref<T>& other) {
return id == other.id && loc == other.loc;
@ -245,10 +93,11 @@ using VarRef = Ref<IndexedVarDef>;
// TODO: Either eliminate the defs created as a by-product of cross-referencing,
// or do not emit things we don't have definitions for.
template <typename TypeId = TypeId,
typename FuncId = FuncId,
typename VarId = VarId,
typename Location = Location>
template <typename TypeId,
typename FuncId,
typename VarId,
typename Position,
typename Range>
struct TypeDefDefinitionData {
// General metadata.
std::string usr;
@ -264,7 +113,17 @@ struct TypeDefDefinitionData {
// It's also difficult to identify a `class Foo;` statement with the clang
// indexer API (it's doable using cursor AST traversal), so we don't bother
// supporting the feature.
optional<Location> definition;
optional<Position> definition_spelling;
optional<Range> definition_extent;
// TODO: change |definition| to be a Position, and have an |extents| field which
// stores the range of the definition body. Also do this for methods.
// TODO: cleanup Range, Position, etc to take less memory. Model vscode api of
// Location, Range, Position.
// TODO: drop paths from everything in the index. We never store things outside
// of the main file.
// TODO: fix tests, the change to ranges is breaking them. Breaking currently
// coming from marking
// If set, then this is the same underlying type as the given value (ie, this
// type comes from a using or typedef statement).
@ -281,16 +140,18 @@ struct TypeDefDefinitionData {
TypeDefDefinitionData() {} // For reflection.
TypeDefDefinitionData(const std::string& usr) : usr(usr) {}
bool operator==(const TypeDefDefinitionData<TypeId, FuncId, VarId, Location>&
bool operator==(const TypeDefDefinitionData<TypeId, FuncId, VarId, Position, Range>&
other) const {
return usr == other.usr && short_name == other.short_name &&
qualified_name == other.qualified_name &&
definition == other.definition && alias_of == other.alias_of &&
definition_spelling == other.definition_spelling &&
definition_extent == other.definition_extent &&
alias_of == other.alias_of &&
parents == other.parents && types == other.types &&
funcs == other.funcs && vars == other.vars;
}
bool operator!=(const TypeDefDefinitionData<TypeId, FuncId, VarId, Location>&
bool operator!=(const TypeDefDefinitionData<TypeId, FuncId, VarId, Position, Range>&
other) const {
return !(*this == other);
}
@ -299,9 +160,10 @@ template <typename TVisitor,
typename TypeId,
typename FuncId,
typename VarId,
typename Location>
typename Position,
typename Range>
void Reflect(TVisitor& visitor,
TypeDefDefinitionData<TypeId, FuncId, VarId, Location>& value) {
TypeDefDefinitionData<TypeId, FuncId, VarId, Position, Range>& value) {
REFLECT_MEMBER_START();
REFLECT_MEMBER(usr);
REFLECT_MEMBER(short_name);
@ -316,7 +178,8 @@ void Reflect(TVisitor& visitor,
}
struct IndexedTypeDef {
TypeDefDefinitionData<> def;
using Def = TypeDefDefinitionData<TypeId, FuncId, VarId, Range, Range>;
Def def;
TypeId id;
@ -330,7 +193,7 @@ struct IndexedTypeDef {
// Every usage, useful for things like renames.
// NOTE: Do not insert directly! Use AddUsage instead.
std::vector<Location> uses;
std::vector<Range> uses;
IndexedTypeDef() : def("") {} // For serialization
@ -338,7 +201,8 @@ struct IndexedTypeDef {
bool HasInterestingState() const {
return
def.definition ||
def.definition_spelling ||
def.definition_extent ||
!derived.empty() ||
!instantiations.empty() ||
!uses.empty();
@ -351,17 +215,19 @@ struct IndexedTypeDef {
MAKE_HASHABLE(IndexedTypeDef, t.def.usr);
template <typename TypeId = TypeId,
typename FuncId = FuncId,
typename VarId = VarId,
typename FuncRef = FuncRef,
typename Location = Location>
template <typename TypeId,
typename FuncId,
typename VarId,
typename FuncRef,
typename Position,
typename Range>
struct FuncDefDefinitionData {
// General metadata.
std::string usr;
std::string short_name;
std::string qualified_name;
optional<Location> definition;
optional<Position> definition_spelling;
optional<Range> definition_extent;
// Type which declares this one (ie, it is a method)
optional<TypeId> declaring_type;
@ -381,16 +247,17 @@ struct FuncDefDefinitionData {
}
bool operator==(
const FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Location>&
const FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Position, Range>&
other) const {
return usr == other.usr && short_name == other.short_name &&
qualified_name == other.qualified_name &&
definition == other.definition &&
definition_spelling == other.definition_spelling &&
definition_extent == other.definition_extent &&
declaring_type == other.declaring_type && base == other.base &&
locals == other.locals && callees == other.callees;
}
bool operator!=(
const FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Location>&
const FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Position, Range>&
other) const {
return !(*this == other);
}
@ -401,10 +268,11 @@ template <typename TVisitor,
typename FuncId,
typename VarId,
typename FuncRef,
typename Location>
typename Position,
typename Range>
void Reflect(
TVisitor& visitor,
FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Location>& value) {
FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Position, Range>& value) {
REFLECT_MEMBER_START();
REFLECT_MEMBER(usr);
REFLECT_MEMBER(short_name);
@ -418,12 +286,13 @@ void Reflect(
}
struct IndexedFuncDef {
FuncDefDefinitionData<> def;
using Def = FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Range, Range>;
Def def;
FuncId id;
// Places the function is forward-declared.
std::vector<Location> declarations;
std::vector<Range> declarations;
// Methods which directly override this one.
std::vector<FuncId> derived;
@ -437,7 +306,7 @@ struct IndexedFuncDef {
std::vector<FuncRef> callers;
// All usages. For interesting usages, see callees.
std::vector<Location> uses;
std::vector<Range> uses;
IndexedFuncDef() {} // For reflection.
IndexedFuncDef(FuncId id, const std::string& usr) : def(usr), id(id) {
@ -446,7 +315,8 @@ struct IndexedFuncDef {
bool HasInterestingState() const {
return
def.definition ||
def.definition_spelling ||
def.definition_extent ||
!def.callees.empty() ||
!declarations.empty() ||
!derived.empty() ||
@ -460,19 +330,21 @@ struct IndexedFuncDef {
};
MAKE_HASHABLE(IndexedFuncDef, t.def.usr);
template <typename TypeId = TypeId,
typename FuncId = FuncId,
typename VarId = VarId,
typename Location = Location>
template <typename TypeId,
typename FuncId,
typename VarId,
typename Position,
typename Range>
struct VarDefDefinitionData {
// General metadata.
std::string usr;
std::string short_name;
std::string qualified_name;
optional<Location> declaration;
// TODO: definitions should be a list of locations, since there can be more
// than one.
optional<Location> definition;
optional<Range> declaration;
// TODO: definitions should be a list of ranges, since there can be more
// than one - when??
optional<Position> definition_spelling;
optional<Range> definition_extent;
// Type of the variable.
optional<TypeId> variable_type;
@ -483,15 +355,17 @@ struct VarDefDefinitionData {
VarDefDefinitionData() {} // For reflection.
VarDefDefinitionData(const std::string& usr) : usr(usr) {}
bool operator==(const VarDefDefinitionData<TypeId, FuncId, VarId, Location>&
bool operator==(const VarDefDefinitionData<TypeId, FuncId, VarId, Position, Range>&
other) const {
return usr == other.usr && short_name == other.short_name &&
qualified_name == other.qualified_name &&
declaration == other.declaration && definition == other.definition &&
declaration == other.declaration &&
definition_spelling == other.definition_spelling &&
definition_extent == other.definition_extent &&
variable_type == other.variable_type &&
declaring_type == other.declaring_type;
}
bool operator!=(const VarDefDefinitionData<TypeId, FuncId, VarId, Location>&
bool operator!=(const VarDefDefinitionData<TypeId, FuncId, VarId, Position, Range>&
other) const {
return !(*this == other);
}
@ -501,26 +375,29 @@ template <typename TVisitor,
typename TypeId,
typename FuncId,
typename VarId,
typename Location>
typename Position,
typename Range>
void Reflect(TVisitor& visitor,
VarDefDefinitionData<TypeId, FuncId, VarId, Location>& value) {
VarDefDefinitionData<TypeId, FuncId, VarId, Position, Range>& value) {
REFLECT_MEMBER_START();
REFLECT_MEMBER(usr);
REFLECT_MEMBER(short_name);
REFLECT_MEMBER(qualified_name);
REFLECT_MEMBER(definition);
REFLECT_MEMBER(definition_spelling);
REFLECT_MEMBER(definition_extent);
REFLECT_MEMBER(variable_type);
REFLECT_MEMBER(declaring_type);
REFLECT_MEMBER_END();
}
struct IndexedVarDef {
VarDefDefinitionData<> def;
using Def = VarDefDefinitionData<TypeId, FuncId, VarId, Range, Range>;
Def def;
VarId id;
// Usages.
std::vector<Location> uses;
std::vector<Range> uses;
IndexedVarDef() : def("") {} // For serialization
@ -530,7 +407,8 @@ struct IndexedVarDef {
bool HasInterestingState() const {
return
def.definition ||
def.definition_spelling ||
def.definition_extent ||
!uses.empty();
}
@ -542,23 +420,24 @@ MAKE_HASHABLE(IndexedVarDef, t.def.usr);
struct IdCache {
std::string primary_file;
std::unordered_map<std::string, FileId> file_path_to_file_id;
std::unordered_map<std::string, TypeId> usr_to_type_id;
std::unordered_map<std::string, FuncId> usr_to_func_id;
std::unordered_map<std::string, VarId> usr_to_var_id;
std::unordered_map<FileId, std::string> file_id_to_file_path;
std::unordered_map<TypeId, std::string> type_id_to_usr;
std::unordered_map<FuncId, std::string> func_id_to_usr;
std::unordered_map<VarId, std::string> var_id_to_usr;
IdCache(const std::string& primary_file);
Location ForceResolve(const CXSourceLocation& cx_loc, bool interesting);
Location ForceResolve(const CXIdxLoc& cx_idx_loc, bool interesting);
Location ForceResolve(const CXCursor& cx_cursor, bool interesting);
optional<Location> Resolve(const CXSourceLocation& cx_loc, bool interesting);
optional<Location> Resolve(const CXIdxLoc& cx_idx_loc, bool interesting);
optional<Location> Resolve(const CXCursor& cx_cursor, bool interesting);
optional<Location> Resolve(const clang::Cursor& cursor, bool interesting);
Range ForceResolve(const CXSourceRange& range, bool interesting);
Range ForceResolveSpelling(const CXCursor& cx_cursor, bool interesting);
optional<Range> ResolveSpelling(const CXCursor& cx_cursor, bool interesting);
optional<Range> ResolveSpelling(const clang::Cursor& cursor, bool interesting);
Range ForceResolveExtent(const CXCursor& cx_cursor, bool interesting);
optional<Range> ResolveExtent(const CXCursor& cx_cursor, bool interesting);
optional<Range> ResolveExtent(const clang::Cursor& cursor, bool interesting);
};
struct IndexedFile {

View File

@ -166,7 +166,7 @@ bool lsPosition::operator==(const lsPosition& other) const {
}
lsRange::lsRange() {}
lsRange::lsRange(lsPosition position) : start(position), end(position) {}
lsRange::lsRange(lsPosition start, lsPosition end) : start(start), end(end) {}
bool lsRange::operator==(const lsRange& other) const {
return start == other.start && end == other.end;

View File

@ -239,7 +239,7 @@ MAKE_REFLECT_STRUCT(lsPosition, line, character);
struct lsRange {
lsRange();
lsRange(lsPosition position);
lsRange(lsPosition start, lsPosition end);
bool operator==(const lsRange& other) const;

126
src/position.cc Normal file
View File

@ -0,0 +1,126 @@
#include "position.h"
Position::Position() {}
Position::Position(bool interesting, int32_t line, int32_t column)
: interesting(interesting), line(line), column(column) {}
Position::Position(const char* encoded) {
if (*encoded == '*') {
interesting = true;
++encoded;
}
assert(encoded);
line = atoi(encoded);
while (*encoded && *encoded != ':')
++encoded;
if (*encoded == ':')
++encoded;
assert(encoded);
column = atoi(encoded);
}
std::string Position::ToString() {
// Output looks like this:
//
// *1:2
//
// * => interesting
// 1 => line
// 2 => column
std::string result;
if (interesting)
result += '*';
result += std::to_string(line);
result += ':';
result += std::to_string(column);
return result;
}
std::string Position::ToPrettyString(const std::string& filename) {
// Output looks like this:
//
// *1:2
//
// * => interesting
// 1 => line
// 2 => column
std::string result;
if (interesting)
result += '*';
result += filename;
result += ':';
result += std::to_string(line);
result += ':';
result += std::to_string(column);
return result;
}
Position Position::WithInteresting(bool interesting) {
Position result = *this;
result.interesting = interesting;
return result;
}
bool Position::operator==(const Position& that) const {
return line == that.line && column == that.column;
}
bool Position::operator!=(const Position& that) const { return !(*this == that); }
bool Position::operator<(const Position& that) const {
return interesting < that.interesting && line < that.line && column < that.column;
}
Range::Range() {}
Range::Range(Position start, Position end) : start(start), end(end) {}
Range::Range(const char* encoded) : start(encoded) {
end = start;
/*
assert(encoded);
while (*encoded && *encoded != '-')
++encoded;
if (*encoded == '-')
++encoded;
end.line = atoi(encoded);
assert(encoded);
while (*encoded && *encoded != ':')
++encoded;
if (*encoded == ':')
++encoded;
end.column = atoi(encoded);
*/
}
std::string Range::ToString() {
std::string output;
output += start.ToString();
/*
output += "-";
output += std::to_string(end.line);
output += ":";
output += std::to_string(end.column);
*/
return output;
}
Range Range::WithInteresting(bool interesting) {
return Range(start.WithInteresting(interesting), end.WithInteresting(interesting));
}
bool Range::operator==(const Range& that) const {
return start == that.start && end == that.end;
}
bool Range::operator!=(const Range& that) const { return !(*this == that); }
bool Range::operator<(const Range& that) const {
return start < that.start;// || end < that.end;
}

42
src/position.h Normal file
View File

@ -0,0 +1,42 @@
#pragma once
#include <cassert>
#include <cstdint>
#include <string>
struct Position {
bool interesting = false;
int32_t line = -1;
int32_t column = -1;
Position();
Position(bool interesting, int32_t line, int32_t column);
explicit Position(const char* encoded);
std::string ToString();
std::string ToPrettyString(const std::string& filename);
Position WithInteresting(bool interesting);
// Compare two Positions and check if they are equal. Ignores the value of
// |interesting|.
bool operator==(const Position& that) const;
bool operator!=(const Position& that) const;
bool operator<(const Position& that) const;
};
struct Range {
Position start;
Position end;
Range();
Range(Position start, Position end);
explicit Range(const char* encoded);
std::string ToString();
Range WithInteresting(bool interesting);
bool operator==(const Range& that) const;
bool operator!=(const Range& that) const;
bool operator<(const Range& that) const;
};

View File

@ -45,9 +45,10 @@ Usr MapIdToUsr(const IdCache& id_cache, const VarId& id) {
assert(id_cache.var_id_to_usr.find(id) != id_cache.var_id_to_usr.end());
return id_cache.var_id_to_usr.find(id)->second;
}
QueryableLocation MapIdToUsr(const IdCache& id_cache, const Location& id) {
assert(id.raw_file_id == 1);
return QueryableLocation(id_cache.primary_file, id.line, id.column, id.interesting);
QueryableRange MapIdToUsr(const IdCache& id_cache, const Range& id) {
QueryableLocation start(id_cache.primary_file, id.start.line, id.start.column, id.start.interesting);
QueryableLocation end(id_cache.primary_file, id.end.line, id.end.column, id.end.interesting);
return QueryableRange(start, end);
//assert(id_cache.file_id_to_file_path.find(id.file_id()) != id_cache.file_id_to_file_path.end());
//return QueryableLocation(id_cache.file_id_to_file_path.find(id.file_id())->second, id.line, id.column, id.interesting);
}
@ -80,18 +81,21 @@ std::vector<UsrRef> MapIdToUsr(const IdCache& id_cache, const std::vector<FuncRe
return result;
});
}
std::vector<QueryableLocation> MapIdToUsr(const IdCache& id_cache, const std::vector<Location>& ids) {
return Transform<Location, QueryableLocation>(ids, [&](Location id) {
assert(id_cache.file_id_to_file_path.find(id.file_id()) != id_cache.file_id_to_file_path.end());
return QueryableLocation(id_cache.file_id_to_file_path.find(id.file_id())->second, id.line, id.column, id.interesting);
std::vector<QueryableRange> MapIdToUsr(const IdCache& id_cache, const std::vector<Range>& ids) {
return Transform<Range, QueryableRange>(ids, [&](Range id) {
QueryableLocation start(id_cache.primary_file, id.start.line, id.start.column, id.start.interesting);
QueryableLocation end(id_cache.primary_file, id.end.line, id.end.column, id.end.interesting);
return QueryableRange(start, end);
});
}
QueryableTypeDef::DefUpdate MapIdToUsr(const IdCache& id_cache, const TypeDefDefinitionData<>& def) {
QueryableTypeDef::DefUpdate MapIdToUsr(const IdCache& id_cache, const IndexedTypeDef::Def& def) {
QueryableTypeDef::DefUpdate result(def.usr);
result.short_name = def.short_name;
result.qualified_name = def.qualified_name;
if (def.definition)
result.definition = MapIdToUsr(id_cache, def.definition.value());
if (def.definition_spelling)
result.definition_spelling = MapIdToUsr(id_cache, def.definition_spelling.value());
if (def.definition_extent)
result.definition_extent = MapIdToUsr(id_cache, def.definition_extent.value());
if (def.alias_of)
result.alias_of = MapIdToUsr(id_cache, def.alias_of.value());
result.parents = MapIdToUsr(id_cache, def.parents);
@ -100,12 +104,14 @@ QueryableTypeDef::DefUpdate MapIdToUsr(const IdCache& id_cache, const TypeDefDef
result.vars = MapIdToUsr(id_cache, def.vars);
return result;
}
QueryableFuncDef::DefUpdate MapIdToUsr(const IdCache& id_cache, const FuncDefDefinitionData<>& def) {
QueryableFuncDef::DefUpdate MapIdToUsr(const IdCache& id_cache, const IndexedFuncDef::Def& def) {
QueryableFuncDef::DefUpdate result(def.usr);
result.short_name = def.short_name;
result.qualified_name = def.qualified_name;
if (def.definition)
result.definition = MapIdToUsr(id_cache, def.definition.value());
if (def.definition_spelling)
result.definition_spelling = MapIdToUsr(id_cache, def.definition_spelling.value());
if (def.definition_extent)
result.definition_extent = MapIdToUsr(id_cache, def.definition_extent.value());
if (def.declaring_type)
result.declaring_type = MapIdToUsr(id_cache, def.declaring_type.value());
if (def.base)
@ -114,14 +120,16 @@ QueryableFuncDef::DefUpdate MapIdToUsr(const IdCache& id_cache, const FuncDefDef
result.callees = MapIdToUsr(id_cache, def.callees);
return result;
}
QueryableVarDef::DefUpdate MapIdToUsr(const IdCache& id_cache, const VarDefDefinitionData<>& def) {
QueryableVarDef::DefUpdate MapIdToUsr(const IdCache& id_cache, const IndexedVarDef::Def& def) {
QueryableVarDef::DefUpdate result(def.usr);
result.short_name = def.short_name;
result.qualified_name = def.qualified_name;
if (def.declaration)
result.declaration = MapIdToUsr(id_cache, def.declaration.value());
if (def.definition)
result.definition = MapIdToUsr(id_cache, def.definition.value());
if (def.definition_spelling)
result.definition_spelling = MapIdToUsr(id_cache, def.definition_spelling.value());
if (def.definition_extent)
result.definition_extent = MapIdToUsr(id_cache, def.definition_extent.value());
if (def.variable_type)
result.variable_type = MapIdToUsr(id_cache, def.variable_type.value());
if (def.declaring_type)
@ -139,57 +147,47 @@ QueryableFile::QueryableFile(const IndexedFile& indexed)
// std::cerr << "-" << entry.first << std::endl;
//assert(indexed.id_cache.file_path_to_file_id.find(indexed.path) !=
// indexed.id_cache.file_path_to_file_id.end());
auto it = indexed.id_cache.file_path_to_file_id.find(indexed.path);
if (it == indexed.id_cache.file_path_to_file_id.end()) {
// TODO: investigate
std::cerr << "!!! FIXME !!! Unable to find cached file " << indexed.path << std::endl;
return;
}
FileId local_file_id = it->second;
auto add_outline = [this, &indexed, local_file_id](Usr usr, Location location) {
if (location.file_id() == local_file_id)
outline.push_back(UsrRef(usr, MapIdToUsr(indexed.id_cache, location)));
auto add_outline = [this, &indexed](Usr usr, Range range) {
outline.push_back(UsrRef(usr, MapIdToUsr(indexed.id_cache, range)));
};
auto add_all_symbols = [this, &indexed, local_file_id](Usr usr, Location location) {
if (location.file_id() == local_file_id)
all_symbols.push_back(UsrRef(usr, MapIdToUsr(indexed.id_cache, location)));
auto add_all_symbols = [this, &indexed](Usr usr, Range range) {
all_symbols.push_back(UsrRef(usr, MapIdToUsr(indexed.id_cache, range)));
};
for (const IndexedTypeDef& def : indexed.types) {
if (def.def.definition.has_value()) {
add_outline(def.def.usr, def.def.definition.value());
add_all_symbols(def.def.usr, def.def.definition.value());
}
for (const Location& use : def.uses)
if (def.def.definition_spelling.has_value())
add_all_symbols(def.def.usr, def.def.definition_spelling.value());
if (def.def.definition_extent.has_value())
add_outline(def.def.usr, def.def.definition_extent.value());
for (const Range& use : def.uses)
add_all_symbols(def.def.usr, use);
}
for (const IndexedFuncDef& def : indexed.funcs) {
if (def.def.definition.has_value()) {
add_outline(def.def.usr, def.def.definition.value());
add_all_symbols(def.def.usr, def.def.definition.value());
}
for (Location decl : def.declarations) {
if (def.def.definition_spelling.has_value())
add_all_symbols(def.def.usr, def.def.definition_spelling.value());
if (def.def.definition_extent.has_value())
add_outline(def.def.usr, def.def.definition_extent.value());
for (Range decl : def.declarations) {
add_outline(def.def.usr, decl);
add_all_symbols(def.def.usr, decl);
}
for (const Location& use : def.uses)
for (const Range& use : def.uses)
add_all_symbols(def.def.usr, use);
}
for (const IndexedVarDef& def : indexed.vars) {
if (def.def.definition.has_value()) {
add_outline(def.def.usr, def.def.definition.value());
add_all_symbols(def.def.usr, def.def.definition.value());
}
for (const Location& use : def.uses)
if (def.def.definition_spelling.has_value())
add_all_symbols(def.def.usr, def.def.definition_spelling.value());
if (def.def.definition_extent.has_value())
add_outline(def.def.usr, def.def.definition_extent.value());
for (const Range& use : def.uses)
add_all_symbols(def.def.usr, use);
}
std::sort(outline.begin(), outline.end(), [](const UsrRef& a, const UsrRef& b) {
return a.loc < b.loc;
return a.loc.start < b.loc.start;
});
std::sort(all_symbols.begin(), all_symbols.end(), [](const UsrRef& a, const UsrRef& b) {
return a.loc < b.loc;
return a.loc.start < b.loc.start;
});
}
@ -459,7 +457,7 @@ IndexUpdate::IndexUpdate(IndexedFile& previous_file, IndexedFile& current_file)
types_def_changed.push_back(current_remapped_def);
PROCESS_UPDATE_DIFF(types_derived, derived, Usr);
PROCESS_UPDATE_DIFF(types_uses, uses, QueryableLocation);
PROCESS_UPDATE_DIFF(types_uses, uses, QueryableRange);
});
// Functions
@ -476,10 +474,10 @@ IndexUpdate::IndexUpdate(IndexedFile& previous_file, IndexedFile& current_file)
if (previous_remapped_def != current_remapped_def)
funcs_def_changed.push_back(current_remapped_def);
PROCESS_UPDATE_DIFF(funcs_declarations, declarations, QueryableLocation);
PROCESS_UPDATE_DIFF(funcs_declarations, declarations, QueryableRange);
PROCESS_UPDATE_DIFF(funcs_derived, derived, Usr);
PROCESS_UPDATE_DIFF(funcs_callers, callers, UsrRef);
PROCESS_UPDATE_DIFF(funcs_uses, uses, QueryableLocation);
PROCESS_UPDATE_DIFF(funcs_uses, uses, QueryableRange);
});
// Variables
@ -496,7 +494,7 @@ IndexUpdate::IndexUpdate(IndexedFile& previous_file, IndexedFile& current_file)
if (previous_remapped_def != current_remapped_def)
vars_def_changed.push_back(current_remapped_def);
PROCESS_UPDATE_DIFF(vars_uses, uses, QueryableLocation);
PROCESS_UPDATE_DIFF(vars_uses, uses, QueryableRange);
});
#undef PROCESS_UPDATE_DIFF
@ -596,7 +594,7 @@ void QueryableDatabase::Import(const std::vector<QueryableTypeDef>& defs) {
}
else {
QueryableTypeDef& existing = types[it->second.idx];
if (def.def.definition)
if (def.def.definition_extent)
existing.def = def.def;
AddRange(&existing.derived, def.derived);
AddRange(&existing.uses, def.uses);
@ -615,7 +613,7 @@ void QueryableDatabase::Import(const std::vector<QueryableFuncDef>& defs) {
}
else {
QueryableFuncDef& existing = funcs[it->second.idx];
if (def.def.definition)
if (def.def.definition_extent)
existing.def = def.def;
AddRange(&existing.callers, def.callers);
AddRange(&existing.declarations, def.declarations);
@ -636,7 +634,7 @@ void QueryableDatabase::Import(const std::vector<QueryableVarDef>& defs) {
}
else {
QueryableVarDef& existing = vars[it->second.idx];
if (def.def.definition)
if (def.def.definition_extent)
existing.def = def.def;
AddRange(&existing.uses, def.uses);
}

View File

@ -44,19 +44,41 @@ struct QueryableLocation {
};
MAKE_REFLECT_STRUCT(QueryableLocation, path, line, column, interesting);
struct QueryableRange {
QueryableLocation start;
QueryableLocation end;
QueryableRange() {}
QueryableRange(QueryableLocation start, QueryableLocation end) : start(start), end(end) {}
QueryableRange OffsetStartColumn(int offset) const {
return QueryableRange(start.OffsetColumn(offset), end);
}
bool operator==(const QueryableRange& other) const {
// Note: We ignore |is_interesting|.
return start == other.start && end == other.end;
}
bool operator!=(const QueryableRange& other) const { return !(*this == other); }
bool operator<(const QueryableRange& o) const {
return start < o.start;
}
};
MAKE_REFLECT_STRUCT(QueryableRange, start, end);
struct UsrRef {
Usr usr;
QueryableLocation loc;
QueryableRange loc;
UsrRef() {}
UsrRef(Usr usr, QueryableLocation loc) : usr(usr), loc(loc) {}
UsrRef(Usr usr, QueryableRange loc) : usr(usr), loc(loc) {}
bool operator==(const UsrRef& other) const {
return usr == other.usr && loc == other.loc;
return usr == other.usr && loc.start == other.loc.start;
}
bool operator!=(const UsrRef& other) const { return !(*this == other); }
bool operator<(const UsrRef& other) const {
return usr < other.usr && loc < other.loc;
return usr < other.usr && loc.start < other.loc.start;
}
};
MAKE_REFLECT_STRUCT(UsrRef, usr, loc);
@ -109,15 +131,15 @@ struct QueryableFile {
MAKE_REFLECT_STRUCT(QueryableFile, file_id, outline, all_symbols);
struct QueryableTypeDef {
using DefUpdate = TypeDefDefinitionData<Usr, Usr, Usr, QueryableLocation>;
using DefUpdate = TypeDefDefinitionData<Usr, Usr, Usr, QueryableRange, QueryableRange>;
using DerivedUpdate = MergeableUpdate<Usr>;
using InstantiationsUpdate = MergeableUpdate<Usr>;
using UsesUpdate = MergeableUpdate<QueryableLocation>;
using UsesUpdate = MergeableUpdate<QueryableRange>;
DefUpdate def;
std::vector<Usr> derived;
std::vector<Usr> instantiations;
std::vector<QueryableLocation> uses;
std::vector<QueryableRange> uses;
QueryableTypeDef() : def("") {} // For serialization.
QueryableTypeDef(IdCache& id_cache, const IndexedTypeDef& indexed);
@ -125,17 +147,17 @@ struct QueryableTypeDef {
MAKE_REFLECT_STRUCT(QueryableTypeDef, def, derived, instantiations, uses);
struct QueryableFuncDef {
using DefUpdate = FuncDefDefinitionData<Usr, Usr, Usr, UsrRef, QueryableLocation>;
using DeclarationsUpdate = MergeableUpdate<QueryableLocation>;
using DefUpdate = FuncDefDefinitionData<Usr, Usr, Usr, UsrRef, QueryableRange, QueryableRange>;
using DeclarationsUpdate = MergeableUpdate<QueryableRange>;
using DerivedUpdate = MergeableUpdate<Usr>;
using CallersUpdate = MergeableUpdate<UsrRef>;
using UsesUpdate = MergeableUpdate<QueryableLocation>;
using UsesUpdate = MergeableUpdate<QueryableRange>;
DefUpdate def;
std::vector<QueryableLocation> declarations;
std::vector<QueryableRange> declarations;
std::vector<Usr> derived;
std::vector<UsrRef> callers;
std::vector<QueryableLocation> uses;
std::vector<QueryableRange> uses;
QueryableFuncDef() : def("") {} // For serialization.
QueryableFuncDef(IdCache& id_cache, const IndexedFuncDef& indexed);
@ -143,11 +165,11 @@ struct QueryableFuncDef {
MAKE_REFLECT_STRUCT(QueryableFuncDef, def, declarations, derived, callers, uses);
struct QueryableVarDef {
using DefUpdate = VarDefDefinitionData<Usr, Usr, Usr, QueryableLocation>;
using UsesUpdate = MergeableUpdate<QueryableLocation>;
using DefUpdate = VarDefDefinitionData<Usr, Usr, Usr, QueryableRange, QueryableRange>;
using UsesUpdate = MergeableUpdate<QueryableRange>;
DefUpdate def;
std::vector<QueryableLocation> uses;
std::vector<QueryableRange> uses;
QueryableVarDef() : def("") {} // For serialization.
QueryableVarDef(IdCache& id_cache, const IndexedVarDef& indexed);

View File

@ -35,19 +35,25 @@ void ReflectMember(Writer& visitor, const char* name, std::string& value) {
}
// Location
void Reflect(Reader& visitor, Location& value) {
value = Location(visitor.GetString());
// Position
void Reflect(Reader& visitor, Position& value) {
value = Position(visitor.GetString());
}
void Reflect(Writer& visitor, Location& value) {
// We only ever want to emit id=1 files.
assert(value.raw_file_id == 1);
void Reflect(Writer& visitor, Position& value) {
std::string output = value.ToString();
visitor.String(output.c_str(), output.size());
}
// Range
void Reflect(Reader& visitor, Range& value) {
value = Range(visitor.GetString());
}
void Reflect(Writer& visitor, Range& value) {
std::string output = value.ToString();
visitor.String(output.c_str(), output.size());
}
// Id<T>
template<typename T>
void Reflect(Reader& visitor, Id<T>& id) {
@ -66,7 +72,7 @@ void Reflect(Reader& visitor, Ref<IndexedFuncDef>& value) {
const char* loc_string = strchr(str_value, '@') + 1;
value.id = Id<IndexedFuncDef>(id);
value.loc = Location(loc_string);
value.loc = Range(loc_string);
}
void Reflect(Writer& visitor, Ref<IndexedFuncDef>& value) {
std::string s = std::to_string(value.id.id) + "@" + value.loc.ToString();
@ -105,7 +111,9 @@ void Reflect(TVisitor& visitor, IndexedTypeDef& value) {
REFLECT_MEMBER2("usr", value.def.usr);
REFLECT_MEMBER2("short_name", value.def.short_name);
REFLECT_MEMBER2("qualified_name", value.def.qualified_name);
REFLECT_MEMBER2("definition", value.def.definition);
REFLECT_MEMBER2("definition", value.def.definition_spelling);
//REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling);
//REFLECT_MEMBER2("definition_extent", value.def.definition_extent);
REFLECT_MEMBER2("alias_of", value.def.alias_of);
REFLECT_MEMBER2("parents", value.def.parents);
REFLECT_MEMBER2("derived", value.derived);
@ -141,7 +149,9 @@ void Reflect(TVisitor& visitor, IndexedFuncDef& value) {
REFLECT_MEMBER2("short_name", value.def.short_name);
REFLECT_MEMBER2("qualified_name", value.def.qualified_name);
REFLECT_MEMBER2("declarations", value.declarations);
REFLECT_MEMBER2("definition", value.def.definition);
REFLECT_MEMBER2("definition", value.def.definition_spelling);
//REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling);
//REFLECT_MEMBER2("definition_extent", value.def.definition_extent);
REFLECT_MEMBER2("declaring_type", value.def.declaring_type);
REFLECT_MEMBER2("base", value.def.base);
REFLECT_MEMBER2("derived", value.derived);
@ -176,7 +186,9 @@ void Reflect(TVisitor& visitor, IndexedVarDef& value) {
REFLECT_MEMBER2("short_name", value.def.short_name);
REFLECT_MEMBER2("qualified_name", value.def.qualified_name);
REFLECT_MEMBER2("declaration", value.def.declaration);
REFLECT_MEMBER2("definition", value.def.definition);
REFLECT_MEMBER2("definition", value.def.definition_spelling);
//REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling);
//REFLECT_MEMBER2("definition_extent", value.def.definition_extent);
REFLECT_MEMBER2("variable_type", value.def.variable_type);
REFLECT_MEMBER2("declaring_type", value.def.declaring_type);
REFLECT_MEMBER2("uses", value.uses);

View File

@ -109,7 +109,7 @@ void RunTests() {
//if (path != "tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc") continue;
//if (path != "tests/multi_file/header.h") continue;
//if (path != "tests/multi_file/impl.cc") continue;
//if (path != "tests/inheritance/class_inherit_templated_parent.cc") continue;
//if (path != "tests/constructors/constructor.cc") continue;
//if (path != "tests/templates/implicit_variable_instantiation.cc") continue;
//if (path != "tests/_empty_test.cc") continue;

View File

@ -11,8 +11,8 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:3:7",
"uses": ["1:1:7", "1:2:7", "*1:3:7", "1:4:7"]
"definition": "3:7",
"uses": ["1:7", "2:7", "*3:7", "4:7"]
}]
}
*/

View File

@ -16,45 +16,45 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"funcs": [0],
"instantiations": [0, 1],
"uses": ["*1:1:7", "1:3:3", "*1:7:3", "*1:8:3", "*1:8:17"]
"uses": ["*1:7", "3:3", "*7:3", "*8:3", "*8:17"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@Foo#",
"short_name": "Foo",
"qualified_name": "Foo::Foo",
"definition": "1:3:3",
"definition": "3:3",
"declaring_type": 0,
"callers": ["1@1:7:7", "1@1:8:17"],
"uses": ["1:3:3", "1:7:7", "1:8:17"]
"callers": ["1@7:7", "1@8:17"],
"uses": ["3:3", "7:7", "8:17"]
}, {
"id": 1,
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:6:6",
"callees": ["0@1:7:7", "0@1:8:17"],
"uses": ["1:6:6"]
"definition": "6:6",
"callees": ["0@7:7", "0@8:17"],
"uses": ["6:6"]
}],
"vars": [{
"id": 0,
"usr": "c:constructor.cc@56@F@foo#@f",
"short_name": "f",
"qualified_name": "f",
"definition": "1:7:7",
"definition": "7:7",
"variable_type": 0,
"uses": ["1:7:7"]
"uses": ["7:7"]
}, {
"id": 1,
"usr": "c:constructor.cc@66@F@foo#@f2",
"short_name": "f2",
"qualified_name": "f2",
"definition": "1:8:8",
"definition": "8:8",
"variable_type": 0,
"uses": ["1:8:8"]
"uses": ["8:8"]
}]
}
*/

View File

@ -21,45 +21,45 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"funcs": [0, 1],
"instantiations": [0],
"uses": ["*1:1:7", "1:3:3", "1:4:3", "*1:8:3"]
"uses": ["*1:7", "3:3", "4:3", "*8:3"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@Foo#",
"short_name": "Foo",
"qualified_name": "Foo::Foo",
"definition": "1:3:3",
"definition": "3:3",
"declaring_type": 0,
"callers": ["2@1:8:7"],
"uses": ["1:3:3", "1:8:7"]
"callers": ["2@8:7"],
"uses": ["3:3", "8:7"]
}, {
"id": 1,
"usr": "c:@S@Foo@F@~Foo#",
"short_name": "~Foo",
"qualified_name": "Foo::~Foo",
"definition": "1:4:3",
"definition": "4:3",
"declaring_type": 0,
"uses": ["1:4:3"]
"uses": ["4:3"]
}, {
"id": 2,
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:7:6",
"callees": ["0@1:8:7"],
"uses": ["1:7:6"]
"definition": "7:6",
"callees": ["0@8:7"],
"uses": ["7:6"]
}],
"vars": [{
"id": 0,
"usr": "c:destructor.cc@70@F@foo#@f",
"short_name": "f",
"qualified_name": "f",
"definition": "1:8:7",
"definition": "8:7",
"variable_type": 0,
"uses": ["1:8:7"]
"uses": ["8:7"]
}]
}
*/

View File

@ -11,18 +11,18 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:8",
"definition": "1:8",
"funcs": [0],
"uses": ["*1:1:8", "1:4:6", "1:4:1"]
"uses": ["*1:8", "4:6", "4:1"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@FT@>1#TFoo#v#",
"short_name": "Foo",
"qualified_name": "Foo::Foo",
"definition": "1:4:6",
"definition": "4:6",
"declaring_type": 0,
"uses": ["1:4:6"]
"uses": ["4:6"]
}]
}
*/

View File

@ -13,8 +13,8 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:3:7",
"uses": ["1:1:7", "1:2:7", "*1:3:7", "1:4:7"]
"definition": "3:7",
"uses": ["1:7", "2:7", "*3:7", "4:7"]
}]
}
*/

View File

@ -10,18 +10,18 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"vars": [0],
"uses": ["*1:1:7"]
"uses": ["*1:7"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@FI@foo",
"short_name": "foo",
"qualified_name": "Foo::foo",
"definition": "1:2:7",
"definition": "2:7",
"declaring_type": 0,
"uses": ["1:2:7"]
"uses": ["2:7"]
}]
}
*/

View File

@ -12,19 +12,19 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"vars": [0],
"uses": ["*1:1:7", "1:5:5"]
"uses": ["*1:7", "5:5"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@foo",
"short_name": "foo",
"qualified_name": "Foo::foo",
"declaration": "1:2:14",
"definition": "1:5:10",
"declaration": "2:14",
"definition": "5:10",
"declaring_type": 0,
"uses": ["1:2:14", "1:5:10"]
"uses": ["2:14", "5:10"]
}]
}
*/

View File

@ -12,9 +12,9 @@ OUTPUT:
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"declarations": ["1:1:6", "1:2:6", "1:4:6"],
"definition": "1:3:6",
"uses": ["1:1:6", "1:2:6", "1:3:6", "1:4:6"]
"declarations": ["1:6", "2:6", "4:6"],
"definition": "3:6",
"uses": ["1:6", "2:6", "3:6", "4:6"]
}]
}

View File

@ -14,35 +14,35 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"funcs": [0, 1, 2],
"uses": ["*1:1:7", "1:7:6"]
"uses": ["*1:7", "7:6"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@declonly#",
"short_name": "declonly",
"qualified_name": "Foo::declonly",
"declarations": ["1:2:8"],
"declarations": ["2:8"],
"declaring_type": 0,
"uses": ["1:2:8"]
"uses": ["2:8"]
}, {
"id": 1,
"usr": "c:@S@Foo@F@purevirtual#",
"short_name": "purevirtual",
"qualified_name": "Foo::purevirtual",
"declarations": ["1:3:16"],
"declarations": ["3:16"],
"declaring_type": 0,
"uses": ["1:3:16"]
"uses": ["3:16"]
}, {
"id": 2,
"usr": "c:@S@Foo@F@def#",
"short_name": "def",
"qualified_name": "Foo::def",
"declarations": ["1:4:8"],
"definition": "1:7:11",
"declarations": ["4:8"],
"definition": "7:11",
"declaring_type": 0,
"uses": ["1:4:8", "1:7:11"]
"uses": ["4:8", "7:11"]
}]
}
*/

View File

@ -11,28 +11,28 @@ OUTPUT:
"usr": "c:@E@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:12",
"definition": "1:12",
"vars": [0, 1],
"uses": ["*1:1:12"]
"uses": ["*1:12"]
}],
"vars": [{
"id": 0,
"usr": "c:@E@Foo@A",
"short_name": "A",
"qualified_name": "Foo::A",
"definition": "1:2:3",
"definition": "2:3",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:2:3"]
"uses": ["2:3"]
}, {
"id": 1,
"usr": "c:@E@Foo@B",
"short_name": "B",
"qualified_name": "Foo::B",
"definition": "1:3:3",
"definition": "3:3",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:3:3"]
"uses": ["3:3"]
}]
}
*/

View File

@ -11,28 +11,28 @@ OUTPUT:
"usr": "c:@E@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:6",
"definition": "1:6",
"vars": [0, 1],
"uses": ["*1:1:6"]
"uses": ["*1:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@E@Foo@A",
"short_name": "A",
"qualified_name": "Foo::A",
"definition": "1:2:3",
"definition": "2:3",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:2:3"]
"uses": ["2:3"]
}, {
"id": 1,
"usr": "c:@E@Foo@B",
"short_name": "B",
"qualified_name": "Foo::B",
"definition": "1:3:3",
"definition": "3:3",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:3:3"]
"uses": ["3:3"]
}]
}
*/

View File

@ -11,28 +11,28 @@ OUTPUT:
"usr": "c:@E@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:6",
"definition": "1:6",
"vars": [0, 1],
"uses": ["*1:1:6"]
"uses": ["*1:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@E@Foo@A",
"short_name": "A",
"qualified_name": "Foo::A",
"definition": "1:2:3",
"definition": "2:3",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:2:3"]
"uses": ["2:3"]
}, {
"id": 1,
"usr": "c:@E@Foo@B",
"short_name": "B",
"qualified_name": "Foo::B",
"definition": "1:3:3",
"definition": "3:3",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:3:3"]
"uses": ["3:3"]
}]
}
*/

View File

@ -13,37 +13,37 @@ OUTPUT:
"usr": "c:@E@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:12",
"definition": "1:12",
"vars": [0, 1],
"instantiations": [2],
"uses": ["*1:1:12", "*1:6:1", "1:6:9"]
"uses": ["*1:12", "*6:1", "6:9"]
}],
"vars": [{
"id": 0,
"usr": "c:@E@Foo@A",
"short_name": "A",
"qualified_name": "Foo::A",
"definition": "1:2:3",
"definition": "2:3",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:2:3", "1:6:14"]
"uses": ["2:3", "6:14"]
}, {
"id": 1,
"usr": "c:@E@Foo@B",
"short_name": "B",
"qualified_name": "Foo::B",
"definition": "1:3:3",
"definition": "3:3",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:3:3"]
"uses": ["3:3"]
}, {
"id": 2,
"usr": "c:@x",
"short_name": "x",
"qualified_name": "x",
"definition": "1:6:5",
"definition": "6:5",
"variable_type": 0,
"uses": ["1:6:5"]
"uses": ["6:5"]
}]
}
*/

View File

@ -16,48 +16,48 @@ OUTPUT:
"usr": "c:@E@A",
"short_name": "A",
"qualified_name": "A",
"definition": "1:1:6",
"uses": ["*1:1:6", "*1:9:5"]
"definition": "1:6",
"uses": ["*1:6", "*9:5"]
}, {
"id": 1,
"usr": "c:@E@B",
"short_name": "B",
"qualified_name": "B",
"definition": "1:2:6",
"uses": ["*1:2:6", "*1:10:5"]
"definition": "2:6",
"uses": ["*2:6", "*10:5"]
}, {
"id": 2,
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:5:8",
"definition": "5:8",
"instantiations": [1],
"uses": ["*1:5:8", "*1:9:1", "*1:10:1"]
"uses": ["*5:8", "*9:1", "*10:1"]
}, {
"id": 3,
"usr": "c:@ST>1#T@Foo@S@Inner",
"short_name": "Inner",
"qualified_name": "Foo::Inner",
"definition": "1:6:10",
"definition": "6:10",
"instantiations": [0],
"uses": ["*1:6:10", "*1:9:9"]
"uses": ["*6:10", "*9:9"]
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:9:15",
"definition": "9:15",
"variable_type": 3,
"uses": ["1:9:15"]
"uses": ["9:15"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:10:8",
"definition": "10:8",
"variable_type": 2,
"uses": ["1:10:8"]
"uses": ["10:8"]
}]
}

View File

@ -8,8 +8,8 @@ OUTPUT:
"usr": "c:@F@foo#I#I#",
"short_name": "foo",
"qualified_name": "foo",
"declarations": ["1:1:6"],
"uses": ["1:1:6"]
"declarations": ["1:6"],
"uses": ["1:6"]
}]
}
*/

View File

@ -10,9 +10,9 @@ OUTPUT:
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"declarations": ["1:1:6"],
"definition": "1:3:6",
"uses": ["1:1:6", "1:3:6"]
"declarations": ["1:6"],
"definition": "3:6",
"uses": ["1:6", "3:6"]
}]
}
*/

View File

@ -8,8 +8,8 @@ OUTPUT:
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:1:6",
"uses": ["1:1:6"]
"definition": "1:6",
"uses": ["1:6"]
}]
}
*/

View File

@ -9,17 +9,17 @@ OUTPUT:
"usr": "c:@S@Parent",
"short_name": "Parent",
"qualified_name": "Parent",
"definition": "1:1:7",
"definition": "1:7",
"derived": [1],
"uses": ["*1:1:7", "*1:2:24"]
"uses": ["*1:7", "*2:24"]
}, {
"id": 1,
"usr": "c:@S@Derived",
"short_name": "Derived",
"qualified_name": "Derived",
"definition": "1:2:7",
"definition": "2:7",
"parents": [0],
"uses": ["*1:2:7"]
"uses": ["*2:7"]
}]
}
*/

View File

@ -20,47 +20,47 @@ OUTPUT:
"usr": "c:@ST>1#Ni@Base1",
"short_name": "Base1",
"qualified_name": "Base1",
"definition": "1:2:7",
"definition": "2:7",
"derived": [2, 5],
"uses": ["*1:2:7", "*1:8:18", "*1:13:17"]
"uses": ["*2:7", "*8:18", "*13:17"]
}, {
"id": 1,
"usr": "c:@ST>1#T@Base2",
"short_name": "Base2",
"qualified_name": "Base2",
"definition": "1:5:7",
"definition": "5:7",
"derived": [3, 5],
"uses": ["*1:5:7", "*1:11:18", "*1:13:27"]
"uses": ["*5:7", "*11:18", "*13:27"]
}, {
"id": 2,
"usr": "c:@ST>1#Ni@Derived1",
"short_name": "Derived1",
"qualified_name": "Derived1",
"definition": "1:8:7",
"definition": "8:7",
"parents": [0],
"derived": [5],
"uses": ["*1:8:7", "*1:13:43"]
"uses": ["*8:7", "*13:43"]
}, {
"id": 3,
"usr": "c:@ST>1#T@Derived2",
"short_name": "Derived2",
"qualified_name": "Derived2",
"definition": "1:11:7",
"definition": "11:7",
"parents": [1],
"derived": [5],
"uses": ["*1:11:7", "*1:13:56"]
"uses": ["*11:7", "*13:56"]
}, {
"id": 4,
"usr": "c:class_inherit_templated_parent.cc@154",
"uses": ["*1:11:24"]
"uses": ["*11:24"]
}, {
"id": 5,
"usr": "c:@S@Derived",
"short_name": "Derived",
"qualified_name": "Derived",
"definition": "1:13:7",
"definition": "13:7",
"parents": [0, 1, 2, 3],
"uses": ["*1:13:7", "*1:13:33", "*1:13:65"]
"uses": ["*13:7", "*13:33", "*13:65"]
}]
}
*/

View File

@ -11,35 +11,35 @@ OUTPUT:
"usr": "c:@S@Root",
"short_name": "Root",
"qualified_name": "Root",
"definition": "1:1:7",
"definition": "1:7",
"derived": [1, 2],
"uses": ["*1:1:7", "*1:2:24", "*1:3:24"]
"uses": ["*1:7", "*2:24", "*3:24"]
}, {
"id": 1,
"usr": "c:@S@MiddleA",
"short_name": "MiddleA",
"qualified_name": "MiddleA",
"definition": "1:2:7",
"definition": "2:7",
"parents": [0],
"derived": [3],
"uses": ["*1:2:7", "*1:4:24"]
"uses": ["*2:7", "*4:24"]
}, {
"id": 2,
"usr": "c:@S@MiddleB",
"short_name": "MiddleB",
"qualified_name": "MiddleB",
"definition": "1:3:7",
"definition": "3:7",
"parents": [0],
"derived": [3],
"uses": ["*1:3:7", "*1:4:40"]
"uses": ["*3:7", "*4:40"]
}, {
"id": 3,
"usr": "c:@S@Derived",
"short_name": "Derived",
"qualified_name": "Derived",
"definition": "1:4:7",
"definition": "4:7",
"parents": [1, 2],
"uses": ["*1:4:7"]
"uses": ["*4:7"]
}]
}
*/

View File

@ -13,38 +13,38 @@ OUTPUT:
"usr": "c:@S@Root",
"short_name": "Root",
"qualified_name": "Root",
"definition": "1:1:7",
"definition": "1:7",
"derived": [1],
"funcs": [0],
"uses": ["*1:1:7", "*1:4:24"]
"uses": ["*1:7", "*4:24"]
}, {
"id": 1,
"usr": "c:@S@Derived",
"short_name": "Derived",
"qualified_name": "Derived",
"definition": "1:4:7",
"definition": "4:7",
"parents": [0],
"funcs": [1],
"uses": ["*1:4:7"]
"uses": ["*4:7"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Root@F@foo#",
"short_name": "foo",
"qualified_name": "Root::foo",
"declarations": ["1:2:16"],
"declarations": ["2:16"],
"declaring_type": 0,
"derived": [1],
"uses": ["1:2:16"]
"uses": ["2:16"]
}, {
"id": 1,
"usr": "c:@S@Derived@F@foo#",
"short_name": "foo",
"qualified_name": "Derived::foo",
"definition": "1:5:8",
"definition": "5:8",
"declaring_type": 1,
"base": 0,
"uses": ["1:5:8"]
"uses": ["5:8"]
}]
}
*/

View File

@ -10,18 +10,18 @@ OUTPUT:
"usr": "c:@S@IFoo",
"short_name": "IFoo",
"qualified_name": "IFoo",
"definition": "1:1:7",
"definition": "1:7",
"funcs": [0],
"uses": ["*1:1:7"]
"uses": ["*1:7"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@IFoo@F@foo#",
"short_name": "foo",
"qualified_name": "IFoo::foo",
"definition": "1:2:16",
"definition": "2:16",
"declaring_type": 0,
"uses": ["1:2:16"]
"uses": ["2:16"]
}]
}
*/

View File

@ -14,18 +14,18 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"funcs": [0],
"uses": ["*1:1:7"]
"uses": ["*1:7"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@foo#",
"short_name": "foo",
"qualified_name": "Foo::foo",
"declarations": ["1:2:8"],
"declarations": ["2:8"],
"declaring_type": 0,
"uses": ["1:2:8"]
"uses": ["2:8"]
}]
}
*/

View File

@ -12,19 +12,19 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"funcs": [0],
"uses": ["*1:1:7", "1:5:6"]
"uses": ["*1:7", "5:6"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@foo#",
"short_name": "foo",
"qualified_name": "Foo::foo",
"declarations": ["1:2:8"],
"definition": "1:5:11",
"declarations": ["2:8"],
"definition": "5:11",
"declaring_type": 0,
"uses": ["1:2:8", "1:5:11"]
"uses": ["2:8", "5:11"]
}]
}
*/

View File

@ -10,18 +10,18 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"funcs": [0],
"uses": ["*1:1:7"]
"uses": ["*1:7"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@foo#",
"short_name": "foo",
"qualified_name": "Foo::foo",
"definition": "1:2:8",
"definition": "2:8",
"declaring_type": 0,
"uses": ["1:2:8"]
"uses": ["2:8"]
}]
}
*/

View File

@ -32,90 +32,90 @@ OUTPUT:
"usr": "c:@S@Base",
"short_name": "Base",
"qualified_name": "Base",
"definition": "1:10:8",
"definition": "10:8",
"derived": [1],
"uses": ["*1:10:8", "*1:12:26"]
"uses": ["*10:8", "*12:26"]
}, {
"id": 1,
"usr": "c:@S@SameFileDerived",
"short_name": "SameFileDerived",
"qualified_name": "SameFileDerived",
"definition": "1:12:8",
"definition": "12:8",
"parents": [0],
"uses": ["*1:12:8", "*1:14:14"]
"uses": ["*12:8", "*14:14"]
}, {
"id": 2,
"usr": "c:@Foo0",
"short_name": "Foo0",
"qualified_name": "Foo0",
"definition": "1:14:7",
"definition": "14:7",
"alias_of": 1,
"uses": ["*1:14:7"]
"uses": ["*14:7"]
}, {
"id": 3,
"usr": "c:@ST>1#T@Foo2",
"short_name": "Foo2",
"qualified_name": "Foo2",
"definition": "1:20:8",
"uses": ["*1:20:8"]
"definition": "20:8",
"uses": ["*20:8"]
}, {
"id": 4,
"usr": "c:@E@Foo3",
"short_name": "Foo3",
"qualified_name": "Foo3",
"definition": "1:22:6",
"definition": "22:6",
"vars": [0, 1, 2],
"uses": ["*1:22:6"]
"uses": ["*22:6"]
}],
"funcs": [{
"id": 0,
"usr": "c:@FT@>1#TFoo1#v#",
"short_name": "Foo1",
"qualified_name": "Foo1",
"definition": "1:17:6",
"uses": ["1:17:6"]
"definition": "17:6",
"uses": ["17:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@E@Foo3@A",
"short_name": "A",
"qualified_name": "Foo3::A",
"definition": "1:22:13",
"definition": "22:13",
"variable_type": 4,
"declaring_type": 4,
"uses": ["1:22:13"]
"uses": ["22:13"]
}, {
"id": 1,
"usr": "c:@E@Foo3@B",
"short_name": "B",
"qualified_name": "Foo3::B",
"definition": "1:22:16",
"definition": "22:16",
"variable_type": 4,
"declaring_type": 4,
"uses": ["1:22:16"]
"uses": ["22:16"]
}, {
"id": 2,
"usr": "c:@E@Foo3@C",
"short_name": "C",
"qualified_name": "Foo3::C",
"definition": "1:22:19",
"definition": "22:19",
"variable_type": 4,
"declaring_type": 4,
"uses": ["1:22:19"]
"uses": ["22:19"]
}, {
"id": 3,
"usr": "c:@Foo4",
"short_name": "Foo4",
"qualified_name": "Foo4",
"definition": "1:24:5",
"uses": ["1:24:5"]
"definition": "24:5",
"uses": ["24:5"]
}, {
"id": 4,
"usr": "c:header.h@Foo5",
"short_name": "Foo5",
"qualified_name": "Foo5",
"definition": "1:25:12",
"uses": ["1:25:12"]
"definition": "25:12",
"uses": ["25:12"]
}]
}
*/

View File

@ -1,6 +1,7 @@
#include "serializer.h"
#include "indexer.h"
#if false
// int
void Reflect(Reader& visitor, int& value) {
value = visitor.GetInt();
@ -219,7 +220,7 @@ optional<IndexedFile> Deserialize(std::string path, std::string serialized) {
return file;
}
#endif
#if false
#include "header.h"
#include "serializer.h"
@ -241,813 +242,5 @@ void f() {
/*
OUTPUT:
{
"types": [{
"id": 0,
"usr": "c:@Reader",
"instantiations": [0, 4, 8, 15, 20, 24, 32, 38, 44],
"uses": ["*1:5:14", "*1:12:14", "*1:19:14", "*1:37:14", "*1:51:14", "*1:61:14", "*1:85:25", "*1:115:25", "*1:146:25"]
}, {
"id": 1,
"usr": "c:@Writer",
"instantiations": [2, 6, 10, 12, 17, 22, 29, 34, 40, 46, 50],
"uses": ["*1:8:14", "*1:15:14", "*1:22:14", "*1:28:20", "*1:40:14", "*1:55:14", "*1:69:14", "*1:89:25", "*1:119:25", "*1:150:25", "*1:173:25"]
}, {
"id": 2,
"usr": "c:@N@std@T@string",
"instantiations": [9, 11, 14, 19, 31, 58, 59],
"uses": ["*1:19:36", "*1:22:36", "*1:28:60", "*1:44:8", "*1:70:8", "*1:198:6", "*1:211:40", "*1:211:58"]
}, {
"id": 3,
"usr": "c:@S@Location",
"instantiations": [16, 18],
"uses": ["*1:37:31", "*1:40:31"]
}, {
"id": 4,
"usr": "c:@ST>1#T@Id",
"instantiations": [21, 23],
"uses": ["*1:51:31", "*1:55:31"]
}, {
"id": 5,
"usr": "c:impl.cc@1122",
"uses": ["*1:51:34"]
}, {
"id": 6,
"usr": "c:impl.cc@1223",
"uses": ["*1:55:34"]
}, {
"id": 7,
"usr": "c:@ST>1#T@Ref",
"instantiations": [25, 30],
"uses": ["*1:61:31", "*1:69:31"]
}, {
"id": 8,
"usr": "c:@S@IndexedFuncDef",
"instantiations": [39, 41, 43],
"uses": ["*1:61:35", "*1:69:35", "*1:115:41", "*1:119:41", "*1:126:33"]
}, {
"id": 9,
"usr": "c:@T@uint64_t",
"instantiations": [27],
"uses": ["*1:63:3"]
}, {
"id": 10,
"usr": "c:@S@IndexedTypeDef",
"instantiations": [33, 35, 37],
"uses": ["*1:85:41", "*1:89:41", "*1:96:33"]
}, {
"id": 11,
"usr": "c:impl.cc@2280",
"uses": ["*1:96:14"]
}, {
"id": 12,
"usr": "c:impl.cc@3310",
"uses": ["*1:126:14"]
}, {
"id": 13,
"usr": "c:@S@IndexedVarDef",
"instantiations": [45, 47, 49],
"uses": ["*1:146:41", "*1:150:41", "*1:157:33"]
}, {
"id": 14,
"usr": "c:impl.cc@4407",
"uses": ["*1:157:14"]
}, {
"id": 15,
"usr": "c:@S@IndexedFile",
"instantiations": [51, 54, 55, 61],
"uses": ["*1:173:42", "*1:184:33", "*1:198:23", "*1:211:10", "*1:217:3"]
}, {
"id": 16,
"usr": "c:impl.cc@5404",
"uses": ["*1:184:14"]
}, {
"id": 17,
"usr": "c:stringbuffer.h@N@rapidjson@T@StringBuffer",
"instantiations": [56],
"uses": ["*1:199:14"]
}, {
"id": 18,
"usr": "c:@N@std@N@experimental@ST>1#T@optional",
"uses": ["*1:211:1"]
}, {
"id": 19,
"usr": "c:document.h@N@rapidjson@T@Document",
"instantiations": [60],
"uses": ["*1:212:14"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&I#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:5:6",
"uses": ["1:5:6"]
}, {
"id": 1,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&I#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:8:6",
"callees": ["2@1:9:11"],
"uses": ["1:8:6"]
}, {
"id": 2,
"usr": "c:@N@rapidjson@ST>5#T#T#T#T#Ni@Writer@F@Int#I#",
"callers": ["1@1:9:11"],
"uses": ["1:9:11"]
}, {
"id": 3,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&b#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:12:6",
"uses": ["1:12:6"]
}, {
"id": 4,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&b#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:15:6",
"callees": ["5@1:16:11"],
"uses": ["1:15:6"]
}, {
"id": 5,
"usr": "c:@N@rapidjson@ST>5#T#T#T#T#Ni@Writer@F@Bool#b#",
"callers": ["4@1:16:11"],
"uses": ["1:16:11"]
}, {
"id": 6,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:19:6",
"uses": ["1:19:6"]
}, {
"id": 7,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:22:6",
"callers": ["8@1:32:3"],
"uses": ["1:22:6", "1:32:3"]
}, {
"id": 8,
"usr": "c:@F@ReflectMember#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#*1C#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#",
"short_name": "ReflectMember",
"qualified_name": "ReflectMember",
"definition": "1:28:6",
"callees": ["9@1:31:11", "7@1:32:3"],
"uses": ["1:28:6"]
}, {
"id": 9,
"usr": "c:@N@rapidjson@ST>5#T#T#T#T#Ni@Writer@F@Key#*1^type-parameter-0-1:::Ch#",
"callers": ["8@1:31:11"],
"uses": ["1:31:11"]
}, {
"id": 10,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@Location#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:37:6",
"uses": ["1:37:6"]
}, {
"id": 11,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@Location#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:40:6",
"callees": ["12@1:44:30"],
"uses": ["1:40:6"]
}, {
"id": 12,
"usr": "c:@S@Location@F@ToString#",
"callers": ["11@1:44:30"],
"uses": ["1:44:30"]
}, {
"id": 13,
"usr": "c:@FT@>1#TReflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&>@ST>1#T@Id1t0.0#v#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:51:6",
"uses": ["1:51:6"]
}, {
"id": 14,
"usr": "c:@FT@>1#TReflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&>@ST>1#T@Id1t0.0#v#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:55:6",
"uses": ["1:55:6"]
}, {
"id": 15,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@Ref>#$@S@IndexedFuncDef#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:61:6",
"uses": ["1:61:6"]
}, {
"id": 16,
"usr": "c:@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@Ref>#$@S@IndexedFuncDef#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:69:6",
"callees": ["17@1:71:11"],
"uses": ["1:69:6"]
}, {
"id": 17,
"usr": "c:@N@rapidjson@ST>5#T#T#T#T#Ni@Writer@F@String#*1^type-parameter-0-1:::Ch#",
"callers": ["16@1:71:11"],
"uses": ["1:71:11"]
}, {
"id": 18,
"usr": "c:@F@ReflectMemberStart#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@IndexedTypeDef#",
"short_name": "ReflectMemberStart",
"qualified_name": "ReflectMemberStart",
"definition": "1:85:6",
"uses": ["1:85:6"]
}, {
"id": 19,
"usr": "c:@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedTypeDef#",
"short_name": "ReflectMemberStart",
"qualified_name": "ReflectMemberStart",
"definition": "1:89:6",
"callees": ["20@1:92:3"],
"uses": ["1:89:6"]
}, {
"id": 20,
"usr": "c:@F@DefaultReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#",
"callers": ["19@1:92:3", "23@1:122:3", "26@1:153:3", "28@1:180:3"],
"uses": ["1:92:3", "1:122:3", "1:153:3", "1:180:3"]
}, {
"id": 21,
"usr": "c:@FT@>1#TReflect#&t0.0#&$@S@IndexedTypeDef#v#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:96:6",
"uses": ["1:96:6"]
}, {
"id": 22,
"usr": "c:@F@ReflectMemberStart#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@IndexedFuncDef#",
"short_name": "ReflectMemberStart",
"qualified_name": "ReflectMemberStart",
"definition": "1:115:6",
"uses": ["1:115:6"]
}, {
"id": 23,
"usr": "c:@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedFuncDef#",
"short_name": "ReflectMemberStart",
"qualified_name": "ReflectMemberStart",
"definition": "1:119:6",
"callees": ["20@1:122:3"],
"uses": ["1:119:6"]
}, {
"id": 24,
"usr": "c:@FT@>1#TReflect#&t0.0#&$@S@IndexedFuncDef#v#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:126:6",
"uses": ["1:126:6"]
}, {
"id": 25,
"usr": "c:@F@ReflectMemberStart#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@IndexedVarDef#",
"short_name": "ReflectMemberStart",
"qualified_name": "ReflectMemberStart",
"definition": "1:146:6",
"uses": ["1:146:6"]
}, {
"id": 26,
"usr": "c:@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedVarDef#",
"short_name": "ReflectMemberStart",
"qualified_name": "ReflectMemberStart",
"definition": "1:150:6",
"callees": ["20@1:153:3"],
"uses": ["1:150:6"]
}, {
"id": 27,
"usr": "c:@FT@>1#TReflect#&t0.0#&$@S@IndexedVarDef#v#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:157:6",
"uses": ["1:157:6"]
}, {
"id": 28,
"usr": "c:@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedFile#",
"short_name": "ReflectMemberStart",
"qualified_name": "ReflectMemberStart",
"definition": "1:173:6",
"callees": ["20@1:180:3"],
"uses": ["1:173:6"]
}, {
"id": 29,
"usr": "c:@FT@>1#TReflect#&t0.0#&$@S@IndexedFile#v#",
"short_name": "Reflect",
"qualified_name": "Reflect",
"definition": "1:184:6",
"uses": ["1:184:6"]
}, {
"id": 30,
"usr": "c:@F@Serialize#&$@S@IndexedFile#",
"short_name": "Serialize",
"qualified_name": "Serialize",
"definition": "1:198:13",
"uses": ["1:198:13"]
}, {
"id": 31,
"usr": "c:@F@Deserialize#$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#S0_#",
"short_name": "Deserialize",
"qualified_name": "Deserialize",
"definition": "1:211:23",
"callees": ["32@1:217:15"],
"uses": ["1:211:23"]
}, {
"id": 32,
"usr": "c:@S@IndexedFile@F@IndexedFile#&1$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#",
"callers": ["31@1:217:15"],
"uses": ["1:217:15"]
}],
"vars": [{
"id": 0,
"usr": "c:impl.cc@70@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&I#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:5:22",
"variable_type": 0,
"uses": ["1:5:22"]
}, {
"id": 1,
"usr": "c:impl.cc@87@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&I#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:5:36",
"uses": ["1:5:36"]
}, {
"id": 2,
"usr": "c:impl.cc@147@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&I#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:8:22",
"variable_type": 1,
"uses": ["1:8:22", "1:9:3"]
}, {
"id": 3,
"usr": "c:impl.cc@164@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&I#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:8:36",
"uses": ["1:8:36", "1:9:15"]
}, {
"id": 4,
"usr": "c:impl.cc@227@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&b#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:12:22",
"variable_type": 0,
"uses": ["1:12:22"]
}, {
"id": 5,
"usr": "c:impl.cc@244@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&b#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:12:37",
"uses": ["1:12:37"]
}, {
"id": 6,
"usr": "c:impl.cc@306@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&b#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:15:22",
"variable_type": 1,
"uses": ["1:15:22", "1:16:3"]
}, {
"id": 7,
"usr": "c:impl.cc@323@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&b#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:15:37",
"uses": ["1:15:37", "1:16:16"]
}, {
"id": 8,
"usr": "c:impl.cc@395@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:19:22",
"variable_type": 0,
"uses": ["1:19:22"]
}, {
"id": 9,
"usr": "c:impl.cc@412@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:19:44",
"variable_type": 2,
"uses": ["1:19:44"]
}, {
"id": 10,
"usr": "c:impl.cc@483@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:22:22",
"variable_type": 1,
"uses": ["1:22:22"]
}, {
"id": 11,
"usr": "c:impl.cc@500@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:22:44",
"variable_type": 2,
"uses": ["1:22:44"]
}, {
"id": 12,
"usr": "c:impl.cc@615@F@ReflectMember#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#*1C#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:28:28",
"variable_type": 1,
"uses": ["1:28:28", "1:31:3", "1:32:11"]
}, {
"id": 13,
"usr": "c:impl.cc@632@F@ReflectMember#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#*1C#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#@name",
"short_name": "name",
"qualified_name": "name",
"definition": "1:28:49",
"uses": ["1:28:49", "1:31:15"]
}, {
"id": 14,
"usr": "c:impl.cc@650@F@ReflectMember#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#*1C#&$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:28:68",
"variable_type": 2,
"uses": ["1:28:68", "1:29:7", "1:32:20"]
}, {
"id": 15,
"usr": "c:impl.cc@791@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@Location#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:37:22",
"variable_type": 0,
"uses": ["1:37:22"]
}, {
"id": 16,
"usr": "c:impl.cc@808@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@Location#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:37:41",
"variable_type": 3,
"uses": ["1:37:41"]
}, {
"id": 17,
"usr": "c:impl.cc@886@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@Location#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:40:22",
"variable_type": 1,
"uses": ["1:40:22"]
}, {
"id": 18,
"usr": "c:impl.cc@903@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@Location#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:40:41",
"variable_type": 3,
"uses": ["1:40:41", "1:44:24"]
}, {
"id": 19,
"usr": "c:impl.cc@1006@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@Location#@output",
"short_name": "output",
"qualified_name": "output",
"definition": "1:44:15",
"variable_type": 2,
"uses": ["1:44:15"]
}, {
"id": 20,
"usr": "c:impl.cc@1148@FT@>1#TReflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&>@ST>1#T@Id1t0.0#v#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:51:22",
"variable_type": 0,
"uses": ["1:51:22"]
}, {
"id": 21,
"usr": "c:impl.cc@1165@FT@>1#TReflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&>@ST>1#T@Id1t0.0#v#@id",
"short_name": "id",
"qualified_name": "id",
"definition": "1:51:38",
"variable_type": 4,
"uses": ["1:51:38"]
}, {
"id": 22,
"usr": "c:impl.cc@1249@FT@>1#TReflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&>@ST>1#T@Id1t0.0#v#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:55:22",
"variable_type": 1,
"uses": ["1:55:22"]
}, {
"id": 23,
"usr": "c:impl.cc@1266@FT@>1#TReflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&>@ST>1#T@Id1t0.0#v#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:55:38",
"variable_type": 4,
"uses": ["1:55:38"]
}, {
"id": 24,
"usr": "c:impl.cc@1356@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@Ref>#$@S@IndexedFuncDef#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:61:22",
"variable_type": 0,
"uses": ["1:61:22"]
}, {
"id": 25,
"usr": "c:impl.cc@1373@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@Ref>#$@S@IndexedFuncDef#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:61:52",
"variable_type": 7,
"uses": ["1:61:52"]
}, {
"id": 26,
"usr": "c:impl.cc@1406@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@Ref>#$@S@IndexedFuncDef#@str_value",
"short_name": "str_value",
"qualified_name": "str_value",
"definition": "1:62:15",
"uses": ["1:62:15", "1:63:22", "1:64:35"]
}, {
"id": 27,
"usr": "c:impl.cc@1454@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@Ref>#$@S@IndexedFuncDef#@id",
"short_name": "id",
"qualified_name": "id",
"definition": "1:63:12",
"variable_type": 9,
"uses": ["1:63:12"]
}, {
"id": 28,
"usr": "c:impl.cc@1488@F@Reflect#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@Ref>#$@S@IndexedFuncDef#@loc_string",
"short_name": "loc_string",
"qualified_name": "loc_string",
"definition": "1:64:15",
"uses": ["1:64:15"]
}, {
"id": 29,
"usr": "c:impl.cc@1635@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@Ref>#$@S@IndexedFuncDef#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:69:22",
"variable_type": 1,
"uses": ["1:69:22", "1:71:3"]
}, {
"id": 30,
"usr": "c:impl.cc@1652@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@Ref>#$@S@IndexedFuncDef#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:69:52",
"variable_type": 7,
"uses": ["1:69:52"]
}, {
"id": 31,
"usr": "c:impl.cc@1685@F@Reflect#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@Ref>#$@S@IndexedFuncDef#@s",
"short_name": "s",
"qualified_name": "s",
"definition": "1:70:15",
"variable_type": 2,
"uses": ["1:70:15", "1:71:18"]
}, {
"id": 32,
"usr": "c:impl.cc@2008@F@ReflectMemberStart#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@IndexedTypeDef#@reader",
"short_name": "reader",
"qualified_name": "reader",
"definition": "1:85:33",
"variable_type": 0,
"uses": ["1:85:33"]
}, {
"id": 33,
"usr": "c:impl.cc@2024@F@ReflectMemberStart#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@IndexedTypeDef#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:85:57",
"variable_type": 10,
"uses": ["1:85:57"]
}, {
"id": 34,
"usr": "c:impl.cc@2124@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedTypeDef#@writer",
"short_name": "writer",
"qualified_name": "writer",
"definition": "1:89:33",
"variable_type": 1,
"uses": ["1:89:33", "1:92:29"]
}, {
"id": 35,
"usr": "c:impl.cc@2140@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedTypeDef#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:89:57",
"variable_type": 10,
"uses": ["1:89:57"]
}, {
"id": 36,
"usr": "c:impl.cc@2313@FT@>1#TReflect#&t0.0#&$@S@IndexedTypeDef#v#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:96:24",
"uses": ["1:96:24"]
}, {
"id": 37,
"usr": "c:impl.cc@2332@FT@>1#TReflect#&t0.0#&$@S@IndexedTypeDef#v#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:96:49",
"variable_type": 10,
"uses": ["1:96:49"]
}, {
"id": 38,
"usr": "c:impl.cc@3038@F@ReflectMemberStart#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@IndexedFuncDef#@reader",
"short_name": "reader",
"qualified_name": "reader",
"definition": "1:115:33",
"variable_type": 0,
"uses": ["1:115:33"]
}, {
"id": 39,
"usr": "c:impl.cc@3054@F@ReflectMemberStart#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@IndexedFuncDef#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:115:57",
"variable_type": 8,
"uses": ["1:115:57"]
}, {
"id": 40,
"usr": "c:impl.cc@3154@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedFuncDef#@writer",
"short_name": "writer",
"qualified_name": "writer",
"definition": "1:119:33",
"variable_type": 1,
"uses": ["1:119:33", "1:122:29"]
}, {
"id": 41,
"usr": "c:impl.cc@3170@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedFuncDef#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:119:57",
"variable_type": 8,
"uses": ["1:119:57"]
}, {
"id": 42,
"usr": "c:impl.cc@3343@FT@>1#TReflect#&t0.0#&$@S@IndexedFuncDef#v#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:126:24",
"uses": ["1:126:24"]
}, {
"id": 43,
"usr": "c:impl.cc@3362@FT@>1#TReflect#&t0.0#&$@S@IndexedFuncDef#v#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:126:49",
"variable_type": 8,
"uses": ["1:126:49"]
}, {
"id": 44,
"usr": "c:impl.cc@4137@F@ReflectMemberStart#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@IndexedVarDef#@reader",
"short_name": "reader",
"qualified_name": "reader",
"definition": "1:146:33",
"variable_type": 0,
"uses": ["1:146:33"]
}, {
"id": 45,
"usr": "c:impl.cc@4153@F@ReflectMemberStart#&$@N@rapidjson@S@GenericValue>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@MemoryPoolAllocator>#$@N@rapidjson@S@CrtAllocator#&$@S@IndexedVarDef#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:146:56",
"variable_type": 13,
"uses": ["1:146:56"]
}, {
"id": 46,
"usr": "c:impl.cc@4252@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedVarDef#@writer",
"short_name": "writer",
"qualified_name": "writer",
"definition": "1:150:33",
"variable_type": 1,
"uses": ["1:150:33", "1:153:29"]
}, {
"id": 47,
"usr": "c:impl.cc@4268@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedVarDef#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:150:56",
"variable_type": 13,
"uses": ["1:150:56"]
}, {
"id": 48,
"usr": "c:impl.cc@4440@FT@>1#TReflect#&t0.0#&$@S@IndexedVarDef#v#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:157:24",
"uses": ["1:157:24"]
}, {
"id": 49,
"usr": "c:impl.cc@4459@FT@>1#TReflect#&t0.0#&$@S@IndexedVarDef#v#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:157:48",
"variable_type": 13,
"uses": ["1:157:48"]
}, {
"id": 50,
"usr": "c:impl.cc@5061@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedFile#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:173:33",
"variable_type": 1,
"uses": ["1:173:33", "1:180:29"]
}, {
"id": 51,
"usr": "c:impl.cc@5078@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedFile#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:173:55",
"variable_type": 15,
"uses": ["1:173:55"]
}, {
"id": 52,
"usr": "c:impl.cc@5103@F@ReflectMemberStart#&$@N@rapidjson@S@Writer>#$@N@rapidjson@S@GenericStringBuffer>#$@N@rapidjson@S@UTF8>#C#$@N@rapidjson@S@CrtAllocator#S3_#S3_#S4_#Vi0#&$@S@IndexedFile#@it",
"short_name": "it",
"qualified_name": "it",
"definition": "1:174:8",
"uses": ["1:174:8"]
}, {
"id": 53,
"usr": "c:impl.cc@5437@FT@>1#TReflect#&t0.0#&$@S@IndexedFile#v#@visitor",
"short_name": "visitor",
"qualified_name": "visitor",
"definition": "1:184:24",
"uses": ["1:184:24"]
}, {
"id": 54,
"usr": "c:impl.cc@5456@FT@>1#TReflect#&t0.0#&$@S@IndexedFile#v#@value",
"short_name": "value",
"qualified_name": "value",
"definition": "1:184:46",
"variable_type": 15,
"uses": ["1:184:46"]
}, {
"id": 55,
"usr": "c:impl.cc@5647@F@Serialize#&$@S@IndexedFile#@file",
"short_name": "file",
"qualified_name": "file",
"definition": "1:198:36",
"variable_type": 15,
"uses": ["1:198:36"]
}, {
"id": 56,
"usr": "c:impl.cc@5671@F@Serialize#&$@S@IndexedFile#@output",
"short_name": "output",
"qualified_name": "output",
"definition": "1:199:27",
"variable_type": 17,
"uses": ["1:199:27"]
}, {
"id": 57,
"usr": "c:impl.cc@5706@F@Serialize#&$@S@IndexedFile#@writer",
"short_name": "writer",
"qualified_name": "writer",
"definition": "1:200:52",
"uses": ["1:200:52"]
}, {
"id": 58,
"usr": "c:impl.cc@6018@F@Deserialize#$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#S0_#@path",
"short_name": "path",
"qualified_name": "path",
"definition": "1:211:47",
"variable_type": 2,
"uses": ["1:211:47", "1:217:20"]
}, {
"id": 59,
"usr": "c:impl.cc@6036@F@Deserialize#$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#S0_#@serialized",
"short_name": "serialized",
"qualified_name": "serialized",
"definition": "1:211:65",
"variable_type": 2,
"uses": ["1:211:65"]
}, {
"id": 60,
"usr": "c:impl.cc@6065@F@Deserialize#$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#S0_#@reader",
"short_name": "reader",
"qualified_name": "reader",
"definition": "1:212:23",
"variable_type": 19,
"uses": ["1:212:23"]
}, {
"id": 61,
"usr": "c:impl.cc@6187@F@Deserialize#$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#S0_#@file",
"short_name": "file",
"qualified_name": "file",
"definition": "1:217:15",
"variable_type": 15,
"uses": ["1:217:15"]
}]
}
{}
*/

View File

@ -10,8 +10,8 @@ OUTPUT:
"usr": "c:anonymous_function.cc@aN@F@foo#",
"short_name": "foo",
"qualified_name": "::foo",
"declarations": ["1:2:6"],
"uses": ["1:2:6"]
"declarations": ["2:6"],
"uses": ["2:6"]
}]
}
*/

View File

@ -10,8 +10,8 @@ OUTPUT:
"usr": "c:@N@hello@F@foo#I#I#",
"short_name": "foo",
"qualified_name": "hello::foo",
"declarations": ["1:2:6"],
"uses": ["1:2:6"]
"declarations": ["2:6"],
"uses": ["2:6"]
}]
}
*/

View File

@ -10,8 +10,8 @@ OUTPUT:
"usr": "c:@N@hello@F@foo#",
"short_name": "foo",
"qualified_name": "hello::foo",
"definition": "1:2:6",
"uses": ["1:2:6"]
"definition": "2:6",
"uses": ["2:6"]
}]
}
*/

View File

@ -12,18 +12,18 @@ OUTPUT:
"usr": "c:@N@hello@S@Foo",
"short_name": "Foo",
"qualified_name": "hello::Foo",
"definition": "1:2:7",
"definition": "2:7",
"funcs": [0],
"uses": ["*1:2:7"]
"uses": ["*2:7"]
}],
"funcs": [{
"id": 0,
"usr": "c:@N@hello@S@Foo@F@foo#",
"short_name": "foo",
"qualified_name": "hello::Foo::foo",
"declarations": ["1:3:8"],
"declarations": ["3:8"],
"declaring_type": 0,
"uses": ["1:3:8"]
"uses": ["3:8"]
}]
}
*/

View File

@ -14,19 +14,19 @@ OUTPUT:
"usr": "c:@N@hello@S@Foo",
"short_name": "Foo",
"qualified_name": "hello::Foo",
"definition": "1:2:7",
"definition": "2:7",
"funcs": [0],
"uses": ["*1:2:7", "1:6:6"]
"uses": ["*2:7", "6:6"]
}],
"funcs": [{
"id": 0,
"usr": "c:@N@hello@S@Foo@F@foo#",
"short_name": "foo",
"qualified_name": "hello::Foo::foo",
"declarations": ["1:3:8"],
"definition": "1:6:11",
"declarations": ["3:8"],
"definition": "6:11",
"declaring_type": 0,
"uses": ["1:3:8", "1:6:11"]
"uses": ["3:8", "6:11"]
}]
}
*/

View File

@ -12,18 +12,18 @@ OUTPUT:
"usr": "c:@N@hello@S@Foo",
"short_name": "Foo",
"qualified_name": "hello::Foo",
"definition": "1:2:7",
"definition": "2:7",
"funcs": [0],
"uses": ["*1:2:7"]
"uses": ["*2:7"]
}],
"funcs": [{
"id": 0,
"usr": "c:@N@hello@S@Foo@F@foo#",
"short_name": "foo",
"qualified_name": "hello::Foo::foo",
"definition": "1:3:8",
"definition": "3:8",
"declaring_type": 0,
"uses": ["1:3:8"]
"uses": ["3:8"]
}]
}
*/

View File

@ -17,32 +17,32 @@ OUTPUT:
"usr": "c:@N@ns@F@Accept#I#",
"short_name": "Accept",
"qualified_name": "ns::Accept",
"definition": "1:3:8",
"callers": ["1@1:7:7", "1@1:9:3"],
"uses": ["1:3:8", "1:7:7", "1:9:3"]
"definition": "3:8",
"callers": ["1@7:7", "1@9:3"],
"uses": ["3:8", "7:7", "9:3"]
}, {
"id": 1,
"usr": "c:@F@Runner#",
"short_name": "Runner",
"qualified_name": "Runner",
"definition": "1:6:6",
"callees": ["0@1:7:7", "0@1:9:3"],
"uses": ["1:6:6"]
"definition": "6:6",
"callees": ["0@7:7", "0@9:3"],
"uses": ["6:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@N@ns@Foo",
"short_name": "Foo",
"qualified_name": "ns::Foo",
"definition": "1:2:7",
"uses": ["1:2:7", "1:7:18", "1:9:10"]
"definition": "2:7",
"uses": ["2:7", "7:18", "9:10"]
}, {
"id": 1,
"usr": "c:namespace_reference.cc@42@N@ns@F@Accept#I#@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:3:19",
"uses": ["1:3:19"]
"definition": "3:19",
"uses": ["3:19"]
}]
}
*/

View File

@ -14,40 +14,40 @@ OUTPUT:
"usr": "c:@S@MergeableUpdate",
"short_name": "MergeableUpdate",
"qualified_name": "MergeableUpdate",
"definition": "1:3:8",
"definition": "3:8",
"vars": [0, 1, 2],
"uses": ["*1:3:8"]
"uses": ["*3:8"]
}, {
"id": 1,
"usr": "c:@N@std@ST>2#T#T@vector",
"instantiations": [2],
"uses": ["*1:6:8"]
"uses": ["*6:8"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@MergeableUpdate@FI@a",
"short_name": "a",
"qualified_name": "MergeableUpdate::a",
"definition": "1:4:7",
"definition": "4:7",
"declaring_type": 0,
"uses": ["1:4:7"]
"uses": ["4:7"]
}, {
"id": 1,
"usr": "c:@S@MergeableUpdate@FI@b",
"short_name": "b",
"qualified_name": "MergeableUpdate::b",
"definition": "1:5:7",
"definition": "5:7",
"declaring_type": 0,
"uses": ["1:5:7"]
"uses": ["5:7"]
}, {
"id": 2,
"usr": "c:@S@MergeableUpdate@FI@to_add",
"short_name": "to_add",
"qualified_name": "MergeableUpdate::to_add",
"definition": "1:6:20",
"definition": "6:20",
"variable_type": 1,
"declaring_type": 0,
"uses": ["1:6:20"]
"uses": ["6:20"]
}]
}
*/

View File

@ -19,55 +19,55 @@ OUTPUT:
"usr": "c:@S@CompilationEntry",
"short_name": "CompilationEntry",
"qualified_name": "CompilationEntry",
"definition": "1:6:8",
"definition": "6:8",
"vars": [0, 1, 2],
"uses": ["*1:6:8", "*1:12:13"]
"uses": ["*6:8", "*12:13"]
}, {
"id": 1,
"usr": "c:@N@std@T@string",
"instantiations": [0, 1],
"uses": ["*1:7:8", "*1:8:8", "*1:9:20"]
"uses": ["*7:8", "*8:8", "*9:20"]
}, {
"id": 2,
"usr": "c:@N@std@ST>2#T#T@vector",
"instantiations": [2],
"uses": ["*1:9:8", "*1:12:6"]
"uses": ["*9:8", "*12:6"]
}],
"funcs": [{
"id": 0,
"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",
"qualified_name": "LoadCompilationEntriesFromDirectory",
"declarations": ["1:12:31"],
"uses": ["1:12:31"]
"declarations": ["12:31"],
"uses": ["12:31"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@CompilationEntry@FI@directory",
"short_name": "directory",
"qualified_name": "CompilationEntry::directory",
"definition": "1:7:15",
"definition": "7:15",
"variable_type": 1,
"declaring_type": 0,
"uses": ["1:7:15"]
"uses": ["7:15"]
}, {
"id": 1,
"usr": "c:@S@CompilationEntry@FI@filename",
"short_name": "filename",
"qualified_name": "CompilationEntry::filename",
"definition": "1:8:15",
"definition": "8:15",
"variable_type": 1,
"declaring_type": 0,
"uses": ["1:8:15"]
"uses": ["8:15"]
}, {
"id": 2,
"usr": "c:@S@CompilationEntry@FI@args",
"short_name": "args",
"qualified_name": "CompilationEntry::args",
"definition": "1:9:28",
"definition": "9:28",
"variable_type": 2,
"declaring_type": 0,
"uses": ["1:9:28"]
"uses": ["9:28"]
}]
}
*/

View File

@ -15,26 +15,26 @@ OUTPUT:
"usr": "c:@ST>1#T@Template",
"short_name": "Template",
"qualified_name": "Template",
"definition": "1:2:7",
"uses": ["*1:2:7", "1:5:12", "*1:8:15"]
"definition": "2:7",
"uses": ["*2:7", "5:12", "*8:15"]
}, {
"id": 1,
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:4:8",
"definition": "4:8",
"funcs": [0],
"uses": ["*1:4:8", "1:8:6"]
"uses": ["*4:8", "8:6"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@Bar#&$@S@Template>#d#",
"short_name": "Bar",
"qualified_name": "Foo::Bar",
"declarations": ["1:5:8"],
"definition": "1:8:11",
"declarations": ["5:8"],
"definition": "8:11",
"declaring_type": 1,
"uses": ["1:5:8", "1:8:11"]
"uses": ["5:8", "8:11"]
}]
}
*/

View File

@ -22,42 +22,42 @@ OUTPUT:
"usr": "c:@N@ns@E@VarType",
"short_name": "VarType",
"qualified_name": "ns::VarType",
"definition": "1:2:8",
"definition": "2:8",
"instantiations": [0],
"uses": ["*1:2:8", "*1:6:22", "*1:6:44", "*1:10:18"]
"uses": ["*2:8", "*6:22", "*6:44", "*10:18"]
}, {
"id": 1,
"usr": "c:@N@ns@ST>1#T@Holder",
"short_name": "Holder",
"qualified_name": "ns::Holder",
"definition": "1:5:10",
"definition": "5:10",
"vars": [0],
"uses": ["*1:5:10", "*1:10:26", "1:13:13", "1:14:14"]
"uses": ["*5:10", "*10:26", "13:13", "14:14"]
}],
"vars": [{
"id": 0,
"usr": "c:@N@ns@ST>1#T@Holder@static_var",
"short_name": "static_var",
"qualified_name": "ns::Holder::static_var",
"declaration": "1:6:30",
"definition": "1:10:37",
"declaration": "6:30",
"definition": "10:37",
"variable_type": 0,
"declaring_type": 1,
"uses": ["1:6:30", "1:10:37", "1:13:26", "1:14:27"]
"uses": ["6:30", "10:37", "13:26", "14:27"]
}, {
"id": 1,
"usr": "c:@N@ns@Foo",
"short_name": "Foo",
"qualified_name": "ns::Foo",
"definition": "1:13:7",
"uses": ["1:13:7"]
"definition": "13:7",
"uses": ["13:7"]
}, {
"id": 2,
"usr": "c:@N@ns@Foo2",
"short_name": "Foo2",
"qualified_name": "ns::Foo2",
"definition": "1:14:7",
"uses": ["1:14:7"]
"definition": "14:7",
"uses": ["14:7"]
}]
}
*/

View File

@ -19,33 +19,33 @@ OUTPUT:
"usr": "c:@N@ns@ST>1#T@Foo",
"short_name": "Foo",
"qualified_name": "ns::Foo",
"definition": "1:3:10",
"definition": "3:10",
"funcs": [0],
"uses": ["*1:3:10", "1:10:11", "1:11:11"]
"uses": ["*3:10", "10:11", "11:11"]
}],
"funcs": [{
"id": 0,
"usr": "c:@N@ns@ST>1#T@Foo@FT@>1#Tfoo#I#S",
"short_name": "foo",
"qualified_name": "ns::Foo::foo",
"definition": "1:5:16",
"definition": "5:16",
"declaring_type": 0,
"uses": ["1:5:16", "1:10:21", "1:11:22"]
"uses": ["5:16", "10:21", "11:22"]
}],
"vars": [{
"id": 0,
"usr": "c:@N@ns@a",
"short_name": "a",
"qualified_name": "ns::a",
"definition": "1:10:7",
"uses": ["1:10:7"]
"definition": "10:7",
"uses": ["10:7"]
}, {
"id": 1,
"usr": "c:@N@ns@b",
"short_name": "b",
"qualified_name": "ns::b",
"definition": "1:11:7",
"uses": ["1:11:7"]
"definition": "11:7",
"uses": ["11:7"]
}]
}
*/

View File

@ -14,26 +14,26 @@ OUTPUT:
"usr": "c:@N@ns@ST>1#T@Foo",
"short_name": "Foo",
"qualified_name": "ns::Foo",
"definition": "1:3:9",
"definition": "3:9",
"instantiations": [0, 1],
"uses": ["*1:3:9", "*1:5:3", "*1:6:3"]
"uses": ["*3:9", "*5:3", "*6:3"]
}],
"vars": [{
"id": 0,
"usr": "c:@N@ns@a",
"short_name": "a",
"qualified_name": "ns::a",
"definition": "1:5:12",
"definition": "5:12",
"variable_type": 0,
"uses": ["1:5:12"]
"uses": ["5:12"]
}, {
"id": 1,
"usr": "c:@N@ns@b",
"short_name": "b",
"qualified_name": "ns::b",
"definition": "1:6:13",
"definition": "6:13",
"variable_type": 0,
"uses": ["1:6:13"]
"uses": ["6:13"]
}]
}
*/

View File

@ -20,19 +20,19 @@ OUTPUT:
"usr": "c:@ST>1#T@Template",
"short_name": "Template",
"qualified_name": "Template",
"definition": "1:2:7",
"definition": "2:7",
"funcs": [0],
"uses": ["*1:2:7", "*1:7:6", "1:9:6"]
"uses": ["*2:7", "*7:6", "9:6"]
}],
"funcs": [{
"id": 0,
"usr": "c:@ST>1#T@Template@F@Foo#",
"short_name": "Foo",
"qualified_name": "Template::Foo",
"declarations": ["1:3:8", "1:9:22"],
"definition": "1:7:19",
"declarations": ["3:8", "9:22"],
"definition": "7:19",
"declaring_type": 0,
"uses": ["1:3:8", "1:7:19", "1:9:22"]
"uses": ["3:8", "7:19", "9:22"]
}]
}
*/

View File

@ -16,33 +16,33 @@ OUTPUT:
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:2:8",
"definition": "2:8",
"funcs": [0],
"uses": ["*1:2:8", "1:8:9", "1:9:9"]
"uses": ["*2:8", "8:9", "9:9"]
}],
"funcs": [{
"id": 0,
"usr": "c:@ST>1#T@Foo@F@foo#S",
"short_name": "foo",
"qualified_name": "Foo::foo",
"definition": "1:3:14",
"definition": "3:14",
"declaring_type": 0,
"uses": ["1:3:14", "1:8:19", "1:9:20"]
"uses": ["3:14", "8:19", "9:20"]
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:8:5",
"uses": ["1:8:5"]
"definition": "8:5",
"uses": ["8:5"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:9:5",
"uses": ["1:9:5"]
"definition": "9:5",
"uses": ["9:5"]
}]
}
*/

View File

@ -17,33 +17,33 @@ OUTPUT:
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:2:8",
"definition": "2:8",
"funcs": [0],
"uses": ["*1:2:8", "1:9:9", "1:10:9"]
"uses": ["*2:8", "9:9", "10:9"]
}],
"funcs": [{
"id": 0,
"usr": "c:@ST>1#T@Foo@FT@>1#Tfoo#I#S",
"short_name": "foo",
"qualified_name": "Foo::foo",
"definition": "1:4:14",
"definition": "4:14",
"declaring_type": 0,
"uses": ["1:4:14", "1:9:19", "1:10:20"]
"uses": ["4:14", "9:19", "10:20"]
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:9:5",
"uses": ["1:9:5"]
"definition": "9:5",
"uses": ["9:5"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:10:5",
"uses": ["1:10:5"]
"definition": "10:5",
"uses": ["10:5"]
}]
}
*/

View File

@ -35,47 +35,47 @@ OUTPUT:
"usr": "c:@E@A",
"short_name": "A",
"qualified_name": "A",
"definition": "1:1:6",
"uses": ["*1:1:6", "*1:9:5"]
"definition": "1:6",
"uses": ["*1:6", "*9:5"]
}, {
"id": 1,
"usr": "c:@E@B",
"short_name": "B",
"qualified_name": "B",
"definition": "1:2:6",
"uses": ["*1:2:6", "*1:10:5"]
"definition": "2:6",
"uses": ["*2:6", "*10:5"]
}, {
"id": 2,
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:5:8",
"uses": ["*1:5:8", "*1:9:1", "*1:10:1"]
"definition": "5:8",
"uses": ["*5:8", "*9:1", "*10:1"]
}, {
"id": 3,
"usr": "c:@ST>1#T@Foo@S@Inner",
"short_name": "Inner",
"qualified_name": "Foo::Inner",
"definition": "1:6:10",
"definition": "6:10",
"instantiations": [0, 1],
"uses": ["*1:6:10", "*1:9:9", "*1:10:9"]
"uses": ["*6:10", "*9:9", "*10:9"]
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:9:15",
"definition": "9:15",
"variable_type": 3,
"uses": ["1:9:15"]
"uses": ["9:15"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:10:15",
"definition": "10:15",
"variable_type": 3,
"uses": ["1:10:15"]
"uses": ["10:15"]
}]
}
*/

View File

@ -14,30 +14,30 @@ OUTPUT:
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:2:8",
"uses": ["*1:2:8", "1:6:9", "1:7:9"]
"definition": "2:8",
"uses": ["*2:8", "6:9", "7:9"]
}],
"vars": [{
"id": 0,
"usr": "c:@ST>1#T@Foo@var",
"short_name": "var",
"qualified_name": "Foo::var",
"declaration": "1:3:24",
"uses": ["1:3:24", "1:6:19", "1:7:20"]
"declaration": "3:24",
"uses": ["3:24", "6:19", "7:20"]
}, {
"id": 1,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:6:5",
"uses": ["1:6:5"]
"definition": "6:5",
"uses": ["6:5"]
}, {
"id": 2,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:7:5",
"uses": ["1:7:5"]
"definition": "7:5",
"uses": ["7:5"]
}]
}
*/

View File

@ -17,23 +17,23 @@ OUTPUT:
"usr": "c:template_func_usage_folded_into_one.cc@FT@>1#Tfoo#I#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:2:12",
"uses": ["1:2:12", "1:6:9", "1:7:9"]
"definition": "2:12",
"uses": ["2:12", "6:9", "7:9"]
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:6:5",
"uses": ["1:6:5"]
"definition": "6:5",
"uses": ["6:5"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:7:5",
"uses": ["1:7:5"]
"definition": "7:5",
"uses": ["7:5"]
}]
}
*/

View File

@ -12,26 +12,26 @@ OUTPUT:
"usr": "c:@ST>1#T@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:2:7",
"definition": "2:7",
"instantiations": [0, 1],
"uses": ["*1:2:7", "*1:4:1", "*1:5:1"]
"uses": ["*2:7", "*4:1", "*5:1"]
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:4:10",
"definition": "4:10",
"variable_type": 0,
"uses": ["1:4:10"]
"uses": ["4:10"]
}, {
"id": 1,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:5:11",
"definition": "5:11",
"variable_type": 0,
"uses": ["1:5:11"]
"uses": ["5:11"]
}]
}
*/

View File

@ -35,41 +35,41 @@ OUTPUT:
"usr": "c:@E@A",
"short_name": "A",
"qualified_name": "A",
"definition": "1:1:6",
"uses": ["*1:1:6", "1:7:13"]
"definition": "1:6",
"uses": ["*1:6", "7:13"]
}, {
"id": 1,
"usr": "c:@E@B",
"short_name": "B",
"qualified_name": "B",
"definition": "1:2:6",
"uses": ["*1:2:6", "1:8:13"]
"definition": "2:6",
"uses": ["*2:6", "8:13"]
}, {
"id": 2,
"usr": "c:template_var_usage_folded_into_one.cc@35",
"uses": ["*1:5:1"]
"uses": ["*5:1"]
}],
"vars": [{
"id": 0,
"usr": "c:@VT>1#T@var",
"short_name": "var",
"qualified_name": "var",
"definition": "1:5:3",
"uses": ["1:5:3", "1:7:9", "1:8:9"]
"definition": "5:3",
"uses": ["5:3", "7:9", "8:9"]
}, {
"id": 1,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:7:5",
"uses": ["1:7:5"]
"definition": "7:5",
"uses": ["7:5"]
}, {
"id": 2,
"usr": "c:@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:8:5",
"uses": ["1:8:5"]
"definition": "8:5",
"uses": ["8:5"]
}]
}
*/

View File

@ -11,50 +11,50 @@ OUTPUT:
"usr": "c:@U@vector3",
"short_name": "vector3",
"qualified_name": "vector3",
"definition": "1:1:7",
"definition": "1:7",
"vars": [3],
"uses": ["*1:1:7"]
"uses": ["*1:7"]
}, {
"id": 1,
"usr": "c:@U@vector3@Sa",
"short_name": "<anonymous>",
"qualified_name": "vector3::<anonymous>",
"definition": "1:2:3",
"definition": "2:3",
"vars": [0, 1, 2],
"uses": ["*1:2:3"]
"uses": ["*2:3"]
}],
"vars": [{
"id": 0,
"usr": "c:@U@vector3@Sa@FI@x",
"short_name": "x",
"qualified_name": "x",
"definition": "1:2:18",
"definition": "2:18",
"declaring_type": 1,
"uses": ["1:2:18"]
"uses": ["2:18"]
}, {
"id": 1,
"usr": "c:@U@vector3@Sa@FI@y",
"short_name": "y",
"qualified_name": "y",
"definition": "1:2:21",
"definition": "2:21",
"declaring_type": 1,
"uses": ["1:2:21"]
"uses": ["2:21"]
}, {
"id": 2,
"usr": "c:@U@vector3@Sa@FI@z",
"short_name": "z",
"qualified_name": "z",
"definition": "1:2:24",
"definition": "2:24",
"declaring_type": 1,
"uses": ["1:2:24"]
"uses": ["2:24"]
}, {
"id": 3,
"usr": "c:@U@vector3@FI@v",
"short_name": "v",
"qualified_name": "vector3::v",
"definition": "1:3:9",
"definition": "3:9",
"declaring_type": 0,
"uses": ["1:3:9"]
"uses": ["3:9"]
}]
}
*/

View File

@ -11,26 +11,26 @@ OUTPUT:
"usr": "c:@U@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"vars": [0, 1],
"uses": ["*1:1:7"]
"uses": ["*1:7"]
}],
"vars": [{
"id": 0,
"usr": "c:@U@Foo@FI@a",
"short_name": "a",
"qualified_name": "Foo::a",
"definition": "1:2:7",
"definition": "2:7",
"declaring_type": 0,
"uses": ["1:2:7"]
"uses": ["2:7"]
}, {
"id": 1,
"usr": "c:@U@Foo@FI@b",
"short_name": "b",
"qualified_name": "Foo::b",
"definition": "1:3:8",
"definition": "3:8",
"declaring_type": 0,
"uses": ["1:3:8"]
"uses": ["3:8"]
}]
}
*/

View File

@ -19,43 +19,43 @@ OUTPUT:
"usr": "c:@U@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"vars": [0, 1],
"instantiations": [2],
"uses": ["*1:1:7", "*1:6:1", "*1:8:10"]
"uses": ["*1:7", "*6:1", "*8:10"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@act#*$@U@Foo#",
"short_name": "act",
"qualified_name": "act",
"definition": "1:8:6",
"uses": ["1:8:6"]
"definition": "8:6",
"uses": ["8:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@U@Foo@FI@a",
"short_name": "a",
"qualified_name": "Foo::a",
"definition": "1:2:7",
"definition": "2:7",
"declaring_type": 0,
"uses": ["1:2:7", "1:9:5"]
"uses": ["2:7", "9:5"]
}, {
"id": 1,
"usr": "c:@U@Foo@FI@b",
"short_name": "b",
"qualified_name": "Foo::b",
"definition": "1:3:8",
"definition": "3:8",
"declaring_type": 0,
"uses": ["1:3:8"]
"uses": ["3:8"]
}, {
"id": 2,
"usr": "c:@f",
"short_name": "f",
"qualified_name": "f",
"definition": "1:6:5",
"definition": "6:5",
"variable_type": 0,
"uses": ["1:6:5", "1:9:3"]
"uses": ["6:5", "9:3"]
}]
}
*/

View File

@ -15,33 +15,33 @@ OUTPUT:
"usr": "c:@F@consume#*v#",
"short_name": "consume",
"qualified_name": "consume",
"definition": "1:1:6",
"callers": ["2@1:7:3"],
"uses": ["1:1:6", "1:7:3"]
"definition": "1:6",
"callers": ["2@7:3"],
"uses": ["1:6", "7:3"]
}, {
"id": 1,
"usr": "c:@F@used#",
"short_name": "used",
"qualified_name": "used",
"definition": "1:3:6",
"callers": ["2@1:6:13", "2@1:7:12"],
"uses": ["1:3:6", "1:6:13", "1:7:12"]
"definition": "3:6",
"callers": ["2@6:13", "2@7:12"],
"uses": ["3:6", "6:13", "7:12"]
}, {
"id": 2,
"usr": "c:@F@user#",
"short_name": "user",
"qualified_name": "user",
"definition": "1:5:6",
"callees": ["1@1:6:13", "0@1:7:3", "1@1:7:12"],
"uses": ["1:5:6"]
"definition": "5:6",
"callees": ["1@6:13", "0@7:3", "1@7:12"],
"uses": ["5:6"]
}],
"vars": [{
"id": 0,
"usr": "c:func_usage_addr_func.cc@61@F@user#@x",
"short_name": "x",
"qualified_name": "x",
"definition": "1:6:8",
"uses": ["1:6:8"]
"definition": "6:8",
"uses": ["6:8"]
}]
}
*/

View File

@ -15,35 +15,35 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:8",
"definition": "1:8",
"funcs": [0],
"uses": ["*1:1:8", "1:6:13"]
"uses": ["*1:8", "6:13"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@Used#",
"short_name": "Used",
"qualified_name": "Foo::Used",
"declarations": ["1:2:8"],
"declarations": ["2:8"],
"declaring_type": 0,
"callers": ["1@1:6:18"],
"uses": ["1:2:8", "1:6:18"]
"callers": ["1@6:18"],
"uses": ["2:8", "6:18"]
}, {
"id": 1,
"usr": "c:@F@user#",
"short_name": "user",
"qualified_name": "user",
"definition": "1:5:6",
"callees": ["0@1:6:18"],
"uses": ["1:5:6"]
"definition": "5:6",
"callees": ["0@6:18"],
"uses": ["5:6"]
}],
"vars": [{
"id": 0,
"usr": "c:func_usage_addr_method.cc@53@F@user#@x",
"short_name": "x",
"qualified_name": "x",
"definition": "1:6:8",
"uses": ["1:6:8"]
"definition": "6:8",
"uses": ["6:8"]
}]
}
*/

View File

@ -11,17 +11,17 @@ OUTPUT:
"usr": "c:@F@called#",
"short_name": "called",
"qualified_name": "called",
"definition": "1:1:6",
"callers": ["1@1:3:3"],
"uses": ["1:1:6", "1:3:3"]
"definition": "1:6",
"callers": ["1@3:3"],
"uses": ["1:6", "3:3"]
}, {
"id": 1,
"usr": "c:@F@caller#",
"short_name": "caller",
"qualified_name": "caller",
"definition": "1:2:6",
"callees": ["0@1:3:3"],
"uses": ["1:2:6"]
"definition": "2:6",
"callees": ["0@3:3"],
"uses": ["2:6"]
}]
}
*/

View File

@ -15,37 +15,37 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:8",
"definition": "1:8",
"funcs": [0],
"instantiations": [0],
"uses": ["*1:1:8", "*1:6:3"]
"uses": ["*1:8", "*6:3"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@Used#",
"short_name": "Used",
"qualified_name": "Foo::Used",
"declarations": ["1:2:8"],
"declarations": ["2:8"],
"declaring_type": 0,
"callers": ["1@1:7:6"],
"uses": ["1:2:8", "1:7:6"]
"callers": ["1@7:6"],
"uses": ["2:8", "7:6"]
}, {
"id": 1,
"usr": "c:@F@user#",
"short_name": "user",
"qualified_name": "user",
"definition": "1:5:6",
"callees": ["0@1:7:6"],
"uses": ["1:5:6"]
"definition": "5:6",
"callees": ["0@7:6"],
"uses": ["5:6"]
}],
"vars": [{
"id": 0,
"usr": "c:func_usage_call_method.cc@53@F@user#@f",
"short_name": "f",
"qualified_name": "f",
"definition": "1:6:8",
"definition": "6:8",
"variable_type": 0,
"uses": ["1:6:8", "1:7:3"]
"uses": ["6:8", "7:3"]
}]
}
*/

View File

@ -14,26 +14,26 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:5:7",
"definition": "5:7",
"vars": [0],
"uses": ["*1:5:7"]
"uses": ["*5:7"]
}],
"funcs": [{
"id": 0,
"usr": "c:func_usage_class_inline_var_def.cc@F@helper#",
"short_name": "helper",
"qualified_name": "helper",
"definition": "1:1:12",
"uses": ["1:1:12", "1:6:11"]
"definition": "1:12",
"uses": ["1:12", "6:11"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@FI@x",
"short_name": "x",
"qualified_name": "Foo::x",
"definition": "1:6:7",
"definition": "6:7",
"declaring_type": 0,
"uses": ["1:6:7"]
"uses": ["6:7"]
}]
}
*/

View File

@ -11,17 +11,17 @@ OUTPUT:
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"declarations": ["1:1:6"],
"callers": ["1@1:4:3"],
"uses": ["1:1:6", "1:4:3"]
"declarations": ["1:6"],
"callers": ["1@4:3"],
"uses": ["1:6", "4:3"]
}, {
"id": 1,
"usr": "c:@F@usage#",
"short_name": "usage",
"qualified_name": "usage",
"definition": "1:3:6",
"callees": ["0@1:4:3"],
"uses": ["1:3:6"]
"definition": "3:6",
"callees": ["0@4:3"],
"uses": ["3:6"]
}]
}
*/

View File

@ -14,37 +14,37 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:8",
"definition": "1:8",
"funcs": [0],
"instantiations": [0],
"uses": ["*1:1:8", "*1:6:3"]
"uses": ["*1:8", "*6:3"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@foo#",
"short_name": "foo",
"qualified_name": "Foo::foo",
"declarations": ["1:2:8"],
"declarations": ["2:8"],
"declaring_type": 0,
"callers": ["1@1:7:6"],
"uses": ["1:2:8", "1:7:6"]
"callers": ["1@7:6"],
"uses": ["2:8", "7:6"]
}, {
"id": 1,
"usr": "c:@F@usage#",
"short_name": "usage",
"qualified_name": "usage",
"definition": "1:5:6",
"callees": ["0@1:7:6"],
"uses": ["1:5:6"]
"definition": "5:6",
"callees": ["0@7:6"],
"uses": ["5:6"]
}],
"vars": [{
"id": 0,
"usr": "c:func_usage_forward_decl_method.cc@53@F@usage#@f",
"short_name": "f",
"qualified_name": "f",
"definition": "1:6:8",
"definition": "6:8",
"variable_type": 0,
"uses": ["1:6:8", "1:7:3"]
"uses": ["6:8", "7:3"]
}]
}
*/

View File

@ -14,17 +14,17 @@ OUTPUT:
"usr": "c:@FT@>1#Taccept#t0.0#v#",
"short_name": "accept",
"qualified_name": "accept",
"declarations": ["1:2:6"],
"callers": ["1@1:5:3", "1@1:6:3"],
"uses": ["1:2:6", "1:5:3", "1:6:3"]
"declarations": ["2:6"],
"callers": ["1@5:3", "1@6:3"],
"uses": ["2:6", "5:3", "6:3"]
}, {
"id": 1,
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:4:6",
"callees": ["0@1:5:3", "0@1:6:3"],
"uses": ["1:4:6"]
"definition": "4:6",
"callees": ["0@5:3", "0@6:3"],
"uses": ["4:6"]
}]
}
*/

View File

@ -17,47 +17,47 @@ OUTPUT:
"id": 0,
"usr": "c:@ST>1#T@unique_ptr",
"instantiations": [0, 1, 2],
"uses": ["1:2:7", "*1:6:8", "*1:7:8", "*1:9:1", "*1:10:3"]
"uses": ["2:7", "*6:8", "*7:8", "*9:1", "*10:3"]
}, {
"id": 1,
"usr": "c:@S@S",
"short_name": "S",
"qualified_name": "S",
"definition": "1:4:8",
"uses": ["*1:4:8", "*1:7:19", "*1:9:12", "*1:10:14"]
"definition": "4:8",
"uses": ["*4:8", "*7:19", "*9:12", "*10:14"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@return_type#",
"short_name": "return_type",
"qualified_name": "return_type",
"definition": "1:9:16",
"uses": ["1:9:16"]
"definition": "9:16",
"uses": ["9:16"]
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_as_template_parameter.cc@f0",
"short_name": "f0",
"qualified_name": "f0",
"definition": "1:6:25",
"definition": "6:25",
"variable_type": 0,
"uses": ["1:6:25"]
"uses": ["6:25"]
}, {
"id": 1,
"usr": "c:type_usage_as_template_parameter.cc@f1",
"short_name": "f1",
"qualified_name": "f1",
"definition": "1:7:22",
"definition": "7:22",
"variable_type": 0,
"uses": ["1:7:22"]
"uses": ["7:22"]
}, {
"id": 2,
"usr": "c:type_usage_as_template_parameter.cc@150@F@return_type#@local",
"short_name": "local",
"qualified_name": "local",
"definition": "1:10:18",
"definition": "10:18",
"variable_type": 0,
"uses": ["1:10:18"]
"uses": ["10:18"]
}]
}
*/

View File

@ -85,71 +85,71 @@ OUTPUT:
"id": 0,
"usr": "c:@ST>2#T#T@unique_ptr",
"instantiations": [0, 1],
"uses": ["1:2:7", "*1:15:8", "*1:15:19", "*1:33:1", "*1:33:12", "*1:33:52", "*1:54:3", "*1:54:14", "*1:65:3", "*1:79:1"]
"uses": ["2:7", "*15:8", "*15:19", "*33:1", "*33:12", "*33:52", "*54:3", "*54:14", "*65:3", "*79:1"]
}, {
"id": 1,
"usr": "c:@S@S1",
"uses": ["1:4:8", "*1:15:30", "*1:33:23", "*1:33:63", "*1:54:25", "*1:65:14", "*1:79:12"]
"uses": ["4:8", "*15:30", "*33:23", "*33:63", "*54:25", "*65:14", "*79:12"]
}, {
"id": 2,
"usr": "c:@S@S2",
"uses": ["1:5:8", "*1:15:34", "*1:15:39", "*1:33:27", "*1:33:32", "*1:33:67", "*1:54:29", "*1:54:34", "*1:65:18", "*1:79:16"]
"uses": ["5:8", "*15:34", "*15:39", "*33:27", "*33:32", "*33:67", "*54:29", "*54:34", "*65:18", "*79:16"]
}, {
"id": 3,
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:64:7",
"definition": "64:7",
"funcs": [3],
"uses": ["*1:64:7", "1:79:21"]
"uses": ["*64:7", "79:21"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@as_return_type#*$@S@unique_ptr>#$@S@S1#$@S@S2#",
"short_name": "as_return_type",
"qualified_name": "as_return_type",
"definition": "1:33:37",
"uses": ["1:33:37"]
"definition": "33:37",
"uses": ["33:37"]
}, {
"id": 1,
"usr": "c:@F@no_return_type#I#",
"short_name": "no_return_type",
"qualified_name": "no_return_type",
"definition": "1:40:6",
"uses": ["1:40:6"]
"definition": "40:6",
"uses": ["40:6"]
}, {
"id": 2,
"usr": "c:@F@empty#",
"short_name": "empty",
"qualified_name": "empty",
"definition": "1:53:6",
"uses": ["1:53:6"]
"definition": "53:6",
"uses": ["53:6"]
}, {
"id": 3,
"usr": "c:@S@Foo@F@foo#",
"short_name": "foo",
"qualified_name": "Foo::foo",
"declarations": ["1:65:23"],
"definition": "1:79:26",
"declarations": ["65:23"],
"definition": "79:26",
"declaring_type": 3,
"uses": ["1:65:23", "1:79:26"]
"uses": ["65:23", "79:26"]
}],
"vars": [{
"id": 0,
"usr": "c:@f",
"short_name": "f",
"qualified_name": "f",
"declaration": "1:15:43",
"declaration": "15:43",
"variable_type": 0,
"uses": ["1:15:43"]
"uses": ["15:43"]
}, {
"id": 1,
"usr": "c:type_usage_as_template_parameter_complex.cc@1062@F@empty#@local",
"short_name": "local",
"qualified_name": "local",
"definition": "1:54:39",
"definition": "54:39",
"variable_type": 0,
"uses": ["1:54:39"]
"uses": ["54:39"]
}]
}
*/

View File

@ -13,22 +13,22 @@ OUTPUT:
"usr": "c:@ST>1#T@unique_ptr",
"short_name": "unique_ptr",
"qualified_name": "unique_ptr",
"definition": "1:2:7",
"definition": "2:7",
"instantiations": [0],
"uses": ["*1:2:7", "*1:6:8"]
"uses": ["*2:7", "*6:8"]
}, {
"id": 1,
"usr": "c:@S@S",
"uses": ["1:4:8", "*1:6:19"]
"uses": ["4:8", "*6:19"]
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_as_template_parameter_simple.cc@foo",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:6:22",
"definition": "6:22",
"variable_type": 0,
"uses": ["1:6:22"]
"uses": ["6:22"]
}]
}
*/

View File

@ -9,18 +9,18 @@ OUTPUT:
"usr": "c:@S@T",
"short_name": "T",
"qualified_name": "T",
"definition": "1:1:8",
"definition": "1:8",
"instantiations": [0],
"uses": ["*1:1:8", "*1:3:8"]
"uses": ["*1:8", "*3:8"]
}],
"vars": [{
"id": 0,
"usr": "c:@t",
"short_name": "t",
"qualified_name": "t",
"declaration": "1:3:10",
"declaration": "3:10",
"variable_type": 0,
"uses": ["1:3:10"]
"uses": ["3:10"]
}]
}
*/

View File

@ -13,42 +13,42 @@ OUTPUT:
"id": 0,
"usr": "c:@S@ForwardType",
"instantiations": [0],
"uses": ["1:1:8", "*1:5:3"]
"uses": ["1:8", "*5:3"]
}, {
"id": 1,
"usr": "c:@S@ImplementedType",
"short_name": "ImplementedType",
"qualified_name": "ImplementedType",
"definition": "1:2:8",
"definition": "2:8",
"instantiations": [1],
"uses": ["*1:2:8", "*1:6:3"]
"uses": ["*2:8", "*6:3"]
}, {
"id": 2,
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:4:8",
"definition": "4:8",
"vars": [0, 1],
"uses": ["*1:4:8"]
"uses": ["*4:8"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@FI@a",
"short_name": "a",
"qualified_name": "Foo::a",
"definition": "1:5:16",
"definition": "5:16",
"variable_type": 0,
"declaring_type": 2,
"uses": ["1:5:16"]
"uses": ["5:16"]
}, {
"id": 1,
"usr": "c:@S@Foo@FI@b",
"short_name": "b",
"qualified_name": "Foo::b",
"definition": "1:6:19",
"definition": "6:19",
"variable_type": 1,
"declaring_type": 2,
"uses": ["1:6:19"]
"uses": ["6:19"]
}]
}
*/

View File

@ -13,40 +13,40 @@ OUTPUT:
"id": 0,
"usr": "c:@S@ForwardType",
"instantiations": [0],
"uses": ["1:1:8", "*1:5:3"]
"uses": ["1:8", "*5:3"]
}, {
"id": 1,
"usr": "c:@S@ImplementedType",
"short_name": "ImplementedType",
"qualified_name": "ImplementedType",
"definition": "1:2:8",
"definition": "2:8",
"instantiations": [1],
"uses": ["*1:2:8", "*1:6:3"]
"uses": ["*2:8", "*6:3"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@Foo#",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:4:6",
"uses": ["1:4:6"]
"definition": "4:6",
"uses": ["4:6"]
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_local.cc@67@F@Foo#@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:5:16",
"definition": "5:16",
"variable_type": 0,
"uses": ["1:5:16"]
"uses": ["5:16"]
}, {
"id": 1,
"usr": "c:type_usage_declare_local.cc@86@F@Foo#@b",
"short_name": "b",
"qualified_name": "b",
"definition": "1:6:19",
"definition": "6:19",
"variable_type": 1,
"uses": ["1:6:19"]
"uses": ["6:19"]
}]
}
*/

View File

@ -10,40 +10,40 @@ OUTPUT:
"id": 0,
"usr": "c:@S@ForwardType",
"instantiations": [0],
"uses": ["1:1:8", "*1:4:10"]
"uses": ["1:8", "*4:10"]
}, {
"id": 1,
"usr": "c:@S@ImplementedType",
"short_name": "ImplementedType",
"qualified_name": "ImplementedType",
"definition": "1:2:8",
"definition": "2:8",
"instantiations": [1],
"uses": ["*1:2:8", "*1:4:26"]
"uses": ["*2:8", "*4:26"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@foo#*$@S@ForwardType#$@S@ImplementedType#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:4:6",
"uses": ["1:4:6"]
"definition": "4:6",
"uses": ["4:6"]
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_param.cc@60@F@foo#*$@S@ForwardType#$@S@ImplementedType#@f",
"short_name": "f",
"qualified_name": "f",
"definition": "1:4:23",
"definition": "4:23",
"variable_type": 0,
"uses": ["1:4:23"]
"uses": ["4:23"]
}, {
"id": 1,
"usr": "c:type_usage_declare_param.cc@76@F@foo#*$@S@ForwardType#$@S@ImplementedType#@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:4:42",
"definition": "4:42",
"variable_type": 1,
"uses": ["1:4:42"]
"uses": ["4:42"]
}]
}
*/

View File

@ -15,25 +15,25 @@ OUTPUT:
"id": 0,
"usr": "c:@S@Foo",
"instantiations": [0],
"uses": ["1:1:8", "1:3:10", "1:3:18", "*1:4:10", "*1:4:18"]
"uses": ["1:8", "3:10", "3:18", "*4:10", "*4:18"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@foo#*$@S@Foo#S0_#",
"short_name": "foo",
"qualified_name": "foo",
"declarations": ["1:3:6"],
"definition": "1:4:6",
"uses": ["1:3:6", "1:4:6"]
"declarations": ["3:6"],
"definition": "4:6",
"uses": ["3:6", "4:6"]
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_param_prototype.cc@49@F@foo#*$@S@Foo#S0_#@f",
"short_name": "f",
"qualified_name": "f",
"definition": "1:4:15",
"definition": "4:15",
"variable_type": 0,
"uses": ["1:4:15"]
"uses": ["4:15"]
}]
}
*/

View File

@ -6,15 +6,15 @@ OUTPUT:
"types": [{
"id": 0,
"usr": "c:@S@ForwardType",
"uses": ["1:1:8", "*1:2:10"]
"uses": ["1:8", "*2:10"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@foo#*$@S@ForwardType#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:2:6",
"uses": ["1:2:6"]
"definition": "2:6",
"uses": ["2:6"]
}]
}
*/

View File

@ -14,66 +14,66 @@ OUTPUT:
"usr": "c:@S@Type",
"short_name": "Type",
"qualified_name": "Type",
"definition": "1:1:8",
"definition": "1:8",
"instantiations": [0, 1, 2, 3, 4, 5],
"uses": ["*1:1:8", "*1:3:10", "*1:3:26", "*1:4:3", "*1:5:3", "*1:6:9", "*1:7:9"]
"uses": ["*1:8", "*3:10", "*3:26", "*4:3", "*5:3", "*6:9", "*7:9"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@foo#&$@S@Type#&1S1_#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:3:6",
"uses": ["1:3:6"]
"definition": "3:6",
"uses": ["3:6"]
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_qualifiers.cc@28@F@foo#&$@S@Type#&1S1_#@a0",
"short_name": "a0",
"qualified_name": "a0",
"definition": "1:3:16",
"definition": "3:16",
"variable_type": 0,
"uses": ["1:3:16"]
"uses": ["3:16"]
}, {
"id": 1,
"usr": "c:type_usage_declare_qualifiers.cc@38@F@foo#&$@S@Type#&1S1_#@a1",
"short_name": "a1",
"qualified_name": "a1",
"definition": "1:3:32",
"definition": "3:32",
"variable_type": 0,
"uses": ["1:3:32"]
"uses": ["3:32"]
}, {
"id": 2,
"usr": "c:type_usage_declare_qualifiers.cc@59@F@foo#&$@S@Type#&1S1_#@a2",
"short_name": "a2",
"qualified_name": "a2",
"definition": "1:4:8",
"definition": "4:8",
"variable_type": 0,
"uses": ["1:4:8"]
"uses": ["4:8"]
}, {
"id": 3,
"usr": "c:type_usage_declare_qualifiers.cc@71@F@foo#&$@S@Type#&1S1_#@a3",
"short_name": "a3",
"qualified_name": "a3",
"definition": "1:5:9",
"definition": "5:9",
"variable_type": 0,
"uses": ["1:5:9"]
"uses": ["5:9"]
}, {
"id": 4,
"usr": "c:type_usage_declare_qualifiers.cc@84@F@foo#&$@S@Type#&1S1_#@a4",
"short_name": "a4",
"qualified_name": "a4",
"definition": "1:6:15",
"definition": "6:15",
"variable_type": 0,
"uses": ["1:6:15"]
"uses": ["6:15"]
}, {
"id": 5,
"usr": "c:type_usage_declare_qualifiers.cc@103@F@foo#&$@S@Type#&1S1_#@a5",
"short_name": "a5",
"qualified_name": "a5",
"definition": "1:7:21",
"definition": "7:21",
"variable_type": 0,
"uses": ["1:7:21"]
"uses": ["7:21"]
}]
}

View File

@ -7,16 +7,16 @@ OUTPUT:
"id": 0,
"usr": "c:@S@Type",
"instantiations": [0],
"uses": ["1:1:8", "*1:2:8"]
"uses": ["1:8", "*2:8"]
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_declare_static.cc@t",
"short_name": "t",
"qualified_name": "t",
"definition": "1:2:13",
"definition": "2:13",
"variable_type": 0,
"uses": ["1:2:13"]
"uses": ["2:13"]
}]
}
*/

View File

@ -23,57 +23,57 @@ OUTPUT:
"types": [{
"id": 0,
"usr": "c:@S@Type",
"uses": ["1:1:8", "*1:3:1", "*1:4:1", "*1:5:1", "*1:8:3", "*1:12:1", "*1:15:14", "*1:17:8", "*1:18:8"]
"uses": ["1:8", "*3:1", "*4:1", "*5:1", "*8:3", "*12:1", "*15:14", "*17:8", "*18:8"]
}, {
"id": 1,
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:7:7",
"definition": "7:7",
"funcs": [1, 2],
"uses": ["*1:7:7", "1:12:7", "1:13:6"]
"uses": ["*7:7", "12:7", "13:6"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"declarations": ["1:3:7", "1:4:7"],
"definition": "1:5:7",
"uses": ["1:3:7", "1:4:7", "1:5:7"]
"declarations": ["3:7", "4:7"],
"definition": "5:7",
"uses": ["3:7", "4:7", "5:7"]
}, {
"id": 1,
"usr": "c:@S@Foo@F@Get#I#",
"short_name": "Get",
"qualified_name": "Foo::Get",
"declarations": ["1:8:9"],
"definition": "1:12:12",
"declarations": ["8:9"],
"definition": "12:12",
"declaring_type": 1,
"uses": ["1:8:9", "1:12:12"]
"uses": ["8:9", "12:12"]
}, {
"id": 2,
"usr": "c:@S@Foo@F@Empty#",
"short_name": "Empty",
"qualified_name": "Foo::Empty",
"declarations": ["1:9:8"],
"definition": "1:13:11",
"declarations": ["9:8"],
"definition": "13:11",
"declaring_type": 1,
"uses": ["1:9:8", "1:13:11"]
"uses": ["9:8", "13:11"]
}, {
"id": 3,
"usr": "c:@F@external#",
"short_name": "external",
"qualified_name": "external",
"declarations": ["1:15:20"],
"uses": ["1:15:20"]
"declarations": ["15:20"],
"uses": ["15:20"]
}, {
"id": 4,
"usr": "c:type_usage_on_return_type.cc@F@bar#",
"short_name": "bar",
"qualified_name": "bar",
"declarations": ["1:17:14"],
"definition": "1:18:14",
"uses": ["1:17:14", "1:18:14"]
"declarations": ["17:14"],
"definition": "18:14",
"uses": ["17:14", "18:14"]
}]
}
*/

View File

@ -16,67 +16,67 @@ OUTPUT:
"types": [{
"id": 0,
"usr": "c:@S@Foo",
"uses": ["1:1:8", "*1:2:14", "*1:3:9", "*1:7:13"]
"uses": ["1:8", "*2:14", "*3:9", "*7:13"]
}, {
"id": 1,
"usr": "c:@Foo1",
"short_name": "Foo1",
"qualified_name": "Foo1",
"definition": "1:2:7",
"definition": "2:7",
"alias_of": 0,
"uses": ["*1:2:7", "*1:4:14", "*1:8:14"]
"uses": ["*2:7", "*4:14", "*8:14"]
}, {
"id": 2,
"usr": "c:type_usage_typedef_and_using.cc@T@Foo2",
"short_name": "Foo2",
"qualified_name": "Foo2",
"definition": "1:3:13",
"definition": "3:13",
"alias_of": 0,
"uses": ["*1:3:13", "*1:9:14"]
"uses": ["*3:13", "*9:14"]
}, {
"id": 3,
"usr": "c:@Foo3",
"short_name": "Foo3",
"qualified_name": "Foo3",
"definition": "1:4:7",
"definition": "4:7",
"alias_of": 1,
"uses": ["*1:4:7", "*1:10:14"]
"uses": ["*4:7", "*10:14"]
}, {
"id": 4,
"usr": "c:@Foo4",
"short_name": "Foo4",
"qualified_name": "Foo4",
"definition": "1:5:7",
"uses": ["*1:5:7"]
"definition": "5:7",
"uses": ["*5:7"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@accept#*$@S@Foo#",
"short_name": "accept",
"qualified_name": "accept",
"definition": "1:7:6",
"uses": ["1:7:6"]
"definition": "7:6",
"uses": ["7:6"]
}, {
"id": 1,
"usr": "c:@F@accept1#**$@S@Foo#",
"short_name": "accept1",
"qualified_name": "accept1",
"definition": "1:8:6",
"uses": ["1:8:6"]
"definition": "8:6",
"uses": ["8:6"]
}, {
"id": 2,
"usr": "c:@F@accept2#*$@S@Foo#",
"short_name": "accept2",
"qualified_name": "accept2",
"definition": "1:9:6",
"uses": ["1:9:6"]
"definition": "9:6",
"uses": ["9:6"]
}, {
"id": 3,
"usr": "c:@F@accept3#**$@S@Foo#",
"short_name": "accept3",
"qualified_name": "accept3",
"definition": "1:10:6",
"uses": ["1:10:6"]
"definition": "10:6",
"uses": ["10:6"]
}]
}
*/

View File

@ -10,23 +10,23 @@ OUTPUT:
"types": [{
"id": 0,
"usr": "c:@ST>1#T@Foo",
"uses": ["1:2:8", "*1:4:14", "*1:5:9"]
"uses": ["2:8", "*4:14", "*5:9"]
}, {
"id": 1,
"usr": "c:@Foo1",
"short_name": "Foo1",
"qualified_name": "Foo1",
"definition": "1:4:7",
"definition": "4:7",
"alias_of": 0,
"uses": ["*1:4:7", "*1:5:13"]
"uses": ["*4:7", "*5:13"]
}, {
"id": 2,
"usr": "c:type_usage_typedef_and_using_template.cc@T@Foo2",
"short_name": "Foo2",
"qualified_name": "Foo2",
"definition": "1:5:19",
"definition": "5:19",
"alias_of": 0,
"uses": ["*1:5:19"]
"uses": ["*5:19"]
}]
}
*/

View File

@ -17,37 +17,37 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"funcs": [0],
"instantiations": [0, 1],
"uses": ["*1:1:7", "*1:2:3", "*1:5:1", "1:5:6", "*1:6:3", "*1:10:8"]
"uses": ["*1:7", "*2:3", "*5:1", "5:6", "*6:3", "*10:8"]
}],
"funcs": [{
"id": 0,
"usr": "c:@S@Foo@F@make#",
"short_name": "make",
"qualified_name": "Foo::make",
"declarations": ["1:2:8"],
"definition": "1:5:11",
"declarations": ["2:8"],
"definition": "5:11",
"declaring_type": 0,
"uses": ["1:2:8", "1:5:11"]
"uses": ["2:8", "5:11"]
}],
"vars": [{
"id": 0,
"usr": "c:type_usage_various.cc@57@S@Foo@F@make#@f",
"short_name": "f",
"qualified_name": "f",
"definition": "1:6:7",
"definition": "6:7",
"variable_type": 0,
"uses": ["1:6:7"]
"uses": ["6:7"]
}, {
"id": 1,
"usr": "c:@foo",
"short_name": "foo",
"qualified_name": "foo",
"declaration": "1:10:12",
"declaration": "10:12",
"variable_type": 0,
"uses": ["1:10:12"]
"uses": ["10:12"]
}]
}
*/

View File

@ -22,59 +22,59 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:5:8",
"definition": "5:8",
"vars": [1, 0],
"uses": ["*1:5:8", "1:10:5", "1:14:22", "1:14:40"]
"uses": ["*5:8", "10:5", "14:22", "14:40"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@called#I#",
"short_name": "called",
"qualified_name": "called",
"declarations": ["1:1:6"],
"callers": ["2@1:14:3"],
"uses": ["1:1:6", "1:14:3"]
"declarations": ["1:6"],
"callers": ["2@14:3"],
"uses": ["1:6", "14:3"]
}, {
"id": 1,
"usr": "c:@F@gen#",
"short_name": "gen",
"qualified_name": "gen",
"declarations": ["1:3:5"],
"callers": ["2@1:14:14"],
"uses": ["1:3:5", "1:14:14"]
"declarations": ["3:5"],
"callers": ["2@14:14"],
"uses": ["3:5", "14:14"]
}, {
"id": 2,
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:12:6",
"callees": ["0@1:14:3", "1@1:14:14"],
"uses": ["1:12:6"]
"definition": "12:6",
"callees": ["0@14:3", "1@14:14"],
"uses": ["12:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@static_var",
"short_name": "static_var",
"qualified_name": "Foo::static_var",
"declaration": "1:6:14",
"definition": "1:10:10",
"declaration": "6:14",
"definition": "10:10",
"declaring_type": 0,
"uses": ["1:6:14", "1:10:10", "1:14:45"]
"uses": ["6:14", "10:10", "14:45"]
}, {
"id": 1,
"usr": "c:@S@Foo@FI@field_var",
"short_name": "field_var",
"qualified_name": "Foo::field_var",
"definition": "1:7:7",
"definition": "7:7",
"declaring_type": 0,
"uses": ["1:7:7", "1:14:28"]
"uses": ["7:7", "14:28"]
}, {
"id": 2,
"usr": "c:usage_inside_of_call.cc@145@F@foo#@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:13:7",
"uses": ["1:13:7", "1:14:10"]
"definition": "13:7",
"uses": ["13:7", "14:10"]
}]
}
*/

View File

@ -14,25 +14,25 @@ OUTPUT:
"usr": "c:@F@called#I#",
"short_name": "called",
"qualified_name": "called",
"declarations": ["1:1:6"],
"callers": ["2@1:6:3"],
"uses": ["1:1:6", "1:6:3"]
"declarations": ["1:6"],
"callers": ["2@6:3"],
"uses": ["1:6", "6:3"]
}, {
"id": 1,
"usr": "c:@F@gen#",
"short_name": "gen",
"qualified_name": "gen",
"definition": "1:3:5",
"callers": ["2@1:6:10", "2@1:6:18"],
"uses": ["1:3:5", "1:6:10", "1:6:18"]
"definition": "3:5",
"callers": ["2@6:10", "2@6:18"],
"uses": ["3:5", "6:10", "6:18"]
}, {
"id": 2,
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:5:6",
"callees": ["0@1:6:3", "1@1:6:10", "1@1:6:18"],
"uses": ["1:5:6"]
"definition": "5:6",
"callees": ["0@6:3", "1@6:10", "1@6:18"],
"uses": ["5:6"]
}]
}
*/

View File

@ -15,25 +15,25 @@ OUTPUT:
"usr": "c:@F@called#",
"short_name": "called",
"qualified_name": "called",
"definition": "1:1:6",
"callers": ["1@1:4:13", "1@1:7:3"],
"uses": ["1:1:6", "1:4:13", "1:7:3"]
"definition": "1:6",
"callers": ["1@4:13", "1@7:3"],
"uses": ["1:6", "4:13", "7:3"]
}, {
"id": 1,
"usr": "c:@F@caller#",
"short_name": "caller",
"qualified_name": "caller",
"definition": "1:3:6",
"callees": ["0@1:4:13", "0@1:7:3"],
"uses": ["1:3:6"]
"definition": "3:6",
"callees": ["0@4:13", "0@7:3"],
"uses": ["3:6"]
}],
"vars": [{
"id": 0,
"usr": "c:var_usage_call_function.cc@39@F@caller#@x",
"short_name": "x",
"qualified_name": "x",
"definition": "1:4:8",
"uses": ["1:4:8", "1:5:3"]
"definition": "4:8",
"uses": ["4:8", "5:3"]
}]
}
*/

View File

@ -25,60 +25,60 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"vars": [0, 1],
"instantiations": [2],
"uses": ["*1:1:7", "*1:11:3"]
"uses": ["*1:7", "*11:3"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@accept#I#",
"short_name": "accept",
"qualified_name": "accept",
"declarations": ["1:7:6"],
"callers": ["2@1:14:3", "2@1:15:3", "2@1:17:3"],
"uses": ["1:7:6", "1:14:3", "1:15:3", "1:17:3"]
"declarations": ["7:6"],
"callers": ["2@14:3", "2@15:3", "2@17:3"],
"uses": ["7:6", "14:3", "15:3", "17:3"]
}, {
"id": 1,
"usr": "c:@F@accept#*I#",
"short_name": "accept",
"qualified_name": "accept",
"declarations": ["1:8:6"],
"callers": ["2@1:16:3"],
"uses": ["1:8:6", "1:16:3"]
"declarations": ["8:6"],
"callers": ["2@16:3"],
"uses": ["8:6", "16:3"]
}, {
"id": 2,
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:10:6",
"callees": ["0@1:14:3", "0@1:15:3", "1@1:16:3", "0@1:17:3"],
"uses": ["1:10:6"]
"definition": "10:6",
"callees": ["0@14:3", "0@15:3", "1@16:3", "0@17:3"],
"uses": ["10:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@FI@x",
"short_name": "x",
"qualified_name": "Foo::x",
"definition": "1:3:7",
"definition": "3:7",
"declaring_type": 0,
"uses": ["1:3:7", "1:12:5", "1:13:5", "1:14:12", "1:15:12", "1:16:13"]
"uses": ["3:7", "12:5", "13:5", "14:12", "15:12", "16:13"]
}, {
"id": 1,
"usr": "c:@S@Foo@FI@y",
"short_name": "y",
"qualified_name": "Foo::y",
"definition": "1:4:7",
"definition": "4:7",
"declaring_type": 0,
"uses": ["1:4:7", "1:17:12"]
"uses": ["4:7", "17:12"]
}, {
"id": 2,
"usr": "c:var_usage_class_member.cc@105@F@foo#@f",
"short_name": "f",
"qualified_name": "f",
"definition": "1:11:7",
"definition": "11:7",
"variable_type": 0,
"uses": ["1:11:7", "1:12:3", "1:13:3", "1:14:10", "1:15:10", "1:16:11", "1:17:10"]
"uses": ["11:7", "12:3", "13:3", "14:10", "15:10", "16:11", "17:10"]
}]
}
*/

View File

@ -16,33 +16,33 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:8",
"uses": ["*1:1:8", "1:8:10"]
"definition": "1:8",
"uses": ["*1:8", "8:10"]
}],
"funcs": [{
"id": 0,
"usr": "c:@F@accept#I#",
"short_name": "accept",
"qualified_name": "accept",
"declarations": ["1:5:6"],
"callers": ["1@1:8:3"],
"uses": ["1:5:6", "1:8:3"]
"declarations": ["5:6"],
"callers": ["1@8:3"],
"uses": ["5:6", "8:3"]
}, {
"id": 1,
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:7:6",
"callees": ["0@1:8:3"],
"uses": ["1:7:6"]
"definition": "7:6",
"callees": ["0@8:3"],
"uses": ["7:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@x",
"short_name": "x",
"qualified_name": "Foo::x",
"declaration": "1:2:14",
"uses": ["1:2:14", "1:8:15"]
"declaration": "2:14",
"uses": ["2:14", "8:15"]
}]
}
*/

View File

@ -15,28 +15,28 @@ OUTPUT:
"usr": "c:@E@VarType",
"short_name": "VarType",
"qualified_name": "VarType",
"definition": "1:1:6",
"definition": "1:6",
"instantiations": [0],
"uses": ["*1:1:6", "*1:4:20", "*1:4:42", "*1:7:7"]
"uses": ["*1:6", "*4:20", "*4:42", "*7:7"]
}, {
"id": 1,
"usr": "c:@S@Holder",
"short_name": "Holder",
"qualified_name": "Holder",
"definition": "1:3:8",
"definition": "3:8",
"vars": [0],
"uses": ["*1:3:8", "1:7:15"]
"uses": ["*3:8", "7:15"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Holder@static_var",
"short_name": "static_var",
"qualified_name": "Holder::static_var",
"declaration": "1:4:28",
"definition": "1:7:23",
"declaration": "4:28",
"definition": "7:23",
"variable_type": 0,
"declaring_type": 1,
"uses": ["1:4:28", "1:7:23"]
"uses": ["4:28", "7:23"]
}]
}
*/

View File

@ -11,16 +11,16 @@ OUTPUT:
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:3:6",
"uses": ["1:3:6"]
"definition": "3:6",
"uses": ["3:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@a",
"short_name": "a",
"qualified_name": "a",
"declaration": "1:1:12",
"uses": ["1:1:12", "1:4:3"]
"declaration": "1:12",
"uses": ["1:12", "4:3"]
}]
}
*/

View File

@ -9,16 +9,16 @@ OUTPUT:
"usr": "c:@F@foo#I#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:1:6",
"uses": ["1:1:6"]
"definition": "1:6",
"uses": ["1:6"]
}],
"vars": [{
"id": 0,
"usr": "c:var_usage_func_parameter.cc@9@F@foo#I#@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:1:14",
"uses": ["1:1:14", "1:2:3"]
"definition": "1:14",
"uses": ["1:14", "2:3"]
}]
}
*/

View File

@ -10,16 +10,16 @@ OUTPUT:
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:1:6",
"uses": ["1:1:6"]
"definition": "1:6",
"uses": ["1:6"]
}],
"vars": [{
"id": 0,
"usr": "c:var_usage_local.cc@16@F@foo#@x",
"short_name": "x",
"qualified_name": "x",
"definition": "1:2:7",
"uses": ["1:2:7", "1:3:3"]
"definition": "2:7",
"uses": ["2:7", "3:3"]
}]
}
*/

View File

@ -15,23 +15,23 @@ OUTPUT:
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:1:6",
"uses": ["1:1:6"]
"definition": "1:6",
"uses": ["1:6"]
}],
"vars": [{
"id": 0,
"usr": "c:var_usage_shadowed_local.cc@16@F@foo#@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:2:7",
"uses": ["1:2:7", "1:3:3", "1:8:3"]
"definition": "2:7",
"uses": ["2:7", "3:3", "8:3"]
}, {
"id": 1,
"usr": "c:var_usage_shadowed_local.cc@43@F@foo#@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:5:9",
"uses": ["1:5:9", "1:6:5"]
"definition": "5:9",
"uses": ["5:9", "6:5"]
}]
}
*/

View File

@ -15,23 +15,23 @@ OUTPUT:
"usr": "c:@F@foo#I#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:1:6",
"uses": ["1:1:6"]
"definition": "1:6",
"uses": ["1:6"]
}],
"vars": [{
"id": 0,
"usr": "c:var_usage_shadowed_parameter.cc@9@F@foo#I#@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:1:14",
"uses": ["1:1:14", "1:2:3", "1:7:3"]
"definition": "1:14",
"uses": ["1:14", "2:3", "7:3"]
}, {
"id": 1,
"usr": "c:var_usage_shadowed_parameter.cc@38@F@foo#I#@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:4:9",
"uses": ["1:4:9", "1:5:5"]
"definition": "4:9",
"uses": ["4:9", "5:5"]
}]
}
*/

View File

@ -12,16 +12,16 @@ OUTPUT:
"usr": "c:@F@foo#",
"short_name": "foo",
"qualified_name": "foo",
"definition": "1:3:6",
"uses": ["1:3:6"]
"definition": "3:6",
"uses": ["3:6"]
}],
"vars": [{
"id": 0,
"usr": "c:var_usage_static.cc@a",
"short_name": "a",
"qualified_name": "a",
"definition": "1:1:12",
"uses": ["1:1:12", "1:4:3"]
"definition": "1:12",
"uses": ["1:12", "4:3"]
}]
}
*/

View File

@ -9,20 +9,20 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"vars": [0],
"instantiations": [0],
"uses": ["*1:1:7", "*1:2:3"]
"uses": ["*1:7", "*2:3"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@FI@member",
"short_name": "member",
"qualified_name": "Foo::member",
"definition": "1:2:8",
"definition": "2:8",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:2:8"]
"uses": ["2:8"]
}]
}
*/

View File

@ -11,21 +11,21 @@ OUTPUT:
"usr": "c:@S@Foo",
"short_name": "Foo",
"qualified_name": "Foo",
"definition": "1:1:7",
"definition": "1:7",
"vars": [0],
"instantiations": [0],
"uses": ["*1:1:7", "*1:2:10", "*1:4:1", "1:4:6"]
"uses": ["*1:7", "*2:10", "*4:1", "4:6"]
}],
"vars": [{
"id": 0,
"usr": "c:@S@Foo@member",
"short_name": "member",
"qualified_name": "Foo::member",
"declaration": "1:2:15",
"definition": "1:4:11",
"declaration": "2:15",
"definition": "4:11",
"variable_type": 0,
"declaring_type": 0,
"uses": ["1:2:15", "1:4:11"]
"uses": ["2:15", "4:11"]
}]
}
*/

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