Datastructure update

This commit is contained in:
Jacob Dufault 2017-02-24 22:08:14 -08:00
parent d59b7c7379
commit f3f72a0dfa
29 changed files with 190 additions and 155 deletions

View File

@ -71,12 +71,12 @@ std::string IndexedFile::ToString() {
return output.GetString(); return output.GetString();
} }
IndexedTypeDef::IndexedTypeDef(TypeId id, const std::string& usr) : id(id), usr(usr) { IndexedTypeDef::IndexedTypeDef(TypeId id, const std::string& usr) : def(id, usr) {
assert(usr.size() > 0); assert(usr.size() > 0);
//std::cout << "Creating type with usr " << usr << std::endl; //std::cout << "Creating type with usr " << usr << std::endl;
} }
void IndexedTypeDef::AddUsage(Location loc, bool insert_if_not_present = true) { void IndexedTypeDef::AddUsage(Location loc, bool insert_if_not_present) {
if (is_system_def) if (is_system_def)
return; return;
@ -430,15 +430,15 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// TODO: Eventually run with this if. Right now I want to iron out bugs this may shadow. // TODO: Eventually run with this if. Right now I want to iron out bugs this may shadow.
// TODO: Verify this gets called multiple times // TODO: Verify this gets called multiple times
//if (!decl->isRedeclaration) { //if (!decl->isRedeclaration) {
var_def->short_name = decl->entityInfo->name; var_def->def.short_name = decl->entityInfo->name;
var_def->qualified_name = ns->QualifiedName(decl->semanticContainer, var_def->short_name); var_def->def.qualified_name = ns->QualifiedName(decl->semanticContainer, var_def->def.short_name);
//} //}
Location decl_loc = db->file_db.Resolve(decl->loc, false /*interesting*/); Location decl_loc = db->file_db.Resolve(decl->loc, false /*interesting*/);
if (decl->isDefinition) if (decl->isDefinition)
var_def->definition = decl_loc; var_def->def.definition = decl_loc;
else else
var_def->declaration = decl_loc; var_def->def.declaration = decl_loc;
var_def->uses.push_back(decl_loc); var_def->uses.push_back(decl_loc);
@ -448,14 +448,14 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// declarations for unnamed parameters. // declarations for unnamed parameters.
optional<TypeId> var_type = ResolveDeclToType(db, decl_cursor, decl_cursor.get_kind() != CXCursor_ParmDecl /*is_interesting*/, decl->semanticContainer, decl->lexicalContainer); optional<TypeId> var_type = ResolveDeclToType(db, decl_cursor, decl_cursor.get_kind() != CXCursor_ParmDecl /*is_interesting*/, decl->semanticContainer, decl->lexicalContainer);
if (var_type.has_value()) if (var_type.has_value())
var_def->variable_type = var_type.value(); var_def->def.variable_type = var_type.value();
if (decl->isDefinition && IsTypeDefinition(decl->semanticContainer)) { if (decl->isDefinition && IsTypeDefinition(decl->semanticContainer)) {
TypeId declaring_type_id = db->ToTypeId(decl->semanticContainer->cursor); TypeId declaring_type_id = db->ToTypeId(decl->semanticContainer->cursor);
IndexedTypeDef* declaring_type_def = db->Resolve(declaring_type_id); IndexedTypeDef* declaring_type_def = db->Resolve(declaring_type_id);
var_def->declaring_type = declaring_type_id; var_def->def.declaring_type = declaring_type_id;
declaring_type_def->vars.push_back(var_id); declaring_type_def->def.vars.push_back(var_id);
} }
break; break;
@ -476,15 +476,15 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// TODO: Eventually run with this if. Right now I want to iron out bugs this may shadow. // TODO: Eventually run with this if. Right now I want to iron out bugs this may shadow.
//if (!decl->isRedeclaration) { //if (!decl->isRedeclaration) {
func_def->short_name = decl->entityInfo->name; func_def->def.short_name = decl->entityInfo->name;
func_def->qualified_name = ns->QualifiedName(decl->semanticContainer, func_def->short_name); func_def->def.qualified_name = ns->QualifiedName(decl->semanticContainer, func_def->def.short_name);
//} //}
Location decl_loc = db->file_db.Resolve(decl->loc, false /*interesting*/); Location decl_loc = db->file_db.Resolve(decl->loc, false /*interesting*/);
if (decl->isDefinition) if (decl->isDefinition)
func_def->definition = decl_loc; func_def->def.definition = decl_loc;
else else
func_def->declaration = decl_loc; func_def->declarations.push_back(decl_loc);
func_def->uses.push_back(decl_loc); func_def->uses.push_back(decl_loc);
bool is_pure_virtual = clang_CXXMethod_isPureVirtual(decl->cursor); bool is_pure_virtual = clang_CXXMethod_isPureVirtual(decl->cursor);
@ -497,7 +497,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
if (IsTypeDefinition(decl->semanticContainer)) { if (IsTypeDefinition(decl->semanticContainer)) {
TypeId declaring_type_id = db->ToTypeId(decl->semanticContainer->cursor); TypeId declaring_type_id = db->ToTypeId(decl->semanticContainer->cursor);
IndexedTypeDef* declaring_type_def = db->Resolve(declaring_type_id); IndexedTypeDef* declaring_type_def = db->Resolve(declaring_type_id);
func_def->declaring_type = declaring_type_id; func_def->def.declaring_type = declaring_type_id;
// Mark a type reference at the ctor/dtor location. // Mark a type reference at the ctor/dtor location.
// TODO: Should it be interesting? // TODO: Should it be interesting?
@ -507,8 +507,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
} }
// Register function in declaring type if it hasn't been registered yet. // Register function in declaring type if it hasn't been registered yet.
if (!Contains(declaring_type_def->funcs, func_id)) if (!Contains(declaring_type_def->def.funcs, func_id))
declaring_type_def->funcs.push_back(func_id); declaring_type_def->def.funcs.push_back(func_id);
} }
@ -562,7 +562,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
IndexedFuncDef* parent_def = db->Resolve(parent_id); IndexedFuncDef* parent_def = db->Resolve(parent_id);
func_def = db->Resolve(func_id); // ToFuncId invalidated func_def func_def = db->Resolve(func_id); // ToFuncId invalidated func_def
func_def->base = parent_id; func_def->def.base = parent_id;
parent_def->derived.push_back(func_id); parent_def->derived.push_back(func_id);
} }
@ -592,13 +592,13 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
type_def->is_system_def = is_system_def; type_def->is_system_def = is_system_def;
if (alias_of) if (alias_of)
type_def->alias_of = alias_of.value(); type_def->def.alias_of = alias_of.value();
type_def->short_name = decl->entityInfo->name; type_def->def.short_name = decl->entityInfo->name;
type_def->qualified_name = ns->QualifiedName(decl->semanticContainer, type_def->short_name); type_def->def.qualified_name = ns->QualifiedName(decl->semanticContainer, type_def->def.short_name);
Location decl_loc = db->file_db.Resolve(decl->loc, true /*interesting*/); Location decl_loc = db->file_db.Resolve(decl->loc, true /*interesting*/);
type_def->definition = decl_loc.WithInteresting(false); type_def->def.definition = decl_loc.WithInteresting(false);
type_def->AddUsage(decl_loc); type_def->AddUsage(decl_loc);
break; break;
} }
@ -620,19 +620,19 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// name can be null in an anonymous struct (see tests/types/anonymous_struct.cc). // name can be null in an anonymous struct (see tests/types/anonymous_struct.cc).
if (decl->entityInfo->name) { if (decl->entityInfo->name) {
ns->RegisterQualifiedName(decl->entityInfo->USR, decl->semanticContainer, decl->entityInfo->name); ns->RegisterQualifiedName(decl->entityInfo->USR, decl->semanticContainer, decl->entityInfo->name);
type_def->short_name = decl->entityInfo->name; type_def->def.short_name = decl->entityInfo->name;
} }
else { else {
type_def->short_name = "<anonymous>"; type_def->def.short_name = "<anonymous>";
} }
type_def->qualified_name = ns->QualifiedName(decl->semanticContainer, type_def->short_name); type_def->def.qualified_name = ns->QualifiedName(decl->semanticContainer, type_def->def.short_name);
// } // }
assert(decl->isDefinition); assert(decl->isDefinition);
Location decl_loc = db->file_db.Resolve(decl->loc, true /*interesting*/); Location decl_loc = db->file_db.Resolve(decl->loc, true /*interesting*/);
type_def->definition = decl_loc.WithInteresting(false); type_def->def.definition = decl_loc.WithInteresting(false);
type_def->AddUsage(decl_loc); type_def->AddUsage(decl_loc);
//type_def->alias_of //type_def->alias_of
@ -652,7 +652,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
if (parent_type_id) { if (parent_type_id) {
IndexedTypeDef* parent_type_def = db->Resolve(parent_type_id.value()); IndexedTypeDef* parent_type_def = db->Resolve(parent_type_id.value());
parent_type_def->derived.push_back(type_id); parent_type_def->derived.push_back(type_id);
type_def->parents.push_back(parent_type_id.value()); type_def->def.parents.push_back(parent_type_id.value());
} }
} }
} }
@ -729,7 +729,7 @@ void indexEntityReference(CXClientData client_data, const CXIdxEntityRefInfo* re
IndexedFuncDef* caller_def = db->Resolve(caller_id); IndexedFuncDef* caller_def = db->Resolve(caller_id);
IndexedFuncDef* called_def = db->Resolve(called_id); IndexedFuncDef* called_def = db->Resolve(called_id);
caller_def->callees.push_back(FuncRef(called_id, loc)); caller_def->def.callees.push_back(FuncRef(called_id, loc));
called_def->callers.push_back(FuncRef(caller_id, loc)); called_def->callers.push_back(FuncRef(caller_id, loc));
called_def->uses.push_back(loc); called_def->uses.push_back(loc);
} }
@ -750,8 +750,8 @@ void indexEntityReference(CXClientData client_data, const CXIdxEntityRefInfo* re
Location our_loc = db->file_db.Resolve(ref->loc, true /*is_interesting*/); Location our_loc = db->file_db.Resolve(ref->loc, true /*is_interesting*/);
if (!parent_loc.IsEqualTo(our_loc)) { if (!parent_loc.IsEqualTo(our_loc)) {
IndexedFuncDef* called_def = db->Resolve(called_id); IndexedFuncDef* called_def = db->Resolve(called_id);
assert(called_def->declaring_type.has_value()); assert(called_def->def.declaring_type.has_value());
IndexedTypeDef* type_def = db->Resolve(called_def->declaring_type.value()); IndexedTypeDef* type_def = db->Resolve(called_def->def.declaring_type.value());
type_def->AddUsage(our_loc); type_def->AddUsage(our_loc);
} }
} }
@ -932,7 +932,7 @@ void WriteToFile(const std::string& filename, const std::string& content) {
file << content; file << content;
} }
int main3(int argc, char** argv) { int main(int argc, char** argv) {
// TODO: Assert that we need to be on clang >= 3.9.1 // TODO: Assert that we need to be on clang >= 3.9.1
/* /*

View File

@ -166,9 +166,7 @@ using VarRef = Ref<IndexedVarDef>;
// TODO: Either eliminate the defs created as a by-product of cross-referencing, // TODO: Either eliminate the defs created as a by-product of cross-referencing,
// or do not emit things we don't have definitions for. // or do not emit things we don't have definitions for.
struct IndexedTypeDef { struct TypeDefDefinitionData {
bool is_system_def = false;
// General metadata. // General metadata.
TypeId id; TypeId id;
std::string usr; std::string usr;
@ -190,44 +188,67 @@ struct IndexedTypeDef {
// type comes from a using or typedef statement). // type comes from a using or typedef statement).
optional<TypeId> alias_of; optional<TypeId> alias_of;
// Immediate parent and immediate derived types. // Immediate parent types.
std::vector<TypeId> parents; std::vector<TypeId> parents;
std::vector<TypeId> derived;
// Types, functions, and variables defined in this type. // Types, functions, and variables defined in this type.
std::vector<TypeId> types; std::vector<TypeId> types;
std::vector<FuncId> funcs; std::vector<FuncId> funcs;
std::vector<VarId> vars; std::vector<VarId> vars;
TypeDefDefinitionData(TypeId id, const std::string& usr) : id(id), usr(usr) {}
};
struct IndexedTypeDef {
TypeDefDefinitionData def;
// Immediate derived types.
std::vector<TypeId> derived;
// Every usage, useful for things like renames. // Every usage, useful for things like renames.
// NOTE: Do not insert directly! Use AddUsage instead. // NOTE: Do not insert directly! Use AddUsage instead.
std::vector<Location> uses; std::vector<Location> uses;
bool is_system_def = false;
IndexedTypeDef(TypeId id, const std::string& usr); IndexedTypeDef(TypeId id, const std::string& usr);
void AddUsage(Location loc, bool insert_if_not_present = true); void AddUsage(Location loc, bool insert_if_not_present = true);
}; };
struct IndexedFuncDef { struct FuncDefDefinitionData {
bool is_system_def = false;
// General metadata. // General metadata.
FuncId id; FuncId id;
std::string usr; std::string usr;
std::string short_name; std::string short_name;
std::string qualified_name; std::string qualified_name;
optional<Location> declaration;
optional<Location> definition; optional<Location> definition;
// Type which declares this one (ie, it is a method) // Type which declares this one (ie, it is a method)
optional<TypeId> declaring_type; optional<TypeId> declaring_type;
// Method this method overrides. // Method this method overrides.
optional<FuncId> base; optional<FuncId> base;
// Methods which directly override this one.
std::vector<FuncId> derived;
// Local variables defined in this function. // Local variables defined in this function.
std::vector<VarId> locals; std::vector<VarId> locals;
// Functions that this function calls.
std::vector<FuncRef> callees;
FuncDefDefinitionData(FuncId id, const std::string& usr) : id(id), usr(usr) {
assert(usr.size() > 0);
}
};
struct IndexedFuncDef {
FuncDefDefinitionData def;
// Places the function is forward-declared.
std::vector<Location> declarations;
// Methods which directly override this one.
std::vector<FuncId> derived;
// Functions which call this one. // Functions which call this one.
// TODO: Functions can get called outside of just functions - for example, // TODO: Functions can get called outside of just functions - for example,
// they can get called in static context (maybe redirect to main?) // they can get called in static context (maybe redirect to main?)
@ -235,20 +256,18 @@ struct IndexedFuncDef {
// - Right now those usages will not get listed here (but they should be // - Right now those usages will not get listed here (but they should be
// inside of all_uses). // inside of all_uses).
std::vector<FuncRef> callers; std::vector<FuncRef> callers;
// Functions that this function calls.
std::vector<FuncRef> callees;
// All usages. For interesting usages, see callees. // All usages. For interesting usages, see callees.
std::vector<Location> uses; std::vector<Location> uses;
IndexedFuncDef(FuncId id, const std::string& usr) : id(id), usr(usr) { bool is_system_def = false;
IndexedFuncDef(FuncId id, const std::string& usr) : def(id, usr) {
assert(usr.size() > 0); assert(usr.size() > 0);
} }
}; };
struct IndexedVarDef { struct VarDefDefinitionData {
bool is_system_def = false;
// General metadata. // General metadata.
VarId id; VarId id;
std::string usr; std::string usr;
@ -265,10 +284,18 @@ struct IndexedVarDef {
// Type which declares this one (ie, it is a method) // Type which declares this one (ie, it is a method)
optional<TypeId> declaring_type; optional<TypeId> declaring_type;
VarDefDefinitionData(VarId id, const std::string& usr) : id(id), usr(usr) {}
};
struct IndexedVarDef {
VarDefDefinitionData def;
// Usages. // Usages.
std::vector<Location> uses; std::vector<Location> uses;
IndexedVarDef(VarId id, const std::string& usr) : id(id), usr(usr) { bool is_system_def = false;
IndexedVarDef(VarId id, const std::string& usr) : def(id, usr) {
assert(usr.size() > 0); assert(usr.size() > 0);
} }
}; };
@ -310,6 +337,10 @@ struct IndexedFile {
// TODO: ^^^ I don't think we can do this. It will probably stall the main // TODO: ^^^ I don't think we can do this. It will probably stall the main
// indexer for far too long since we will have to iterate over tons of // indexer for far too long since we will have to iterate over tons of
// data. // data.
// TODO: Idea: when indexing and joining to the main db, allow many dbs that
// are joined to. So that way even if the main db is busy we can
// still be joining. Joining the partially joined db to the main
// db should be faster since we will have larger data lanes to use.
struct IndexedTypeDefDiff {}; struct IndexedTypeDefDiff {};
struct IndexedFuncDefDiff {}; struct IndexedFuncDefDiff {};
struct IndexedVarDefDiff {}; struct IndexedVarDefDiff {};

View File

@ -24,53 +24,57 @@ struct SymbolIdx {
}; };
}; };
template<typename T>
struct TrackContributors {
std::vector<T> values; // There are two sources of reindex updates: the (single) definition of a
std::vector<FileId> contributors; // symbol has changed, or one of many users of the symbol has changed.
//
// For simplicitly, if the single definition has changed, we update all of the
// associated single-owner definition data. See |Update*DefId|.
//
// If one of the many symbol users submits an update, we store the update such
// that it can be merged with other updates before actually being applied to
// the main database. See |MergeableUpdate|.
template<typename TId, typename TValue>
struct MergeableUpdate {
// The type/func/var which is getting new usages.
TId id;
// Entries to add and remove.
std::vector<TValue> to_add;
std::vector<TValue> to_remove;
}; };
// See comments in IndexedTypeDef for variable descriptions.
struct QueryableTypeDef { struct QueryableTypeDef {
TypeId id; TypeDefDefinitionData def;
std::string short_name; std::vector<TypeId> derived;
std::string qualified_name; std::vector<Location> uses;
optional<Location> definition;
optional<TypeId> alias_of; using DefUpdate = TypeDefDefinitionData;
std::vector<TypeId> parents; using DerivedUpdate = MergeableUpdate<TypeId, TypeId>;
TrackContributors<TypeId> derived; using UsesUpdate = MergeableUpdate<TypeId, Location>;
std::vector<TypeId> types;
std::vector<FuncId> funcs;
std::vector<VarId> vars;
TrackContributors<Location> uses;
}; };
// See comments in IndexedFuncDef for variable descriptions.
struct QueryableFuncDef { struct QueryableFuncDef {
FuncId id; FuncDefDefinitionData def;
std::string short_name; std::vector<Location> declarations;
std::string qualified_name; std::vector<FuncId> derived;
TrackContributors<Location> declarations; std::vector<FuncRef> callers;
optional<Location> definition; std::vector<Location> uses;
optional<TypeId> declaring_type;
optional<FuncId> base; using DefUpdate = FuncDefDefinitionData;
TrackContributors<FuncId> derived; using DeclarationsUpdate = MergeableUpdate<FuncId, Location>;
std::vector<VarId> locals; using DerivedUpdate = MergeableUpdate<FuncId, FuncId>;
TrackContributors<FuncRef> callers; using CallersUpdate = MergeableUpdate<FuncId, FuncRef>;
std::vector<FuncRef> callees; using UsesUpdate = MergeableUpdate<FuncId, Location>;
TrackContributors<Location> uses;
}; };
// See comments in IndexedVarDef for variable descriptions.
struct QueryableVarDef { struct QueryableVarDef {
VarId id; VarDefDefinitionData def;
std::string short_name; std::vector<Location> uses;
std::string qualified_name;
TrackContributors<Location> declaration; using DefUpdate = VarDefDefinitionData;
optional<Location> definition; using UsesUpdate = MergeableUpdate<VarId, Location>;
optional<TypeId> variable_type;
optional<TypeId> declaring_type;
TrackContributors<Location> uses;
}; };
struct QueryableFile { struct QueryableFile {

View File

@ -193,11 +193,11 @@ void Serialize(Writer& writer, const char* key, uint64_t value) {
void Serialize(Writer& writer, IndexedFile* file) { void Serialize(Writer& writer, IndexedFile* file) {
auto it = file->usr_to_type_id.find(""); auto it = file->usr_to_type_id.find("");
if (it != file->usr_to_type_id.end()) { if (it != file->usr_to_type_id.end()) {
file->Resolve(it->second)->short_name = "<fundamental>"; file->Resolve(it->second)->def.short_name = "<fundamental>";
assert(file->Resolve(it->second)->uses.size() == 0); assert(file->Resolve(it->second)->uses.size() == 0);
} }
#define SERIALIZE(name) Serialize(writer, #name, def.name) #define SERIALIZE(name, value) Serialize(writer, name, def.value)
writer.StartObject(); writer.StartObject();
@ -208,18 +208,18 @@ void Serialize(Writer& writer, IndexedFile* file) {
if (def.is_system_def) continue; if (def.is_system_def) continue;
writer.StartObject(); writer.StartObject();
SERIALIZE(id); SERIALIZE("id", def.id);
SERIALIZE(usr); SERIALIZE("usr", def.usr);
SERIALIZE(short_name); SERIALIZE("short_name", def.short_name);
SERIALIZE(qualified_name); SERIALIZE("qualified_name", def.qualified_name);
SERIALIZE(definition); SERIALIZE("definition", def.definition);
SERIALIZE(alias_of); SERIALIZE("alias_of", def.alias_of);
SERIALIZE(parents); SERIALIZE("parents", def.parents);
SERIALIZE(derived); SERIALIZE("derived", derived);
SERIALIZE(types); SERIALIZE("types", def.types);
SERIALIZE(funcs); SERIALIZE("funcs", def.funcs);
SERIALIZE(vars); SERIALIZE("vars", def.vars);
SERIALIZE(uses); SERIALIZE("uses", uses);
writer.EndObject(); writer.EndObject();
} }
writer.EndArray(); writer.EndArray();
@ -231,19 +231,19 @@ void Serialize(Writer& writer, IndexedFile* file) {
if (def.is_system_def) continue; if (def.is_system_def) continue;
writer.StartObject(); writer.StartObject();
SERIALIZE(id); SERIALIZE("id", def.id);
SERIALIZE(usr); SERIALIZE("usr", def.usr);
SERIALIZE(short_name); SERIALIZE("short_name", def.short_name);
SERIALIZE(qualified_name); SERIALIZE("qualified_name", def.qualified_name);
SERIALIZE(declaration); SERIALIZE("declarations", declarations);
SERIALIZE(definition); SERIALIZE("definition", def.definition);
SERIALIZE(declaring_type); SERIALIZE("declaring_type", def.declaring_type);
SERIALIZE(base); SERIALIZE("base", def.base);
SERIALIZE(derived); SERIALIZE("derived", derived);
SERIALIZE(locals); SERIALIZE("locals", def.locals);
SERIALIZE(callers); SERIALIZE("callers", callers);
SERIALIZE(callees); SERIALIZE("callees", def.callees);
SERIALIZE(uses); SERIALIZE("uses", uses);
writer.EndObject(); writer.EndObject();
} }
writer.EndArray(); writer.EndArray();
@ -255,15 +255,15 @@ void Serialize(Writer& writer, IndexedFile* file) {
if (def.is_system_def) continue; if (def.is_system_def) continue;
writer.StartObject(); writer.StartObject();
SERIALIZE(id); SERIALIZE("id", def.id);
SERIALIZE(usr); SERIALIZE("usr", def.usr);
SERIALIZE(short_name); SERIALIZE("short_name", def.short_name);
SERIALIZE(qualified_name); SERIALIZE("qualified_name", def.qualified_name);
SERIALIZE(declaration); SERIALIZE("declaration", def.declaration);
SERIALIZE(definition); SERIALIZE("definition", def.definition);
SERIALIZE(variable_type); SERIALIZE("variable_type", def.variable_type);
SERIALIZE(declaring_type); SERIALIZE("declaring_type", def.declaring_type);
SERIALIZE(uses); SERIALIZE("uses", uses);
writer.EndObject(); writer.EndObject();
} }
writer.EndArray(); writer.EndArray();

View File

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

View File

@ -23,7 +23,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@declonly#", "usr": "c:@S@Foo@F@declonly#",
"short_name": "declonly", "short_name": "declonly",
"qualified_name": "Foo::declonly", "qualified_name": "Foo::declonly",
"declaration": "1:2:8", "declarations": ["1:2:8"],
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:2:8"] "uses": ["1:2:8"]
}, { }, {
@ -31,7 +31,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@purevirtual#", "usr": "c:@S@Foo@F@purevirtual#",
"short_name": "purevirtual", "short_name": "purevirtual",
"qualified_name": "Foo::purevirtual", "qualified_name": "Foo::purevirtual",
"declaration": "1:3:16", "declarations": ["1:3:16"],
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:3:16"] "uses": ["1:3:16"]
}, { }, {
@ -39,7 +39,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@def#", "usr": "c:@S@Foo@F@def#",
"short_name": "def", "short_name": "def",
"qualified_name": "Foo::def", "qualified_name": "Foo::def",
"declaration": "1:4:8", "declarations": ["1:4:8"],
"definition": "1:7:11", "definition": "1:7:11",
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:4:8", "1:7:11"] "uses": ["1:4:8", "1:7:11"]

View File

@ -15,7 +15,7 @@ OUTPUT:
"usr": "c:@F@called#I#", "usr": "c:@F@called#I#",
"short_name": "called", "short_name": "called",
"qualified_name": "called", "qualified_name": "called",
"declaration": "1:1:6", "declarations": ["1:1:6"],
"callers": ["2@1:6:3"], "callers": ["2@1:6:3"],
"uses": ["1:1:6", "1:6:3"] "uses": ["1:1:6", "1:6:3"]
}, { }, {

View File

@ -9,7 +9,7 @@ OUTPUT:
"usr": "c:@F@foo#I#I#", "usr": "c:@F@foo#I#I#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "foo", "qualified_name": "foo",
"declaration": "1:1:6", "declarations": ["1:1:6"],
"uses": ["1:1:6"] "uses": ["1:1:6"]
}], }],
"variables": [] "variables": []

View File

@ -11,7 +11,7 @@ OUTPUT:
"usr": "c:@F@foo#", "usr": "c:@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "foo", "qualified_name": "foo",
"declaration": "1:1:6", "declarations": ["1:1:6"],
"definition": "1:3:6", "definition": "1:3:6",
"uses": ["1:1:6", "1:3:6"] "uses": ["1:1:6", "1:3:6"]
}], }],

View File

@ -32,7 +32,7 @@ OUTPUT:
"usr": "c:@S@Root@F@foo#", "usr": "c:@S@Root@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "Root::foo", "qualified_name": "Root::foo",
"declaration": "1:2:16", "declarations": ["1:2:16"],
"declaring_type": 0, "declaring_type": 0,
"derived": [1], "derived": [1],
"uses": ["1:2:16"] "uses": ["1:2:16"]

View File

@ -23,7 +23,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@foo#", "usr": "c:@S@Foo@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "Foo::foo", "qualified_name": "Foo::foo",
"declaration": "1:2:8", "declarations": ["1:2:8"],
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:2:8"] "uses": ["1:2:8"]
}], }],

View File

@ -21,7 +21,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@foo#", "usr": "c:@S@Foo@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "Foo::foo", "qualified_name": "Foo::foo",
"declaration": "1:2:8", "declarations": ["1:2:8"],
"definition": "1:5:11", "definition": "1:5:11",
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:2:8", "1:5:11"] "uses": ["1:2:8", "1:5:11"]

View File

@ -11,7 +11,7 @@ OUTPUT:
"usr": "c:anonymous_function.cc@aN@F@foo#", "usr": "c:anonymous_function.cc@aN@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "::foo", "qualified_name": "::foo",
"declaration": "1:2:6", "declarations": ["1:2:6"],
"uses": ["1:2:6"] "uses": ["1:2:6"]
}], }],
"variables": [] "variables": []

View File

@ -11,7 +11,7 @@ OUTPUT:
"usr": "c:@N@hello@F@foo#I#I#", "usr": "c:@N@hello@F@foo#I#I#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "hello::foo", "qualified_name": "hello::foo",
"declaration": "1:2:6", "declarations": ["1:2:6"],
"uses": ["1:2:6"] "uses": ["1:2:6"]
}], }],
"variables": [] "variables": []

View File

@ -21,7 +21,7 @@ OUTPUT:
"usr": "c:@N@hello@S@Foo@F@foo#", "usr": "c:@N@hello@S@Foo@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "hello::Foo::foo", "qualified_name": "hello::Foo::foo",
"declaration": "1:3:8", "declarations": ["1:3:8"],
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:3:8"] "uses": ["1:3:8"]
}], }],

View File

@ -23,7 +23,7 @@ OUTPUT:
"usr": "c:@N@hello@S@Foo@F@foo#", "usr": "c:@N@hello@S@Foo@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "hello::Foo::foo", "qualified_name": "hello::Foo::foo",
"declaration": "1:3:8", "declarations": ["1:3:8"],
"definition": "1:6:11", "definition": "1:6:11",
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:3:8", "1:6:11"] "uses": ["1:3:8", "1:6:11"]

View File

@ -24,7 +24,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@Used#", "usr": "c:@S@Foo@F@Used#",
"short_name": "Used", "short_name": "Used",
"qualified_name": "Foo::Used", "qualified_name": "Foo::Used",
"declaration": "1:2:8", "declarations": ["1:2:8"],
"declaring_type": 0, "declaring_type": 0,
"callers": ["1@1:6:18"], "callers": ["1@1:6:18"],
"uses": ["1:2:8", "1:6:18"] "uses": ["1:2:8", "1:6:18"]

View File

@ -24,7 +24,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@Used#", "usr": "c:@S@Foo@F@Used#",
"short_name": "Used", "short_name": "Used",
"qualified_name": "Foo::Used", "qualified_name": "Foo::Used",
"declaration": "1:2:8", "declarations": ["1:2:8"],
"declaring_type": 0, "declaring_type": 0,
"callers": ["1@1:7:6"], "callers": ["1@1:7:6"],
"uses": ["1:2:8", "1:7:6"] "uses": ["1:2:8", "1:7:6"]

View File

@ -12,7 +12,7 @@ OUTPUT:
"usr": "c:@F@foo#", "usr": "c:@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "foo", "qualified_name": "foo",
"declaration": "1:1:6", "declarations": ["1:1:6"],
"callers": ["1@1:4:3"], "callers": ["1@1:4:3"],
"uses": ["1:1:6", "1:4:3"] "uses": ["1:1:6", "1:4:3"]
}, { }, {

View File

@ -23,7 +23,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@foo#", "usr": "c:@S@Foo@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "Foo::foo", "qualified_name": "Foo::foo",
"declaration": "1:2:8", "declarations": ["1:2:8"],
"declaring_type": 0, "declaring_type": 0,
"callers": ["1@1:7:6"], "callers": ["1@1:7:6"],
"uses": ["1:2:8", "1:7:6"] "uses": ["1:2:8", "1:7:6"]

View File

@ -15,7 +15,7 @@ OUTPUT:
"usr": "c:@FT@>1#Taccept#t0.0#v#", "usr": "c:@FT@>1#Taccept#t0.0#v#",
"short_name": "accept", "short_name": "accept",
"qualified_name": "accept", "qualified_name": "accept",
"declaration": "1:2:6", "declarations": ["1:2:6"],
"callers": ["1@1:5:3", "1@1:6:3"], "callers": ["1@1:5:3", "1@1:6:3"],
"uses": ["1:2:6", "1:5:3", "1:6:3"] "uses": ["1:2:6", "1:5:3", "1:6:3"]
}, { }, {

View File

@ -128,7 +128,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@foo#", "usr": "c:@S@Foo@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "Foo::foo", "qualified_name": "Foo::foo",
"declaration": "1:65:23", "declarations": ["1:65:23"],
"definition": "1:79:26", "definition": "1:79:26",
"declaring_type": 3, "declaring_type": 3,
"uses": ["1:65:23", "1:79:26"] "uses": ["1:65:23", "1:79:26"]

View File

@ -21,7 +21,7 @@ OUTPUT:
"usr": "c:@F@foo#*$@S@Foo#S0_#", "usr": "c:@F@foo#*$@S@Foo#S0_#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "foo", "qualified_name": "foo",
"declaration": "1:3:6", "declarations": ["1:3:6"],
"definition": "1:4:6", "definition": "1:4:6",
"uses": ["1:3:6", "1:4:6"] "uses": ["1:3:6", "1:4:6"]
}], }],

View File

@ -38,7 +38,7 @@ OUTPUT:
"usr": "c:@F@foo#", "usr": "c:@F@foo#",
"short_name": "foo", "short_name": "foo",
"qualified_name": "foo", "qualified_name": "foo",
"declaration": "1:4:7", "declarations": ["1:3:7", "1:4:7"],
"definition": "1:5:7", "definition": "1:5:7",
"uses": ["1:3:7", "1:4:7", "1:5:7"] "uses": ["1:3:7", "1:4:7", "1:5:7"]
}, { }, {
@ -46,7 +46,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@Get#I#", "usr": "c:@S@Foo@F@Get#I#",
"short_name": "Get", "short_name": "Get",
"qualified_name": "Foo::Get", "qualified_name": "Foo::Get",
"declaration": "1:8:9", "declarations": ["1:8:9"],
"definition": "1:12:12", "definition": "1:12:12",
"declaring_type": 1, "declaring_type": 1,
"uses": ["1:8:9", "1:12:12"] "uses": ["1:8:9", "1:12:12"]
@ -55,7 +55,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@Empty#", "usr": "c:@S@Foo@F@Empty#",
"short_name": "Empty", "short_name": "Empty",
"qualified_name": "Foo::Empty", "qualified_name": "Foo::Empty",
"declaration": "1:9:8", "declarations": ["1:9:8"],
"definition": "1:13:11", "definition": "1:13:11",
"declaring_type": 1, "declaring_type": 1,
"uses": ["1:9:8", "1:13:11"] "uses": ["1:9:8", "1:13:11"]
@ -64,14 +64,14 @@ OUTPUT:
"usr": "c:@F@external#", "usr": "c:@F@external#",
"short_name": "external", "short_name": "external",
"qualified_name": "external", "qualified_name": "external",
"declaration": "1:15:20", "declarations": ["1:15:20"],
"uses": ["1:15:20"] "uses": ["1:15:20"]
}, { }, {
"id": 4, "id": 4,
"usr": "c:type_usage_on_return_type.cc@F@bar#", "usr": "c:type_usage_on_return_type.cc@F@bar#",
"short_name": "bar", "short_name": "bar",
"qualified_name": "bar", "qualified_name": "bar",
"declaration": "1:17:14", "declarations": ["1:17:14"],
"definition": "1:18:14", "definition": "1:18:14",
"uses": ["1:17:14", "1:18:14"] "uses": ["1:17:14", "1:18:14"]
}], }],

View File

@ -26,7 +26,7 @@ OUTPUT:
"usr": "c:@S@Foo@F@make#", "usr": "c:@S@Foo@F@make#",
"short_name": "make", "short_name": "make",
"qualified_name": "Foo::make", "qualified_name": "Foo::make",
"declaration": "1:2:8", "declarations": ["1:2:8"],
"definition": "1:5:11", "definition": "1:5:11",
"declaring_type": 0, "declaring_type": 0,
"uses": ["1:2:8", "1:5:11"] "uses": ["1:2:8", "1:5:11"]

View File

@ -31,7 +31,7 @@ OUTPUT:
"usr": "c:@F@called#I#", "usr": "c:@F@called#I#",
"short_name": "called", "short_name": "called",
"qualified_name": "called", "qualified_name": "called",
"declaration": "1:1:6", "declarations": ["1:1:6"],
"callers": ["2@1:14:3"], "callers": ["2@1:14:3"],
"uses": ["1:1:6", "1:14:3"] "uses": ["1:1:6", "1:14:3"]
}, { }, {
@ -39,7 +39,7 @@ OUTPUT:
"usr": "c:@F@gen#", "usr": "c:@F@gen#",
"short_name": "gen", "short_name": "gen",
"qualified_name": "gen", "qualified_name": "gen",
"declaration": "1:3:5", "declarations": ["1:3:5"],
"callers": ["2@1:14:14"], "callers": ["2@1:14:14"],
"uses": ["1:3:5", "1:14:14"] "uses": ["1:3:5", "1:14:14"]
}, { }, {

View File

@ -15,7 +15,7 @@ OUTPUT:
"usr": "c:@F@called#I#", "usr": "c:@F@called#I#",
"short_name": "called", "short_name": "called",
"qualified_name": "called", "qualified_name": "called",
"declaration": "1:1:6", "declarations": ["1:1:6"],
"callers": ["2@1:6:3"], "callers": ["2@1:6:3"],
"uses": ["1:1:6", "1:6:3"] "uses": ["1:1:6", "1:6:3"]
}, { }, {

View File

@ -34,7 +34,7 @@ OUTPUT:
"usr": "c:@F@accept#I#", "usr": "c:@F@accept#I#",
"short_name": "accept", "short_name": "accept",
"qualified_name": "accept", "qualified_name": "accept",
"declaration": "1:7:6", "declarations": ["1:7:6"],
"callers": ["2@1:14:3", "2@1:15:3", "2@1:17:3"], "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"] "uses": ["1:7:6", "1:14:3", "1:15:3", "1:17:3"]
}, { }, {
@ -42,7 +42,7 @@ OUTPUT:
"usr": "c:@F@accept#*I#", "usr": "c:@F@accept#*I#",
"short_name": "accept", "short_name": "accept",
"qualified_name": "accept", "qualified_name": "accept",
"declaration": "1:8:6", "declarations": ["1:8:6"],
"callers": ["2@1:16:3"], "callers": ["2@1:16:3"],
"uses": ["1:8:6", "1:16:3"] "uses": ["1:8:6", "1:16:3"]
}, { }, {

View File

@ -24,7 +24,7 @@ OUTPUT:
"usr": "c:@F@accept#I#", "usr": "c:@F@accept#I#",
"short_name": "accept", "short_name": "accept",
"qualified_name": "accept", "qualified_name": "accept",
"declaration": "1:5:6", "declarations": ["1:5:6"],
"callers": ["1@1:8:3"], "callers": ["1@1:8:3"],
"uses": ["1:5:6", "1:8:3"] "uses": ["1:5:6", "1:8:3"]
}, { }, {