mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00:26 +00:00
Use indexed ids for QueryTypeDef
This commit is contained in:
parent
d61cc7a077
commit
64d65584fd
@ -123,6 +123,18 @@ std::string Join(const std::vector<std::string>& elements, std::string sep) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
optional<QueryableLocation> GetDefinitionSpellingOfSymbol(QueryableDatabase* db, const QueryTypeId& id) {
|
||||||
|
QueryableTypeDef* def = &db->types[id.id];
|
||||||
|
return def->def.definition_spelling;
|
||||||
|
}
|
||||||
|
optional<QueryableLocation> GetDefinitionSpellingOfSymbol(QueryableDatabase* db, const QueryFuncId& id) {
|
||||||
|
QueryableFuncDef* def = &db->funcs[id.id];
|
||||||
|
return def->def.definition_spelling;
|
||||||
|
}
|
||||||
|
optional<QueryableLocation> GetDefinitionSpellingOfSymbol(QueryableDatabase* db, const QueryVarId& id) {
|
||||||
|
QueryableVarDef* def = &db->vars[id.id];
|
||||||
|
return def->def.definition_spelling;
|
||||||
|
}
|
||||||
|
|
||||||
optional<QueryableLocation> GetDefinitionSpellingOfSymbol(QueryableDatabase* db, const SymbolIdx& symbol) {
|
optional<QueryableLocation> GetDefinitionSpellingOfSymbol(QueryableDatabase* db, const SymbolIdx& symbol) {
|
||||||
switch (symbol.kind) {
|
switch (symbol.kind) {
|
||||||
@ -388,6 +400,26 @@ lsLocation GetLsLocation(QueryableDatabase* db, const QueryableLocation& locatio
|
|||||||
GetLsDocumentUri(db, location.path),
|
GetLsDocumentUri(db, location.path),
|
||||||
GetLsRange(location.range));
|
GetLsRange(location.range));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AddCodeLens(
|
void AddCodeLens(
|
||||||
QueryableDatabase* db,
|
QueryableDatabase* db,
|
||||||
@ -429,6 +461,7 @@ void AddCodeLens(
|
|||||||
result->push_back(code_lens);
|
result->push_back(code_lens);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: clean these overrides up...
|
||||||
void AddCodeLens(
|
void AddCodeLens(
|
||||||
QueryableDatabase* db,
|
QueryableDatabase* db,
|
||||||
std::vector<TCodeLens>* result,
|
std::vector<TCodeLens>* result,
|
||||||
@ -463,6 +496,65 @@ void AddCodeLens(
|
|||||||
}
|
}
|
||||||
AddCodeLens(db, result, loc, uses0, exclude_loc, only_interesting, singular, plural);
|
AddCodeLens(db, result, loc, uses0, exclude_loc, only_interesting, singular, plural);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddCodeLens(
|
||||||
|
QueryableDatabase* db,
|
||||||
|
std::vector<TCodeLens>* result,
|
||||||
|
QueryableLocation loc,
|
||||||
|
const std::vector<QueryTypeId>& usrs,
|
||||||
|
bool exclude_loc,
|
||||||
|
bool only_interesting,
|
||||||
|
const char* singular,
|
||||||
|
const char* plural) {
|
||||||
|
std::vector<QueryableLocation> uses0;
|
||||||
|
uses0.reserve(usrs.size());
|
||||||
|
for (const QueryTypeId& usr : usrs) {
|
||||||
|
optional<QueryableLocation> loc = GetDefinitionSpellingOfSymbol(db, usr);
|
||||||
|
if (loc)
|
||||||
|
uses0.push_back(loc.value());
|
||||||
|
}
|
||||||
|
AddCodeLens(db, result, loc, uses0, exclude_loc, only_interesting, singular, plural);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddCodeLens(
|
||||||
|
QueryableDatabase* db,
|
||||||
|
std::vector<TCodeLens>* result,
|
||||||
|
QueryableLocation loc,
|
||||||
|
const std::vector<QueryVarId>& usrs,
|
||||||
|
bool exclude_loc,
|
||||||
|
bool only_interesting,
|
||||||
|
const char* singular,
|
||||||
|
const char* plural) {
|
||||||
|
std::vector<QueryableLocation> uses0;
|
||||||
|
uses0.reserve(usrs.size());
|
||||||
|
for (const QueryVarId& usr : usrs) {
|
||||||
|
optional<QueryableLocation> loc = GetDefinitionSpellingOfSymbol(db, usr);
|
||||||
|
if (loc)
|
||||||
|
uses0.push_back(loc.value());
|
||||||
|
}
|
||||||
|
AddCodeLens(db, result, loc, uses0, exclude_loc, only_interesting, singular, plural);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void QueryDbMainLoop(
|
void QueryDbMainLoop(
|
||||||
QueryableDatabase* db,
|
QueryableDatabase* db,
|
||||||
|
106
src/query.cc
106
src/query.cc
@ -15,18 +15,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: remove
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Usr MapIdToUsr(const IdMap& id_map, const IndexTypeId& id) {
|
Usr MapIdToUsr(const IdMap& id_map, const IndexTypeId& id) {
|
||||||
assert(id_map.local_ids.type_id_to_usr.find(id) != id_map.local_ids.type_id_to_usr.end());
|
assert(id_map.local_ids.type_id_to_usr.find(id) != id_map.local_ids.type_id_to_usr.end());
|
||||||
return id_map.local_ids.type_id_to_usr.find(id)->second;
|
return id_map.local_ids.type_id_to_usr.find(id)->second;
|
||||||
}
|
}
|
||||||
|
// TODO: remove
|
||||||
Usr MapIdToUsr(const IdMap& id_map, const IndexFuncId& id) {
|
Usr MapIdToUsr(const IdMap& id_map, const IndexFuncId& id) {
|
||||||
assert(id_map.local_ids.func_id_to_usr.find(id) != id_map.local_ids.func_id_to_usr.end());
|
assert(id_map.local_ids.func_id_to_usr.find(id) != id_map.local_ids.func_id_to_usr.end());
|
||||||
return id_map.local_ids.func_id_to_usr.find(id)->second;
|
return id_map.local_ids.func_id_to_usr.find(id)->second;
|
||||||
}
|
}
|
||||||
|
// TODO: remove
|
||||||
Usr MapIdToUsr(const IdMap& id_map, const IndexVarId& id) {
|
Usr MapIdToUsr(const IdMap& id_map, const IndexVarId& id) {
|
||||||
assert(id_map.local_ids.var_id_to_usr.find(id) != id_map.local_ids.var_id_to_usr.end());
|
assert(id_map.local_ids.var_id_to_usr.find(id) != id_map.local_ids.var_id_to_usr.end());
|
||||||
return id_map.local_ids.var_id_to_usr.find(id)->second;
|
return id_map.local_ids.var_id_to_usr.find(id)->second;
|
||||||
@ -34,6 +33,7 @@ Usr MapIdToUsr(const IdMap& id_map, const IndexVarId& id) {
|
|||||||
QueryableLocation MapIdToUsr(const IdMap& id_map, const Range& range) {
|
QueryableLocation MapIdToUsr(const IdMap& id_map, const Range& range) {
|
||||||
return QueryableLocation(id_map.primary_file, range);
|
return QueryableLocation(id_map.primary_file, range);
|
||||||
}
|
}
|
||||||
|
// TODO: remove
|
||||||
UsrRef MapIdToUsr(const IdMap& id_map, const FuncRef& id) {
|
UsrRef MapIdToUsr(const IdMap& id_map, const FuncRef& id) {
|
||||||
assert(id_map.local_ids.func_id_to_usr.find(id.id) != id_map.local_ids.func_id_to_usr.end());
|
assert(id_map.local_ids.func_id_to_usr.find(id.id) != id_map.local_ids.func_id_to_usr.end());
|
||||||
return UsrRef(
|
return UsrRef(
|
||||||
@ -52,15 +52,19 @@ std::vector<Out> Transform(const IdMap& id_map, const std::vector<In>& input) {
|
|||||||
result.push_back(MapIdToUsr(id_map, in));
|
result.push_back(MapIdToUsr(id_map, in));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
// TODO: remove
|
||||||
std::vector<Usr> MapIdToUsr(const IdMap& id_map, const std::vector<IndexTypeId>& ids) {
|
std::vector<Usr> MapIdToUsr(const IdMap& id_map, const std::vector<IndexTypeId>& ids) {
|
||||||
return Transform<IndexTypeId, Usr>(id_map, ids);
|
return Transform<IndexTypeId, Usr>(id_map, ids);
|
||||||
}
|
}
|
||||||
|
// TODO: remove
|
||||||
std::vector<Usr> MapIdToUsr(const IdMap& id_map, const std::vector<IndexFuncId>& ids) {
|
std::vector<Usr> MapIdToUsr(const IdMap& id_map, const std::vector<IndexFuncId>& ids) {
|
||||||
return Transform<IndexFuncId, Usr>(id_map, ids);
|
return Transform<IndexFuncId, Usr>(id_map, ids);
|
||||||
}
|
}
|
||||||
|
// TODO: remove
|
||||||
std::vector<Usr> MapIdToUsr(const IdMap& id_map, const std::vector<IndexVarId>& ids) {
|
std::vector<Usr> MapIdToUsr(const IdMap& id_map, const std::vector<IndexVarId>& ids) {
|
||||||
return Transform<IndexVarId, Usr>(id_map, ids);
|
return Transform<IndexVarId, Usr>(id_map, ids);
|
||||||
}
|
}
|
||||||
|
// TODO: remove
|
||||||
std::vector<UsrRef> MapIdToUsr(const IdMap& id_map, const std::vector<FuncRef>& ids) {
|
std::vector<UsrRef> MapIdToUsr(const IdMap& id_map, const std::vector<FuncRef>& ids) {
|
||||||
return Transform<FuncRef, UsrRef>(id_map, ids);
|
return Transform<FuncRef, UsrRef>(id_map, ids);
|
||||||
}
|
}
|
||||||
@ -74,16 +78,13 @@ QueryableTypeDef::DefUpdate MapIdToUsr(const IdMap& id_map, const IndexedTypeDef
|
|||||||
QueryableTypeDef::DefUpdate result(def.usr);
|
QueryableTypeDef::DefUpdate result(def.usr);
|
||||||
result.short_name = def.short_name;
|
result.short_name = def.short_name;
|
||||||
result.qualified_name = def.qualified_name;
|
result.qualified_name = def.qualified_name;
|
||||||
if (def.definition_spelling)
|
result.definition_spelling = id_map.ToQuery(def.definition_spelling);
|
||||||
result.definition_spelling = MapIdToUsr(id_map, def.definition_spelling.value());
|
result.definition_extent = id_map.ToQuery(def.definition_extent);
|
||||||
if (def.definition_extent)
|
result.alias_of = id_map.ToQuery(def.alias_of);
|
||||||
result.definition_extent = MapIdToUsr(id_map, def.definition_extent.value());
|
result.parents = id_map.ToQuery(def.parents);
|
||||||
if (def.alias_of)
|
result.types = id_map.ToQuery(def.types);
|
||||||
result.alias_of = MapIdToUsr(id_map, def.alias_of.value());
|
result.funcs = id_map.ToQuery(def.funcs);
|
||||||
result.parents = MapIdToUsr(id_map, def.parents);
|
result.vars = id_map.ToQuery(def.vars);
|
||||||
result.types = MapIdToUsr(id_map, def.types);
|
|
||||||
result.funcs = MapIdToUsr(id_map, def.funcs);
|
|
||||||
result.vars = MapIdToUsr(id_map, def.vars);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
QueryableFuncDef::DefUpdate MapIdToUsr(const IdMap& id_map, const IndexedFuncDef::Def& def) {
|
QueryableFuncDef::DefUpdate MapIdToUsr(const IdMap& id_map, const IndexedFuncDef::Def& def) {
|
||||||
@ -186,9 +187,9 @@ QueryableFile::QueryableFile(const IdMap& id_map, const IndexedFile& indexed)
|
|||||||
|
|
||||||
QueryableTypeDef::QueryableTypeDef(const IdMap& id_map, const IndexedTypeDef& indexed)
|
QueryableTypeDef::QueryableTypeDef(const IdMap& id_map, const IndexedTypeDef& indexed)
|
||||||
: def(MapIdToUsr(id_map, indexed.def)) {
|
: def(MapIdToUsr(id_map, indexed.def)) {
|
||||||
derived = MapIdToUsr(id_map, indexed.derived);
|
derived = id_map.ToQuery(indexed.derived);
|
||||||
instantiations = MapIdToUsr(id_map, indexed.instantiations);
|
instantiations = id_map.ToQuery(indexed.instantiations);
|
||||||
uses = MapIdToUsr(id_map, indexed.uses);
|
uses = id_map.ToQuery(indexed.uses);
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryableFuncDef::QueryableFuncDef(const IdMap& id_map, const IndexedFuncDef& indexed)
|
QueryableFuncDef::QueryableFuncDef(const IdMap& id_map, const IndexedFuncDef& indexed)
|
||||||
@ -421,29 +422,71 @@ IdMap::IdMap(QueryableDatabase* query_db, const IdCache& local_ids)
|
|||||||
cached_var_ids_[entry.first.id] = GetQueryVarIdFromUsr(query_db, entry.second).id;
|
cached_var_ids_[entry.first.id] = GetQueryVarIdFromUsr(query_db, entry.second).id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryableLocation IdMap::ToQuery(Range range) const {
|
||||||
|
return QueryableLocation(primary_file, range);
|
||||||
|
}
|
||||||
|
|
||||||
QueryTypeId IdMap::ToQuery(IndexTypeId id) const {
|
QueryTypeId IdMap::ToQuery(IndexTypeId id) const {
|
||||||
assert(cached_type_ids_.find(id.id) != cached_type_ids_.end());
|
assert(cached_type_ids_.find(id.id) != cached_type_ids_.end());
|
||||||
return QueryTypeId(cached_type_ids_.find(id.id)->second);
|
return QueryTypeId(cached_type_ids_.find(id.id)->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryFuncId IdMap::ToQuery(IndexFuncId id) const {
|
QueryFuncId IdMap::ToQuery(IndexFuncId id) const {
|
||||||
assert(cached_func_ids_.find(id.id) != cached_func_ids_.end());
|
assert(cached_func_ids_.find(id.id) != cached_func_ids_.end());
|
||||||
return QueryFuncId(cached_func_ids_.find(id.id)->second);
|
return QueryFuncId(cached_func_ids_.find(id.id)->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryVarId IdMap::ToQuery(IndexVarId id) const {
|
QueryVarId IdMap::ToQuery(IndexVarId id) const {
|
||||||
assert(cached_var_ids_.find(id.id) != cached_var_ids_.end());
|
assert(cached_var_ids_.find(id.id) != cached_var_ids_.end());
|
||||||
return QueryVarId(cached_var_ids_.find(id.id)->second);
|
return QueryVarId(cached_var_ids_.find(id.id)->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
optional<QueryableLocation> IdMap::ToQuery(optional<Range> range) const {
|
||||||
|
if (!range)
|
||||||
|
return nullopt;
|
||||||
|
return ToQuery(range.value());
|
||||||
|
}
|
||||||
|
optional<QueryTypeId> IdMap::ToQuery(optional<IndexTypeId> id) const {
|
||||||
|
if (!id)
|
||||||
|
return nullopt;
|
||||||
|
return ToQuery(id.value());
|
||||||
|
}
|
||||||
|
optional<QueryFuncId> IdMap::ToQuery(optional<IndexFuncId> id) const {
|
||||||
|
if (!id)
|
||||||
|
return nullopt;
|
||||||
|
return ToQuery(id.value());
|
||||||
|
}
|
||||||
|
optional<QueryVarId> IdMap::ToQuery(optional<IndexVarId> id) const {
|
||||||
|
if (!id)
|
||||||
|
return nullopt;
|
||||||
|
return ToQuery(id.value());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename In, typename Out>
|
||||||
|
std::vector<Out> ToQueryTransform(const IdMap& id_map, const std::vector<In>& input) {
|
||||||
|
std::vector<Out> result;
|
||||||
|
result.reserve(input.size());
|
||||||
|
for (const In& in : input)
|
||||||
|
result.push_back(id_map.ToQuery(in));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
std::vector<QueryableLocation> IdMap::ToQuery(std::vector<Range> ranges) const {
|
||||||
|
return ToQueryTransform<Range, QueryableLocation>(*this, ranges);
|
||||||
|
}
|
||||||
|
std::vector<QueryTypeId> IdMap::ToQuery(std::vector<IndexTypeId> ids) const {
|
||||||
|
return ToQueryTransform<IndexTypeId, QueryTypeId>(*this, ids);
|
||||||
|
}
|
||||||
|
std::vector<QueryFuncId> IdMap::ToQuery(std::vector<IndexFuncId> ids) const {
|
||||||
|
return ToQueryTransform<IndexFuncId, QueryFuncId>(*this, ids);
|
||||||
|
}
|
||||||
|
std::vector<QueryVarId> IdMap::ToQuery(std::vector<IndexVarId> ids) const {
|
||||||
|
return ToQueryTransform<IndexVarId, QueryVarId>(*this, ids);
|
||||||
|
}
|
||||||
|
|
||||||
SymbolIdx IdMap::ToSymbol(IndexTypeId id) const {
|
SymbolIdx IdMap::ToSymbol(IndexTypeId id) const {
|
||||||
return SymbolIdx(SymbolKind::Type, ToQuery(id).id);
|
return SymbolIdx(SymbolKind::Type, ToQuery(id).id);
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolIdx IdMap::ToSymbol(IndexFuncId id) const {
|
SymbolIdx IdMap::ToSymbol(IndexFuncId id) const {
|
||||||
return SymbolIdx(SymbolKind::Func, ToQuery(id).id);
|
return SymbolIdx(SymbolKind::Func, ToQuery(id).id);
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolIdx IdMap::ToSymbol(IndexVarId id) const {
|
SymbolIdx IdMap::ToSymbol(IndexVarId id) const {
|
||||||
return SymbolIdx(SymbolKind::Var, ToQuery(id).id);
|
return SymbolIdx(SymbolKind::Var, ToQuery(id).id);
|
||||||
}
|
}
|
||||||
@ -493,6 +536,21 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, const IdMap& current_id_m
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: unify with PROCESS_UPDATE_DIFF once we don't need MapIdToUsr.
|
||||||
|
#define PROCESS_UPDATE_DIFF2(query_name, index_name, type) \
|
||||||
|
{ \
|
||||||
|
/* Check for changes. */ \
|
||||||
|
std::vector<type> removed, added; \
|
||||||
|
auto previous = previous_id_map.ToQuery(previous_def->index_name); \
|
||||||
|
auto current = current_id_map.ToQuery(current_def->index_name); \
|
||||||
|
bool did_add = ComputeDifferenceForUpdate( \
|
||||||
|
previous, current, \
|
||||||
|
&removed, &added); \
|
||||||
|
if (did_add) {\
|
||||||
|
std::cerr << "Adding mergeable update on " << current_def->def.short_name << " (" << current_def->def.usr << ") for field " << #index_name << std::endl; \
|
||||||
|
query_name.push_back(MergeableUpdate<type>(current_def->def.usr, removed, added)); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
// File
|
// File
|
||||||
files_def_update.push_back(BuildFileDef(current_id_map, current_file));
|
files_def_update.push_back(BuildFileDef(current_id_map, current_file));
|
||||||
|
|
||||||
@ -514,9 +572,9 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, const IdMap& current_id_m
|
|||||||
if (previous_remapped_def != current_remapped_def)
|
if (previous_remapped_def != current_remapped_def)
|
||||||
types_def_update.push_back(current_remapped_def);
|
types_def_update.push_back(current_remapped_def);
|
||||||
|
|
||||||
PROCESS_UPDATE_DIFF(types_derived, derived, Usr);
|
PROCESS_UPDATE_DIFF2(types_derived, derived, QueryTypeId);
|
||||||
PROCESS_UPDATE_DIFF(types_instantiations, instantiations, Usr);
|
PROCESS_UPDATE_DIFF2(types_instantiations, instantiations, QueryVarId);
|
||||||
PROCESS_UPDATE_DIFF(types_uses, uses, QueryableLocation);
|
PROCESS_UPDATE_DIFF2(types_uses, uses, QueryableLocation);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
21
src/query.h
21
src/query.h
@ -158,14 +158,14 @@ struct QueryableFile {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct QueryableTypeDef {
|
struct QueryableTypeDef {
|
||||||
using DefUpdate = TypeDefDefinitionData<Usr, Usr, Usr, QueryableLocation>;
|
using DefUpdate = TypeDefDefinitionData<QueryTypeId, QueryFuncId, QueryVarId, QueryableLocation>;
|
||||||
using DerivedUpdate = MergeableUpdate<Usr>;
|
using DerivedUpdate = MergeableUpdate<QueryTypeId>;
|
||||||
using InstantiationsUpdate = MergeableUpdate<Usr>;
|
using InstantiationsUpdate = MergeableUpdate<QueryVarId>;
|
||||||
using UsesUpdate = MergeableUpdate<QueryableLocation>;
|
using UsesUpdate = MergeableUpdate<QueryableLocation>;
|
||||||
|
|
||||||
DefUpdate def;
|
DefUpdate def;
|
||||||
std::vector<Usr> derived;
|
std::vector<QueryTypeId> derived;
|
||||||
std::vector<Usr> instantiations;
|
std::vector<QueryVarId> instantiations;
|
||||||
std::vector<QueryableLocation> uses;
|
std::vector<QueryableLocation> uses;
|
||||||
size_t qualified_name_idx = -1;
|
size_t qualified_name_idx = -1;
|
||||||
|
|
||||||
@ -295,13 +295,22 @@ struct IdMap {
|
|||||||
|
|
||||||
IdMap(QueryableDatabase* query_db, const IdCache& local_ids);
|
IdMap(QueryableDatabase* query_db, const IdCache& local_ids);
|
||||||
|
|
||||||
|
QueryableLocation ToQuery(Range range) const;
|
||||||
QueryTypeId ToQuery(IndexTypeId id) const;
|
QueryTypeId ToQuery(IndexTypeId id) const;
|
||||||
QueryFuncId ToQuery(IndexFuncId id) const;
|
QueryFuncId ToQuery(IndexFuncId id) const;
|
||||||
QueryVarId ToQuery(IndexVarId id) const;
|
QueryVarId ToQuery(IndexVarId id) const;
|
||||||
|
optional<QueryableLocation> ToQuery(optional<Range> range) const;
|
||||||
|
optional<QueryTypeId> ToQuery(optional<IndexTypeId> id) const;
|
||||||
|
optional<QueryFuncId> ToQuery(optional<IndexFuncId> id) const;
|
||||||
|
optional<QueryVarId> ToQuery(optional<IndexVarId> id) const;
|
||||||
|
std::vector<QueryableLocation> ToQuery(std::vector<Range> ranges) const;
|
||||||
|
std::vector<QueryTypeId> ToQuery(std::vector<IndexTypeId> ids) const;
|
||||||
|
std::vector<QueryFuncId> ToQuery(std::vector<IndexFuncId> ids) const;
|
||||||
|
std::vector<QueryVarId> ToQuery(std::vector<IndexVarId> ids) const;
|
||||||
|
|
||||||
SymbolIdx ToSymbol(IndexTypeId id) const;
|
SymbolIdx ToSymbol(IndexTypeId id) const;
|
||||||
SymbolIdx ToSymbol(IndexFuncId id) const;
|
SymbolIdx ToSymbol(IndexFuncId id) const;
|
||||||
SymbolIdx ToSymbol(IndexVarId id) const;
|
SymbolIdx ToSymbol(IndexVarId id) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// TODO: make these type safe
|
// TODO: make these type safe
|
||||||
google::dense_hash_map<size_t, size_t> cached_type_ids_; // IndexTypeId -> QueryTypeId
|
google::dense_hash_map<size_t, size_t> cached_type_ids_; // IndexTypeId -> QueryTypeId
|
||||||
|
Loading…
Reference in New Issue
Block a user