Every function usage is now considered a call of that function.

This means we will now report function calls that happen in the global scope (previously, those would only show up for find all refs).
This commit is contained in:
Jacob Dufault 2017-04-13 00:47:47 -07:00
parent 7a429ed3e6
commit d6123bd861
81 changed files with 310 additions and 333 deletions

View File

@ -1,3 +1,4 @@
#if false
#include <string>
#include <vector>
@ -31,9 +32,4 @@ float MyBar::MemberFunc(int a, char b, std::vector<int> foo) {
return ::foo();
}
/*
OUTPUT:
{}
*/
#endif

View File

@ -1,3 +1,4 @@
#if false
/*
abc
daaa
@ -9,6 +10,19 @@ abaa
#include "a.h"
struct iface {
virtual void foo() = 0;
};
struct impl : public iface {
void foo() override {}
};
void doit() {
iface* f;
f->foo();
}
struct Middle : public Parent {
void foo() override {}
};
@ -93,4 +107,5 @@ void caller() {
foo();
foo();
}
}
#endif

View File

@ -1,3 +1,5 @@
#if false
struct Parent {
virtual void foo() {}
};
#endif

6
foo/b.cc Normal file
View File

@ -0,0 +1,6 @@
namespace {
struct Foo2 {
virtual void foobar() = 0;
};
}

View File

@ -99,22 +99,6 @@ optional<QueryableLocation> GetDeclarationOfSymbol(QueryableDatabase* db, const
}
#endif
std::vector<QueryableLocation> GetUsesOfSymbol(QueryableDatabase* db, const SymbolIdx& symbol) {
switch (symbol.kind) {
case SymbolKind::Type:
return db->types[symbol.idx].uses;
case SymbolKind::Func:
return db->funcs[symbol.idx].uses;
case SymbolKind::Var:
return db->vars[symbol.idx].uses;
case SymbolKind::File:
case SymbolKind::Invalid: {
assert(false && "unexpected");
break;
}
}
return {};
}
optional<QueryableLocation> GetDefinitionSpellingOfSymbol(QueryableDatabase* db, const QueryTypeId& id) {
@ -143,6 +127,71 @@ optional<QueryableLocation> GetDefinitionSpellingOfSymbol(QueryableDatabase* db,
return nullopt;
}
std::vector<QueryableLocation> ToQueryableLocation(QueryableDatabase* db, const std::vector<QueryFuncRef>& refs) {
std::vector<QueryableLocation> locs;
locs.reserve(refs.size());
for (const QueryFuncRef& ref : refs)
locs.push_back(ref.loc);
return locs;
}
std::vector<QueryableLocation> ToQueryableLocation(QueryableDatabase* db, const std::vector<QueryTypeId>& ids) {
std::vector<QueryableLocation> locs;
locs.reserve(ids.size());
for (const QueryTypeId& id : ids) {
optional<QueryableLocation> loc = GetDefinitionSpellingOfSymbol(db, id);
if (loc)
locs.push_back(loc.value());
}
return locs;
}
std::vector<QueryableLocation> ToQueryableLocation(QueryableDatabase* db, const std::vector<QueryFuncId>& ids) {
std::vector<QueryableLocation> locs;
locs.reserve(ids.size());
for (const QueryFuncId& id : ids) {
optional<QueryableLocation> loc = GetDefinitionSpellingOfSymbol(db, id);
if (loc)
locs.push_back(loc.value());
}
return locs;
}
std::vector<QueryableLocation> ToQueryableLocation(QueryableDatabase* db, const std::vector<QueryVarId>& ids) {
std::vector<QueryableLocation> locs;
locs.reserve(ids.size());
for (const QueryVarId& id : ids) {
optional<QueryableLocation> loc = GetDefinitionSpellingOfSymbol(db, id);
if (loc)
locs.push_back(loc.value());
}
return locs;
}
std::vector<QueryableLocation> GetUsesOfSymbol(QueryableDatabase* db, const SymbolIdx& symbol) {
switch (symbol.kind) {
case SymbolKind::Type:
return db->types[symbol.idx].uses;
case SymbolKind::Func: {
// TODO: the vector allocation could be avoided.
const QueryableFuncDef& func = db->funcs[symbol.idx];
std::vector<QueryableLocation> result = ToQueryableLocation(db, func.callers);
AddRange(&result, func.declarations);
if (func.def.definition_spelling)
result.push_back(*func.def.definition_spelling);
return result;
}
case SymbolKind::Var:
return db->vars[symbol.idx].uses;
case SymbolKind::File:
case SymbolKind::Invalid: {
assert(false && "unexpected");
break;
}
}
return {};
}
optional<QueryableLocation> GetDefinitionExtentOfSymbol(QueryableDatabase* db, const QueryTypeId& id) {
return GetQueryable(db, id)->def.definition_extent;
}
@ -367,44 +416,6 @@ void AddCodeLens(
common->result->push_back(code_lens);
}
std::vector<QueryableLocation> ToQueryableLocation(QueryableDatabase* db, const std::vector<QueryFuncRef>& refs) {
std::vector<QueryableLocation> locs;
locs.reserve(refs.size());
for (const QueryFuncRef& ref : refs)
locs.push_back(ref.loc);
return locs;
}
std::vector<QueryableLocation> ToQueryableLocation(QueryableDatabase* db, const std::vector<QueryTypeId>& ids) {
std::vector<QueryableLocation> locs;
locs.reserve(ids.size());
for (const QueryTypeId& id : ids) {
optional<QueryableLocation> loc = GetDefinitionSpellingOfSymbol(db, id);
if (loc)
locs.push_back(loc.value());
}
return locs;
}
std::vector<QueryableLocation> ToQueryableLocation(QueryableDatabase* db, const std::vector<QueryFuncId>& ids) {
std::vector<QueryableLocation> locs;
locs.reserve(ids.size());
for (const QueryFuncId& id : ids) {
optional<QueryableLocation> loc = GetDefinitionSpellingOfSymbol(db, id);
if (loc)
locs.push_back(loc.value());
}
return locs;
}
std::vector<QueryableLocation> ToQueryableLocation(QueryableDatabase* db, const std::vector<QueryVarId>& ids) {
std::vector<QueryableLocation> locs;
locs.reserve(ids.size());
for (const QueryVarId& id : ids) {
optional<QueryableLocation> loc = GetDefinitionSpellingOfSymbol(db, id);
if (loc)
locs.push_back(loc.value());
}
return locs;
}
} // namespace

View File

@ -97,7 +97,20 @@ IndexedTypeDef::IndexedTypeDef(IndexTypeId id, const std::string& usr)
// std::cerr << "Creating type with usr " << usr << std::endl;
}
void AddUsage(std::vector<Range>& uses,
void RemoveItem(std::vector<Range>& ranges,
Range to_remove) {
auto it = std::find(ranges.begin(), ranges.end(), to_remove);
if (it != ranges.end())
ranges.erase(it);
}
void UniqueAdd(std::vector<IndexFuncRef>& refs,
IndexFuncRef ref) {
if (std::find(refs.begin(), refs.end(), ref) != refs.end())
refs.push_back(ref);
}
void UniqueAdd(std::vector<Range>& uses,
Range loc,
bool insert_if_not_present = true) {
// cannot sub 1 from size_t in loop below; check explicitly here
@ -377,7 +390,7 @@ void VisitDeclForTypeUsageVisitorHandler(clang::Cursor cursor,
// TODO: Should we even be visiting this if the file is not from the main
// def? Try adding assert on |loc| later.
Range loc = db->id_cache.ResolveSpelling(cursor.cx_cursor, true /*interesting*/);
AddUsage(ref_type_def->uses, loc);
UniqueAdd(ref_type_def->uses, loc);
}
}
@ -630,7 +643,7 @@ clang::VisiterResult AddDeclInitializerUsagesVisitor(clang::Cursor cursor,
// << " at " << loc.ToString() << std::endl;
IndexVarId ref_id = db->ToVarId(ref_usr);
IndexedVarDef* ref_def = db->Resolve(ref_id);
AddUsage(ref_def->uses, loc);
UniqueAdd(ref_def->uses, loc);
break;
}
@ -777,7 +790,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
else {
var_def->def.declaration = db->id_cache.ResolveSpelling(decl->cursor, false /*interesting*/);
}
AddUsage(var_def->uses, decl_loc_spelling.value());
UniqueAdd(var_def->uses, decl_loc_spelling.value());
// std::cerr << std::endl << "Visiting declaration" << std::endl;
// Dump(decl_cursor);
@ -837,7 +850,6 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
IndexFuncId func_id = db->ToFuncId(resolved.cx_cursor);
IndexedFuncDef* func_def = db->Resolve(func_id);
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*/,
@ -849,9 +861,14 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
if (decl->isDefinition && !func_def->def.definition_extent.has_value()) {
func_def->def.definition_spelling = db->id_cache.ResolveSpelling(decl->cursor, false /*interesting*/);
func_def->def.definition_extent = db->id_cache.ResolveExtent(decl->cursor, false /*interesting*/);
RemoveItem(func_def->declarations, *func_def->def.definition_spelling);
}
else {
func_def->declarations.push_back(db->id_cache.ResolveSpelling(decl->cursor, false /*interesting*/));
Range decl_spelling = db->id_cache.ResolveSpelling(decl->cursor, false /*interesting*/);
// Only add the declaration if it's not already a definition.
if (!func_def->def.definition_spelling || *func_def->def.definition_spelling != decl_spelling)
UniqueAdd(func_def->declarations, decl_spelling);
}
// If decl_cursor != resolved, then decl_cursor is a template
@ -888,7 +905,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// TODO: Should it be interesting?
if (is_ctor_or_dtor) {
Range type_usage_loc = decl_loc_spelling.value();
AddUsage(declaring_type_def->uses, type_usage_loc);
UniqueAdd(declaring_type_def->uses, type_usage_loc);
}
// Register function in declaring type if it hasn't been registered
@ -1000,7 +1017,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
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());
UniqueAdd(type_def->uses, decl_loc_spelling.value());
break;
}
@ -1039,7 +1056,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
assert(decl->isDefinition);
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());
UniqueAdd(type_def->uses, decl_loc_spelling.value());
// type_def->alias_of
// type_def->funcs
@ -1227,7 +1244,7 @@ void indexEntityReference(CXClientData client_data,
IndexVarId var_id = db->ToVarId(referenced.get_usr());
IndexedVarDef* var_def = db->Resolve(var_id);
AddUsage(var_def->uses, loc_spelling.value());
UniqueAdd(var_def->uses, loc_spelling.value());
break;
}
@ -1260,10 +1277,9 @@ void indexEntityReference(CXClientData client_data,
AddFuncRef(&caller_def->def.callees, IndexFuncRef(called_id, loc_spelling.value()));
AddFuncRef(&called_def->callers, IndexFuncRef(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_spelling.value());
AddFuncRef(&called_def->callers, IndexFuncRef(loc_spelling.value()));
}
// For constructor/destructor, also add a usage against the type. Clang
@ -1288,7 +1304,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_spelling.value().WithInteresting(true), false /*insert_if_not_present*/);
UniqueAdd(type_def->uses, loc_spelling.value().WithInteresting(true), false /*insert_if_not_present*/);
}
}
}
@ -1327,7 +1343,7 @@ void indexEntityReference(CXClientData client_data,
// Foo f;
// }
//
AddUsage(referenced_def->uses, loc_spelling.value());
UniqueAdd(referenced_def->uses, loc_spelling.value());
break;
}

View File

@ -59,15 +59,24 @@ struct IdCache;
template <typename T>
struct Ref {
Id<T> id;
Id<T> id() const {
assert(has_id());
return id_;
}
bool has_id() const {
return id_.id != -1;
}
Id<T> id_;
Range loc;
Ref() {} // For serialization.
Ref(Id<T> id, Range loc) : id(id), loc(loc) {}
Ref(Id<T> id, Range loc) : id_(id), loc(loc) {}
Ref(Range loc) : id_(Id<T>(-1)), loc(loc) {}
bool operator==(const Ref<T>& other) {
return id == other.id && loc == other.loc;
return id_ == other.id_ && loc == other.loc;
}
bool operator!=(const Ref<T>& other) { return !(*this == other); }
bool operator<(const Ref<T>& other) const {
@ -77,16 +86,14 @@ struct Ref {
template <typename T>
bool operator==(const Ref<T>& a, const Ref<T>& b) {
return a.id == b.id && a.loc == b.loc;
return a.id_ == b.id_ && a.loc == b.loc;
}
template <typename T>
bool operator!=(const Ref<T>& a, const Ref<T>& b) {
return !(a == b);
}
using IndexTypeRef = Ref<IndexedTypeDef>;
using IndexFuncRef = Ref<IndexedFuncDef>;
using IndexVarRef = Ref<IndexedVarDef>;
// TODO: skip as much forward-processing as possible when |is_system_def| is
// set to false.
@ -284,17 +291,13 @@ struct IndexedFuncDef {
// Methods which directly override this one.
std::vector<IndexFuncId> derived;
// Functions which call this one.
// TODO: Functions can get called outside of just functions - for example,
// they can get called in static context (maybe redirect to main?)
// or in class initializer list (redirect to class ctor?)
// - Right now those usages will not get listed here (but they should be
// inside of all_uses).
// Calls/usages of this function. If the call is coming from outside a
// function context then the FuncRef will not have an associated id.
//
// To get all usages, also include the ranges inside of declarations and
// def.definition_spelling.
std::vector<IndexFuncRef> callers;
// All usages. For interesting usages, see callees.
std::vector<Range> uses;
IndexedFuncDef() {} // For reflection.
IndexedFuncDef(IndexFuncId id, const std::string& usr) : def(usr), id(id) {
// assert(usr.size() > 0);
@ -307,8 +310,7 @@ struct IndexedFuncDef {
!def.callees.empty() ||
!declarations.empty() ||
!derived.empty() ||
!callers.empty() ||
!uses.empty();
!callers.empty();
}
bool operator<(const IndexedFuncDef& other) const {

View File

@ -96,8 +96,8 @@ QueryableFile::Def BuildFileDef(const IdMap& id_map, const IndexedFile& indexed)
add_all_symbols(id_map.ToSymbol(def.id), decl);
add_outline(id_map.ToSymbol(def.id), decl);
}
for (const Range& use : def.uses)
add_all_symbols(id_map.ToSymbol(def.id), use);
for (const IndexFuncRef& caller : def.callers)
add_all_symbols(id_map.ToSymbol(def.id), caller.loc);
}
for (const IndexedVarDef& def : indexed.vars) {
if (def.def.definition_spelling.has_value())
@ -133,7 +133,6 @@ QueryableFuncDef::QueryableFuncDef(const IdMap& id_map, const IndexedFuncDef& in
declarations = id_map.ToQuery(indexed.declarations);
derived = id_map.ToQuery(indexed.derived);
callers = id_map.ToQuery(indexed.callers);
uses = id_map.ToQuery(indexed.uses);
}
QueryableVarDef::QueryableVarDef(const IdMap& id_map, const IndexedVarDef& indexed)
@ -374,7 +373,7 @@ QueryVarId IdMap::ToQuery(IndexVarId id) const {
return QueryVarId(cached_var_ids_.find(id.id)->second);
}
QueryFuncRef IdMap::ToQuery(IndexFuncRef ref) const {
return QueryFuncRef(ToQuery(ref.id), ToQuery(ref.loc));
return QueryFuncRef(ToQuery(ref.id_), ToQuery(ref.loc));
}
optional<QueryableLocation> IdMap::ToQuery(optional<Range> range) const {
@ -518,7 +517,6 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, const IdMap& current_id_m
funcs_declarations.push_back(QueryableFuncDef::DeclarationsUpdate(query.def.usr, query.declarations));
funcs_derived.push_back(QueryableFuncDef::DerivedUpdate(query.def.usr, query.derived));
funcs_callers.push_back(QueryableFuncDef::CallersUpdate(query.def.usr, query.callers));
funcs_uses.push_back(QueryableFuncDef::UsesUpdate(query.def.usr, query.uses));
},
/*onFound:*/[this, &previous_id_map, &current_id_map](IndexedFuncDef* previous_def, IndexedFuncDef* current_def) {
QueryableFuncDef::DefUpdate previous_remapped_def = ToQuery(previous_id_map, previous_def->def);
@ -529,7 +527,6 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, const IdMap& current_id_m
PROCESS_UPDATE_DIFF(funcs_declarations, declarations, QueryableLocation);
PROCESS_UPDATE_DIFF(funcs_derived, derived, QueryFuncId);
PROCESS_UPDATE_DIFF(funcs_callers, callers, QueryFuncRef);
PROCESS_UPDATE_DIFF(funcs_uses, uses, QueryableLocation);
});
// Variables
@ -572,7 +569,6 @@ void IndexUpdate::Merge(const IndexUpdate& update) {
INDEX_UPDATE_MERGE(funcs_declarations);
INDEX_UPDATE_MERGE(funcs_derived);
INDEX_UPDATE_MERGE(funcs_callers);
INDEX_UPDATE_MERGE(funcs_uses);
INDEX_UPDATE_MERGE(vars_removed);
INDEX_UPDATE_MERGE(vars_def_update);
@ -704,7 +700,6 @@ void QueryableDatabase::ApplyIndexUpdate(IndexUpdate* update) {
HANDLE_MERGEABLE(funcs_declarations, declarations, funcs);
HANDLE_MERGEABLE(funcs_derived, derived, funcs);
HANDLE_MERGEABLE(funcs_callers, callers, funcs);
HANDLE_MERGEABLE(funcs_uses, uses, funcs);
RemoveUsrs(update->vars_removed);
ImportOrUpdate(update->vars_def_update);

View File

@ -100,17 +100,25 @@ struct SymbolRef {
};
struct QueryFuncRef {
QueryFuncId id;
QueryFuncId id() const {
assert(has_id());
return id_;
}
bool has_id() const {
return id_.id != -1;
}
QueryFuncId id_;
QueryableLocation loc;
QueryFuncRef(QueryFuncId id, QueryableLocation loc) : id(id), loc(loc) {}
QueryFuncRef(QueryFuncId id, QueryableLocation loc) : id_(id), loc(loc) {}
bool operator==(const QueryFuncRef& that) const {
return id == that.id && loc == that.loc;
return id_ == that.id_ && loc == that.loc;
}
bool operator!=(const QueryFuncRef& that) const { return !(*this == that); }
bool operator<(const QueryFuncRef& that) const {
return id < that.id && loc.range.start < that.loc.range.start;
return id_ < that.id_ && loc.range.start < that.loc.range.start;
}
};
@ -190,16 +198,11 @@ struct QueryableFuncDef {
using DeclarationsUpdate = MergeableUpdate<QueryableLocation>;
using DerivedUpdate = MergeableUpdate<QueryFuncId>;
using CallersUpdate = MergeableUpdate<QueryFuncRef>;
using UsesUpdate = MergeableUpdate<QueryableLocation>;
DefUpdate def;
std::vector<QueryableLocation> declarations;
std::vector<QueryFuncId> derived;
// TODO: It seems like callers is always the same as uses except callers does
// not include the definition or declaration. We should get a large space
// saving by removing it.
std::vector<QueryFuncRef> callers;
std::vector<QueryableLocation> uses;
size_t qualified_name_idx = -1;
QueryableFuncDef(const Usr& usr) : def(usr) {}
@ -246,7 +249,6 @@ struct IndexUpdate {
std::vector<QueryableFuncDef::DeclarationsUpdate> funcs_declarations;
std::vector<QueryableFuncDef::DerivedUpdate> funcs_derived;
std::vector<QueryableFuncDef::CallersUpdate> funcs_callers;
std::vector<QueryableFuncDef::UsesUpdate> funcs_uses;
// Variable updates.
std::vector<Usr> vars_removed;

View File

@ -68,15 +68,21 @@ void Reflect(Writer& visitor, Id<T>& value) {
// Ref<IndexedFuncDef>
void Reflect(Reader& visitor, Ref<IndexedFuncDef>& value) {
const char* str_value = visitor.GetString();
uint64_t id = atoi(str_value);
uint64_t id = atol(str_value);
const char* loc_string = strchr(str_value, '@') + 1;
value.id = Id<IndexedFuncDef>(id);
value.id_ = Id<IndexedFuncDef>(id);
value.loc = Range(loc_string);
}
void Reflect(Writer& visitor, Ref<IndexedFuncDef>& value) {
std::string s = std::to_string(value.id.id) + "@" + value.loc.ToString();
visitor.String(s.c_str());
if (value.id_.id == -1) {
std::string s = "-1@" + value.loc.ToString();
visitor.String(s.c_str());
}
else {
std::string s = std::to_string(value.id_.id) + "@" + value.loc.ToString();
visitor.String(s.c_str());
}
}
@ -156,7 +162,6 @@ void Reflect(TVisitor& visitor, IndexedFuncDef& value) {
REFLECT_MEMBER2("locals", value.def.locals);
REFLECT_MEMBER2("callers", value.callers);
REFLECT_MEMBER2("callees", value.def.callees);
REFLECT_MEMBER2("uses", value.uses);
REFLECT_MEMBER_END();
}

View File

@ -142,6 +142,35 @@ void RunTests() {
"-IC:/Users/jacob/Desktop/superindex/indexer/src"
}, false /*dump_ast*/);
#if false
for (auto& db : dbs) {
assert(db);
if (!db) {
std::cerr << "no db!!!" << std::endl;
continue;
}
for (auto& func : db->funcs) {
if (!func.HasInterestingState())
continue;
if (func.uses.size() !=
(func.callers.size() + func.declarations.size() + (func.def.definition_spelling.has_value() ? 1 : 0))) {
std::cout << "func.def.usr = " << func.def.usr << std::endl;
std::cout << "func.uses.size() = " << func.uses.size() << std::endl;
std::cout << "func.callers.size() = " << func.callers.size() << std::endl;
std::cout << "func.declarations.size() = " << func.declarations.size() << std::endl;
std::cout << "func.definition_spelling.has_value() = " << func.def.definition_spelling.has_value() << std::endl;
std::cerr << "err" << std::endl;
}
}
}
#endif
for (auto& entry : all_expected_output) {
const std::string& expected_path = entry.first;
const std::string& expected_output = entry.second;

View File

@ -30,8 +30,7 @@ OUTPUT:
"definition_spelling": "3:3-3:6",
"definition_extent": "3:3-3:11",
"declaring_type": 0,
"callers": ["1@7:7-7:8", "1@8:17-8:20"],
"uses": ["3:3-3:6", "7:7-7:8", "8:17-8:20"]
"callers": ["1@7:7-7:8", "1@8:17-8:20"]
}, {
"id": 1,
"usr": "c:@F@foo#",
@ -39,8 +38,7 @@ OUTPUT:
"qualified_name": "foo",
"definition_spelling": "6:6-6:9",
"definition_extent": "6:1-9:2",
"callees": ["0@7:7-7:8", "0@8:17-8:20"],
"uses": ["6:6-6:9"]
"callees": ["0@7:7-7:8", "0@8:17-8:20"]
}],
"vars": [{
"id": 0,

View File

@ -35,8 +35,7 @@ OUTPUT:
"definition_spelling": "3:3-3:6",
"definition_extent": "3:3-3:11",
"declaring_type": 0,
"callers": ["2@8:7-8:8"],
"uses": ["3:3-3:6", "8:7-8:8"]
"callers": ["2@8:7-8:8"]
}, {
"id": 1,
"usr": "c:@S@Foo@F@~Foo#",
@ -44,8 +43,7 @@ OUTPUT:
"qualified_name": "Foo::~Foo",
"definition_spelling": "4:3-4:7",
"definition_extent": "4:3-4:12",
"declaring_type": 0,
"uses": ["4:3-4:7"]
"declaring_type": 0
}, {
"id": 2,
"usr": "c:@F@foo#",
@ -53,8 +51,7 @@ OUTPUT:
"qualified_name": "foo",
"definition_spelling": "7:6-7:9",
"definition_extent": "7:1-9:2",
"callees": ["0@8:7-8:8"],
"uses": ["7:6-7:9"]
"callees": ["0@8:7-8:8"]
}],
"vars": [{
"id": 0,

View File

@ -23,8 +23,7 @@ OUTPUT:
"qualified_name": "Foo::Foo",
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-4:11",
"declaring_type": 0,
"uses": ["4:6-4:9"]
"declaring_type": 0
}]
}
*/

View File

@ -14,8 +14,7 @@ OUTPUT:
"qualified_name": "foo",
"declarations": ["1:6-1:9", "2:6-2:9", "4:6-4:9"],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-3:14",
"uses": ["1:6-1:9", "2:6-2:9", "3:6-3:9", "4:6-4:9"]
"definition_extent": "3:1-3:14"
}]
}
*/

View File

@ -25,16 +25,14 @@ OUTPUT:
"short_name": "declonly",
"qualified_name": "Foo::declonly",
"declarations": ["2:8-2:16"],
"declaring_type": 0,
"uses": ["2:8-2:16"]
"declaring_type": 0
}, {
"id": 1,
"usr": "c:@S@Foo@F@purevirtual#",
"short_name": "purevirtual",
"qualified_name": "Foo::purevirtual",
"declarations": ["3:16-3:27"],
"declaring_type": 0,
"uses": ["3:16-3:27"]
"declaring_type": 0
}, {
"id": 2,
"usr": "c:@S@Foo@F@def#",
@ -43,8 +41,7 @@ OUTPUT:
"declarations": ["4:8-4:11"],
"definition_spelling": "7:11-7:14",
"definition_extent": "7:1-7:19",
"declaring_type": 0,
"uses": ["4:8-4:11", "7:11-7:14"]
"declaring_type": 0
}]
}
*/

View File

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

View File

@ -12,8 +12,7 @@ OUTPUT:
"qualified_name": "foo",
"declarations": ["1:6-1:9"],
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-3:14",
"uses": ["1:6-1:9", "3:6-3:9"]
"definition_extent": "3:1-3:14"
}]
}
*/

View File

@ -9,8 +9,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-1:14",
"uses": ["1:6-1:9"]
"definition_extent": "1:1-1:14"
}]
}
*/

View File

@ -36,8 +36,7 @@ OUTPUT:
"qualified_name": "Root::foo",
"declarations": ["2:16-2:19"],
"declaring_type": 0,
"derived": [1],
"uses": ["2:16-2:19"]
"derived": [1]
}, {
"id": 1,
"usr": "c:@S@Derived@F@foo#",
@ -46,8 +45,7 @@ OUTPUT:
"definition_spelling": "5:8-5:11",
"definition_extent": "5:3-5:25",
"declaring_type": 1,
"base": 0,
"uses": ["5:8-5:11"]
"base": 0
}]
}
*/

View File

@ -22,8 +22,7 @@ OUTPUT:
"qualified_name": "IFoo::foo",
"definition_spelling": "2:16-2:19",
"definition_extent": "2:3-2:28",
"declaring_type": 0,
"uses": ["2:16-2:19"]
"declaring_type": 0
}]
}
*/

View File

@ -25,8 +25,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "Foo::foo",
"declarations": ["2:8-2:11"],
"declaring_type": 0,
"uses": ["2:8-2:11"]
"declaring_type": 0
}]
}
*/

View File

@ -25,8 +25,7 @@ OUTPUT:
"declarations": ["2:8-2:11"],
"definition_spelling": "5:11-5:14",
"definition_extent": "5:1-5:19",
"declaring_type": 0,
"uses": ["2:8-2:11", "5:11-5:14"]
"declaring_type": 0
}]
}
*/

View File

@ -22,8 +22,7 @@ OUTPUT:
"qualified_name": "Foo::foo",
"definition_spelling": "2:8-2:11",
"definition_extent": "2:3-2:16",
"declaring_type": 0,
"uses": ["2:8-2:11"]
"declaring_type": 0
}]
}
*/

View File

@ -58,8 +58,7 @@ OUTPUT: header.h
"short_name": "Foo1",
"qualified_name": "Foo1",
"definition_spelling": "10:6-10:10",
"definition_extent": "10:1-10:15",
"uses": ["10:6-10:10"]
"definition_extent": "10:1-10:15"
}],
"vars": [{
"id": 0,
@ -120,13 +119,11 @@ OUTPUT: impl.cc
"qualified_name": "Impl",
"definition_spelling": "3:6-3:10",
"definition_extent": "3:1-5:2",
"callees": ["1@4:3-4:7"],
"uses": ["3:6-3:10"]
"callees": ["1@4:3-4:7"]
}, {
"id": 1,
"usr": "c:@FT@>1#TFoo1#v#",
"callers": ["0@4:3-4:7"],
"uses": ["4:3-4:7"]
"callers": ["0@4:3-4:7"]
}]
}
*/

View File

@ -12,8 +12,7 @@ OUTPUT: simple_header.h
"usr": "c:@F@header#",
"short_name": "header",
"qualified_name": "header",
"declarations": ["3:6-3:12"],
"uses": ["3:6-3:12"]
"declarations": ["3:6-3:12"]
}]
}
@ -27,13 +26,11 @@ OUTPUT: simple_impl.cc
"qualified_name": "impl",
"definition_spelling": "3:6-3:10",
"definition_extent": "3:1-5:2",
"callees": ["1@4:3-4:9"],
"uses": ["3:6-3:10"]
"callees": ["1@4:3-4:9"]
}, {
"id": 1,
"usr": "c:@F@header#",
"callers": ["0@4:3-4:9"],
"uses": ["4:3-4:9"]
"callers": ["0@4:3-4:9"]
}]
}
*/

View File

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

View File

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

View File

@ -11,8 +11,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "hello::foo",
"definition_spelling": "2:6-2:9",
"definition_extent": "2:1-2:14",
"uses": ["2:6-2:9"]
"definition_extent": "2:1-2:14"
}]
}
*/

View File

@ -23,8 +23,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "hello::Foo::foo",
"declarations": ["3:8-3:11"],
"declaring_type": 0,
"uses": ["3:8-3:11"]
"declaring_type": 0
}]
}
*/

View File

@ -27,8 +27,7 @@ OUTPUT:
"declarations": ["3:8-3:11"],
"definition_spelling": "6:11-6:14",
"definition_extent": "6:1-6:19",
"declaring_type": 0,
"uses": ["3:8-3:11", "6:11-6:14"]
"declaring_type": 0
}]
}
*/

View File

@ -24,8 +24,7 @@ OUTPUT:
"qualified_name": "hello::Foo::foo",
"definition_spelling": "3:8-3:11",
"definition_extent": "3:3-3:16",
"declaring_type": 0,
"uses": ["3:8-3:11"]
"declaring_type": 0
}]
}
*/

View File

@ -19,8 +19,7 @@ OUTPUT:
"qualified_name": "ns::Accept",
"definition_spelling": "3:8-3:14",
"definition_extent": "3:3-3:24",
"callers": ["1@7:7-7:13", "1@9:3-9:9"],
"uses": ["3:8-3:14", "7:7-7:13", "9:3-9:9"]
"callers": ["1@7:7-7:13", "1@9:3-9:9"]
}, {
"id": 1,
"usr": "c:@F@Runner#",
@ -28,8 +27,7 @@ OUTPUT:
"qualified_name": "Runner",
"definition_spelling": "6:6-6:12",
"definition_extent": "6:1-10:2",
"callees": ["0@7:7-7:13", "0@9:3-9:9"],
"uses": ["6:6-6:12"]
"callees": ["0@7:7-7:13", "0@9:3-9:9"]
}],
"vars": [{
"id": 0,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -36,8 +36,7 @@ OUTPUT:
"declarations": ["5:8-5:11"],
"definition_spelling": "8:11-8:14",
"definition_extent": "8:1-8:36",
"declaring_type": 1,
"uses": ["5:8-5:11", "8:11-8:14"]
"declaring_type": 1
}]
}
*/

View File

@ -32,7 +32,7 @@ OUTPUT:
"definition_spelling": "5:16-5:19",
"definition_extent": "5:5-7:6",
"declaring_type": 0,
"uses": ["5:16-5:19", "10:21-10:24", "11:22-11:25"]
"callers": ["-1@10:21-10:24", "-1@11:22-11:25"]
}],
"vars": [{
"id": 0,

View File

@ -33,8 +33,7 @@ OUTPUT:
"declarations": ["3:8-3:11", "9:22-9:25"],
"definition_spelling": "7:19-7:22",
"definition_extent": "6:1-7:24",
"declaring_type": 0,
"uses": ["3:8-3:11", "7:19-7:22", "9:22-9:25"]
"declaring_type": 0
}]
}
*/

View File

@ -29,7 +29,7 @@ OUTPUT:
"definition_spelling": "3:14-3:17",
"definition_extent": "3:3-5:4",
"declaring_type": 0,
"uses": ["3:14-3:17", "8:19-8:22", "9:20-9:23"]
"callers": ["-1@8:19-8:22", "-1@9:20-9:23"]
}],
"vars": [{
"id": 0,

View File

@ -30,7 +30,7 @@ OUTPUT:
"definition_spelling": "4:14-4:17",
"definition_extent": "4:3-6:4",
"declaring_type": 0,
"uses": ["4:14-4:17", "9:19-9:22", "10:20-10:23"]
"callers": ["-1@9:19-9:22", "-1@10:20-10:23"]
}],
"vars": [{
"id": 0,

View File

@ -19,7 +19,7 @@ OUTPUT:
"qualified_name": "foo",
"definition_spelling": "2:12-2:15",
"definition_extent": "2:1-4:2",
"uses": ["2:12-2:15", "6:9-6:12", "7:9-7:12"]
"callers": ["-1@6:9-6:12", "-1@7:9-7:12"]
}],
"vars": [{
"id": 0,

View File

@ -31,8 +31,7 @@ OUTPUT:
"short_name": "act",
"qualified_name": "act",
"definition_spelling": "8:6-8:9",
"definition_extent": "8:1-10:2",
"uses": ["8:6-8:9"]
"definition_extent": "8:1-10:2"
}],
"vars": [{
"id": 0,

View File

@ -28,8 +28,7 @@ OUTPUT:
"qualified_name": "called",
"definition_spelling": "1:6-1:12",
"definition_extent": "1:1-1:17",
"callers": ["1@8:3-8:9"],
"uses": ["1:6-1:12", "8:3-8:9"]
"callers": ["1@8:3-8:9"]
}, {
"id": 1,
"usr": "c:@S@Foo@F@Foo#",
@ -39,8 +38,7 @@ OUTPUT:
"definition_spelling": "7:6-7:9",
"definition_extent": "7:1-9:2",
"declaring_type": 0,
"callees": ["0@8:3-8:9"],
"uses": ["4:3-4:6", "7:6-7:9"]
"callees": ["0@8:3-8:9"]
}]
}
*/

View File

@ -15,8 +15,7 @@ OUTPUT:
"short_name": "called",
"qualified_name": "called",
"declarations": ["3:6-3:12"],
"callers": ["1@6:14-6:20"],
"uses": ["3:6-3:12", "6:14-6:20"]
"callers": ["1@6:14-6:20"]
}, {
"id": 1,
"usr": "c:@F@caller#",
@ -24,8 +23,7 @@ OUTPUT:
"qualified_name": "caller",
"definition_spelling": "5:6-5:12",
"definition_extent": "5:1-7:2",
"callees": ["0@6:14-6:20"],
"uses": ["5:6-5:12"]
"callees": ["0@6:14-6:20"]
}]
}
*/

View File

@ -20,8 +20,7 @@ OUTPUT:
"short_name": "called",
"qualified_name": "called",
"declarations": ["1:6-1:12"],
"callers": ["1@5:3-5:9"],
"uses": ["1:6-1:12", "5:3-5:9"]
"callers": ["1@5:3-5:9"]
}, {
"id": 1,
"usr": "c:@FT@>1#Tcaller#v#",
@ -30,8 +29,7 @@ OUTPUT:
"definition_spelling": "4:6-4:12",
"definition_extent": "4:1-6:2",
"callers": ["2@9:3-9:9"],
"callees": ["0@5:3-5:9"],
"uses": ["4:6-4:12", "9:3-9:9"]
"callees": ["0@5:3-5:9"]
}, {
"id": 2,
"usr": "c:@F@foo#",
@ -39,8 +37,7 @@ OUTPUT:
"qualified_name": "foo",
"definition_spelling": "8:6-8:9",
"definition_extent": "8:1-10:2",
"callees": ["1@9:3-9:9"],
"uses": ["8:6-8:9"]
"callees": ["1@9:3-9:9"]
}]
}
*/

View File

@ -28,8 +28,7 @@ OUTPUT:
"qualified_name": "Wrapper::Wrapper",
"declarations": ["2:3-2:10"],
"declaring_type": 0,
"callers": ["2@8:10-8:16"],
"uses": ["2:3-2:10", "8:10-8:16"]
"callers": ["2@8:10-8:16"]
}, {
"id": 1,
"usr": "c:@F@called#",
@ -37,8 +36,7 @@ OUTPUT:
"qualified_name": "called",
"definition_spelling": "5:5-5:11",
"definition_extent": "5:1-5:27",
"callers": ["2@8:10-8:16"],
"uses": ["5:5-5:11", "8:10-8:16"]
"callers": ["2@8:10-8:16"]
}, {
"id": 2,
"usr": "c:@F@caller#",
@ -46,8 +44,7 @@ OUTPUT:
"qualified_name": "caller",
"definition_spelling": "7:9-7:15",
"definition_extent": "7:1-9:2",
"callees": ["0@8:10-8:16", "1@8:10-8:16"],
"uses": ["7:9-7:15"]
"callees": ["0@8:10-8:16", "1@8:10-8:16"]
}]
}
*/

View File

@ -17,8 +17,7 @@ OUTPUT:
"qualified_name": "consume",
"definition_spelling": "1:6-1:13",
"definition_extent": "1:1-1:23",
"callers": ["2@7:3-7:10"],
"uses": ["1:6-1:13", "7:3-7:10"]
"callers": ["2@7:3-7:10"]
}, {
"id": 1,
"usr": "c:@F@used#",
@ -26,8 +25,7 @@ OUTPUT:
"qualified_name": "used",
"definition_spelling": "3:6-3:10",
"definition_extent": "3:1-3:15",
"callers": ["2@6:13-6:17", "2@7:12-7:16"],
"uses": ["3:6-3:10", "6:13-6:17", "7:12-7:16"]
"callers": ["2@6:13-6:17", "2@7:12-7:16"]
}, {
"id": 2,
"usr": "c:@F@user#",
@ -35,8 +33,7 @@ OUTPUT:
"qualified_name": "user",
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-8:2",
"callees": ["1@6:13-6:17", "0@7:3-7:10", "1@7:12-7:16"],
"uses": ["5:6-5:10"]
"callees": ["1@6:13-6:17", "0@7:3-7:10", "1@7:12-7:16"]
}],
"vars": [{
"id": 0,

View File

@ -27,8 +27,7 @@ OUTPUT:
"qualified_name": "Foo::Used",
"declarations": ["2:8-2:12"],
"declaring_type": 0,
"callers": ["1@6:18-6:22"],
"uses": ["2:8-2:12", "6:18-6:22"]
"callers": ["1@6:18-6:22"]
}, {
"id": 1,
"usr": "c:@F@user#",
@ -36,8 +35,7 @@ OUTPUT:
"qualified_name": "user",
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-7:2",
"callees": ["0@6:18-6:22"],
"uses": ["5:6-5:10"]
"callees": ["0@6:18-6:22"]
}],
"vars": [{
"id": 0,

View File

@ -13,8 +13,7 @@ OUTPUT:
"qualified_name": "called",
"definition_spelling": "1:6-1:12",
"definition_extent": "1:1-1:17",
"callers": ["1@3:3-3:9"],
"uses": ["1:6-1:12", "3:3-3:9"]
"callers": ["1@3:3-3:9"]
}, {
"id": 1,
"usr": "c:@F@caller#",
@ -22,8 +21,7 @@ OUTPUT:
"qualified_name": "caller",
"definition_spelling": "2:6-2:12",
"definition_extent": "2:1-4:2",
"callees": ["0@3:3-3:9"],
"uses": ["2:6-2:12"]
"callees": ["0@3:3-3:9"]
}]
}
*/

View File

@ -28,8 +28,7 @@ OUTPUT:
"qualified_name": "Foo::Used",
"declarations": ["2:8-2:12"],
"declaring_type": 0,
"callers": ["1@7:6-7:10"],
"uses": ["2:8-2:12", "7:6-7:10"]
"callers": ["1@7:6-7:10"]
}, {
"id": 1,
"usr": "c:@F@user#",
@ -37,8 +36,7 @@ OUTPUT:
"qualified_name": "user",
"definition_spelling": "5:6-5:10",
"definition_extent": "5:1-8:2",
"callees": ["0@7:6-7:10"],
"uses": ["5:6-5:10"]
"callees": ["0@7:6-7:10"]
}],
"vars": [{
"id": 0,

View File

@ -26,7 +26,7 @@ OUTPUT:
"qualified_name": "helper",
"definition_spelling": "1:12-1:18",
"definition_extent": "1:1-3:2",
"uses": ["1:12-1:18", "6:11-6:17"]
"callers": ["-1@6:11-6:17"]
}],
"vars": [{
"id": 0,

View File

@ -12,8 +12,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"declarations": ["1:6-1:9"],
"callers": ["1@4:3-4:6"],
"uses": ["1:6-1:9", "4:3-4:6"]
"callers": ["1@4:3-4:6"]
}, {
"id": 1,
"usr": "c:@F@usage#",
@ -21,8 +20,7 @@ OUTPUT:
"qualified_name": "usage",
"definition_spelling": "3:6-3:11",
"definition_extent": "3:1-5:2",
"callees": ["0@4:3-4:6"],
"uses": ["3:6-3:11"]
"callees": ["0@4:3-4:6"]
}]
}
*/

View File

@ -27,8 +27,7 @@ OUTPUT:
"qualified_name": "Foo::foo",
"declarations": ["2:8-2:11"],
"declaring_type": 0,
"callers": ["1@7:6-7:9"],
"uses": ["2:8-2:11", "7:6-7:9"]
"callers": ["1@7:6-7:9"]
}, {
"id": 1,
"usr": "c:@F@usage#",
@ -36,8 +35,7 @@ OUTPUT:
"qualified_name": "usage",
"definition_spelling": "5:6-5:11",
"definition_extent": "5:1-8:2",
"callees": ["0@7:6-7:9"],
"uses": ["5:6-5:11"]
"callees": ["0@7:6-7:9"]
}],
"vars": [{
"id": 0,

View File

@ -15,8 +15,7 @@ OUTPUT:
"short_name": "accept",
"qualified_name": "accept",
"declarations": ["2:6-2:12"],
"callers": ["1@5:3-5:9", "1@6:3-6:9"],
"uses": ["2:6-2:12", "5:3-5:9", "6:3-6:9"]
"callers": ["1@5:3-5:9", "1@6:3-6:9"]
}, {
"id": 1,
"usr": "c:@F@foo#",
@ -24,8 +23,7 @@ OUTPUT:
"qualified_name": "foo",
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-7:2",
"callees": ["0@5:3-5:9", "0@6:3-6:9"],
"uses": ["4:6-4:9"]
"callees": ["0@5:3-5:9", "0@6:3-6:9"]
}]
}
*/

View File

@ -33,8 +33,7 @@ OUTPUT:
"short_name": "return_type",
"qualified_name": "return_type",
"definition_spelling": "9:16-9:27",
"definition_extent": "9:1-12:2",
"uses": ["9:16-9:27"]
"definition_extent": "9:1-12:2"
}],
"vars": [{
"id": 0,

View File

@ -110,24 +110,21 @@ OUTPUT:
"short_name": "as_return_type",
"qualified_name": "as_return_type",
"definition_spelling": "33:37-33:51",
"definition_extent": "33:1-33:92",
"uses": ["33:37-33:51"]
"definition_extent": "33:1-33:92"
}, {
"id": 1,
"usr": "c:@F@no_return_type#I#",
"short_name": "no_return_type",
"qualified_name": "no_return_type",
"definition_spelling": "40:6-40:20",
"definition_extent": "40:1-40:28",
"uses": ["40:6-40:20"]
"definition_extent": "40:1-40:28"
}, {
"id": 2,
"usr": "c:@F@empty#",
"short_name": "empty",
"qualified_name": "empty",
"definition_spelling": "53:6-53:11",
"definition_extent": "53:1-55:2",
"uses": ["53:6-53:11"]
"definition_extent": "53:1-55:2"
}, {
"id": 3,
"usr": "c:@S@Foo@F@foo#",
@ -136,8 +133,7 @@ OUTPUT:
"declarations": ["65:23-65:26"],
"definition_spelling": "79:26-79:29",
"definition_extent": "79:1-79:51",
"declaring_type": 3,
"uses": ["65:23-65:26", "79:26-79:29"]
"declaring_type": 3
}],
"vars": [{
"id": 0,

View File

@ -30,8 +30,7 @@ OUTPUT:
"short_name": "Foo",
"qualified_name": "Foo",
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-7:2",
"uses": ["4:6-4:9"]
"definition_extent": "4:1-7:2"
}],
"vars": [{
"id": 0,

View File

@ -27,8 +27,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-4:47",
"uses": ["4:6-4:9"]
"definition_extent": "4:1-4:47"
}],
"vars": [{
"id": 0,

View File

@ -24,8 +24,7 @@ OUTPUT:
"qualified_name": "foo",
"declarations": ["3:6-3:9"],
"definition_spelling": "4:6-4:9",
"definition_extent": "4:1-4:26",
"uses": ["3:6-3:9", "4:6-4:9"]
"definition_extent": "4:1-4:26"
}],
"vars": [{
"id": 0,

View File

@ -14,8 +14,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "2:6-2:9",
"definition_extent": "2:1-2:26",
"uses": ["2:6-2:9"]
"definition_extent": "2:1-2:26"
}]
}
*/

View File

@ -25,8 +25,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-8:2",
"uses": ["3:6-3:9"]
"definition_extent": "3:1-8:2"
}],
"vars": [{
"id": 0,

View File

@ -41,8 +41,7 @@ OUTPUT:
"qualified_name": "foo",
"declarations": ["3:7-3:10", "4:7-4:10"],
"definition_spelling": "5:7-5:10",
"definition_extent": "5:1-5:15",
"uses": ["3:7-3:10", "4:7-4:10", "5:7-5:10"]
"definition_extent": "5:1-5:15"
}, {
"id": 1,
"usr": "c:@S@Foo@F@Get#I#",
@ -51,8 +50,7 @@ OUTPUT:
"declarations": ["8:9-8:12"],
"definition_spelling": "12:12-12:15",
"definition_extent": "12:1-12:23",
"declaring_type": 1,
"uses": ["8:9-8:12", "12:12-12:15"]
"declaring_type": 1
}, {
"id": 2,
"usr": "c:@S@Foo@F@Empty#",
@ -61,15 +59,13 @@ OUTPUT:
"declarations": ["9:8-9:13"],
"definition_spelling": "13:11-13:16",
"definition_extent": "13:1-13:21",
"declaring_type": 1,
"uses": ["9:8-9:13", "13:11-13:16"]
"declaring_type": 1
}, {
"id": 3,
"usr": "c:@F@external#",
"short_name": "external",
"qualified_name": "external",
"declarations": ["15:20-15:28"],
"uses": ["15:20-15:28"]
"declarations": ["15:20-15:28"]
}, {
"id": 4,
"usr": "c:type_usage_on_return_type.cc@F@bar#",
@ -77,8 +73,7 @@ OUTPUT:
"qualified_name": "bar",
"declarations": ["17:14-17:17"],
"definition_spelling": "18:14-18:17",
"definition_extent": "18:1-18:22",
"uses": ["17:14-17:17", "18:14-18:17"]
"definition_extent": "18:1-18:22"
}]
}
*/

View File

@ -58,32 +58,28 @@ OUTPUT:
"short_name": "accept",
"qualified_name": "accept",
"definition_spelling": "7:6-7:12",
"definition_extent": "7:1-7:21",
"uses": ["7:6-7:12"]
"definition_extent": "7:1-7:21"
}, {
"id": 1,
"usr": "c:@F@accept1#**$@S@Foo#",
"short_name": "accept1",
"qualified_name": "accept1",
"definition_spelling": "8:6-8:13",
"definition_extent": "8:1-8:23",
"uses": ["8:6-8:13"]
"definition_extent": "8:1-8:23"
}, {
"id": 2,
"usr": "c:@F@accept2#*$@S@Foo#",
"short_name": "accept2",
"qualified_name": "accept2",
"definition_spelling": "9:6-9:13",
"definition_extent": "9:1-9:23",
"uses": ["9:6-9:13"]
"definition_extent": "9:1-9:23"
}, {
"id": 3,
"usr": "c:@F@accept3#**$@S@Foo#",
"short_name": "accept3",
"qualified_name": "accept3",
"definition_spelling": "10:6-10:13",
"definition_extent": "10:1-10:23",
"uses": ["10:6-10:13"]
"definition_extent": "10:1-10:23"
}]
}
*/

View File

@ -31,8 +31,7 @@ OUTPUT:
"declarations": ["2:8-2:12"],
"definition_spelling": "5:11-5:15",
"definition_extent": "5:1-8:2",
"declaring_type": 0,
"uses": ["2:8-2:12", "5:11-5:15"]
"declaring_type": 0
}],
"vars": [{
"id": 0,

View File

@ -33,16 +33,14 @@ OUTPUT:
"short_name": "called",
"qualified_name": "called",
"declarations": ["1:6-1:12"],
"callers": ["2@14:3-14:9"],
"uses": ["1:6-1:12", "14:3-14:9"]
"callers": ["2@14:3-14:9"]
}, {
"id": 1,
"usr": "c:@F@gen#",
"short_name": "gen",
"qualified_name": "gen",
"declarations": ["3:5-3:8"],
"callers": ["2@14:14-14:17"],
"uses": ["3:5-3:8", "14:14-14:17"]
"callers": ["2@14:14-14:17"]
}, {
"id": 2,
"usr": "c:@F@foo#",
@ -50,8 +48,7 @@ OUTPUT:
"qualified_name": "foo",
"definition_spelling": "12:6-12:9",
"definition_extent": "12:1-15:2",
"callees": ["0@14:3-14:9", "1@14:14-14:17"],
"uses": ["12:6-12:9"]
"callees": ["0@14:3-14:9", "1@14:14-14:17"]
}],
"vars": [{
"id": 0,

View File

@ -15,8 +15,7 @@ OUTPUT:
"short_name": "called",
"qualified_name": "called",
"declarations": ["1:6-1:12"],
"callers": ["2@6:3-6:9"],
"uses": ["1:6-1:12", "6:3-6:9"]
"callers": ["2@6:3-6:9"]
}, {
"id": 1,
"usr": "c:@F@gen#",
@ -24,8 +23,7 @@ OUTPUT:
"qualified_name": "gen",
"definition_spelling": "3:5-3:8",
"definition_extent": "3:1-3:24",
"callers": ["2@6:10-6:13", "2@6:18-6:21"],
"uses": ["3:5-3:8", "6:10-6:13", "6:18-6:21"]
"callers": ["2@6:10-6:13", "2@6:18-6:21"]
}, {
"id": 2,
"usr": "c:@F@foo#",
@ -33,8 +31,7 @@ OUTPUT:
"qualified_name": "foo",
"definition_spelling": "5:6-5:9",
"definition_extent": "5:1-7:2",
"callees": ["0@6:3-6:9", "1@6:10-6:13", "1@6:18-6:21"],
"uses": ["5:6-5:9"]
"callees": ["0@6:3-6:9", "1@6:10-6:13", "1@6:18-6:21"]
}]
}
*/

View File

@ -17,8 +17,7 @@ OUTPUT:
"qualified_name": "called",
"definition_spelling": "1:6-1:12",
"definition_extent": "1:1-1:17",
"callers": ["1@4:13-4:19", "1@7:3-7:9"],
"uses": ["1:6-1:12", "4:13-4:19", "7:3-7:9"]
"callers": ["1@4:13-4:19", "1@7:3-7:9"]
}, {
"id": 1,
"usr": "c:@F@caller#",
@ -26,8 +25,7 @@ OUTPUT:
"qualified_name": "caller",
"definition_spelling": "3:6-3:12",
"definition_extent": "3:1-8:2",
"callees": ["0@4:13-4:19", "0@7:3-7:9"],
"uses": ["3:6-3:12"]
"callees": ["0@4:13-4:19", "0@7:3-7:9"]
}],
"vars": [{
"id": 0,

View File

@ -37,16 +37,14 @@ OUTPUT:
"short_name": "accept",
"qualified_name": "accept",
"declarations": ["7:6-7:12"],
"callers": ["2@14:3-14:9", "2@15:3-15:9", "2@17:3-17:9"],
"uses": ["7:6-7:12", "14:3-14:9", "15:3-15:9", "17:3-17:9"]
"callers": ["2@14:3-14:9", "2@15:3-15:9", "2@17:3-17:9"]
}, {
"id": 1,
"usr": "c:@F@accept#*I#",
"short_name": "accept",
"qualified_name": "accept",
"declarations": ["8:6-8:12"],
"callers": ["2@16:3-16:9"],
"uses": ["8:6-8:12", "16:3-16:9"]
"callers": ["2@16:3-16:9"]
}, {
"id": 2,
"usr": "c:@F@foo#",
@ -54,8 +52,7 @@ OUTPUT:
"qualified_name": "foo",
"definition_spelling": "10:6-10:9",
"definition_extent": "10:1-18:2",
"callees": ["0@14:3-14:9", "0@15:3-15:9", "1@16:3-16:9", "0@17:3-17:9"],
"uses": ["10:6-10:9"]
"callees": ["0@14:3-14:9", "0@15:3-15:9", "1@16:3-16:9", "0@17:3-17:9"]
}],
"vars": [{
"id": 0,

View File

@ -26,8 +26,7 @@ OUTPUT:
"short_name": "accept",
"qualified_name": "accept",
"declarations": ["5:6-5:12"],
"callers": ["1@8:3-8:9"],
"uses": ["5:6-5:12", "8:3-8:9"]
"callers": ["1@8:3-8:9"]
}, {
"id": 1,
"usr": "c:@F@foo#",
@ -35,8 +34,7 @@ OUTPUT:
"qualified_name": "foo",
"definition_spelling": "7:6-7:9",
"definition_extent": "7:1-9:2",
"callees": ["0@8:3-8:9"],
"uses": ["7:6-7:9"]
"callees": ["0@8:3-8:9"]
}],
"vars": [{
"id": 0,

View File

@ -12,8 +12,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-5:2",
"uses": ["3:6-3:9"]
"definition_extent": "3:1-5:2"
}],
"vars": [{
"id": 0,

View File

@ -10,8 +10,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-3:2",
"uses": ["1:6-1:9"]
"definition_extent": "1:1-3:2"
}],
"vars": [{
"id": 0,

View File

@ -11,8 +11,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-4:2",
"uses": ["1:6-1:9"]
"definition_extent": "1:1-4:2"
}],
"vars": [{
"id": 0,

View File

@ -16,8 +16,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-9:2",
"uses": ["1:6-1:9"]
"definition_extent": "1:1-9:2"
}],
"vars": [{
"id": 0,

View File

@ -16,8 +16,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-8:2",
"uses": ["1:6-1:9"]
"definition_extent": "1:1-8:2"
}],
"vars": [{
"id": 0,

View File

@ -13,8 +13,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-5:2",
"uses": ["3:6-3:9"]
"definition_extent": "3:1-5:2"
}],
"vars": [{
"id": 0,

View File

@ -19,8 +19,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-5:2",
"uses": ["3:6-3:9"]
"definition_extent": "3:1-5:2"
}],
"vars": [{
"id": 0,

View File

@ -17,8 +17,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "3:6-3:9",
"definition_extent": "3:1-3:30",
"uses": ["3:6-3:9"]
"definition_extent": "3:1-3:30"
}],
"vars": [{
"id": 0,

View File

@ -8,8 +8,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-1:22",
"uses": ["1:6-1:9"]
"definition_extent": "1:1-1:22"
}]
}
*/

View File

@ -16,8 +16,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-9:2",
"uses": ["1:6-1:9"]
"definition_extent": "1:1-9:2"
}],
"vars": [{
"id": 0,

View File

@ -10,8 +10,7 @@ OUTPUT:
"short_name": "foo",
"qualified_name": "foo",
"definition_spelling": "1:6-1:9",
"definition_extent": "1:1-3:2",
"uses": ["1:6-1:9"]
"definition_extent": "1:1-3:2"
}],
"vars": [{
"id": 0,