From bb25640d911be508d992d5c813847ebad6f366e2 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Fri, 21 Apr 2017 00:03:33 -0700 Subject: [PATCH] Rename instantiations to instances. --- src/command_line.cc | 2 +- src/indexer.cc | 2 +- src/indexer.h | 4 ++-- src/query.cc | 10 +++++----- src/query.h | 6 +++--- src/serializer.cc | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/command_line.cc b/src/command_line.cc index c9811f10..307c45e4 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -1517,7 +1517,7 @@ void QueryDbMainLoop( QueryType& type = db->types[symbol.idx]; AddCodeLens(&common, ref.loc.OffsetStartColumn(0), type.uses, "ref", "refs"); AddCodeLens(&common, ref.loc.OffsetStartColumn(1), ToQueryLocation(db, type.derived), "derived", "derived"); - AddCodeLens(&common, ref.loc.OffsetStartColumn(2), ToQueryLocation(db, type.instantiations), "var", "vars"); + AddCodeLens(&common, ref.loc.OffsetStartColumn(2), ToQueryLocation(db, type.instances), "var", "vars"); break; } case SymbolKind::Func: { diff --git a/src/indexer.cc b/src/indexer.cc index 19d13026..ddb1dbec 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -776,7 +776,7 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { // Don't treat enum definition variables as instantiations. bool is_enum_member = decl->semanticContainer && decl->semanticContainer->cursor.kind == CXCursor_EnumDecl; if (!is_enum_member) - db->Resolve(var_type.value())->instantiations.push_back(var_id); + db->Resolve(var_type.value())->instances.push_back(var_id); var_def->def.variable_type = var_type.value(); } diff --git a/src/indexer.h b/src/indexer.h index 65348422..f2052dc2 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -205,7 +205,7 @@ struct IndexedTypeDef { std::vector derived; // Declared variables of this type. - std::vector instantiations; + std::vector instances; // Every usage, useful for things like renames. // NOTE: Do not insert directly! Use AddUsage instead. @@ -219,7 +219,7 @@ struct IndexedTypeDef { return def.HasInterestingState() || !derived.empty() || - !instantiations.empty() || + !instances.empty() || !uses.empty(); } diff --git a/src/query.cc b/src/query.cc index 6738b8f6..c534e4d9 100644 --- a/src/query.cc +++ b/src/query.cc @@ -515,8 +515,8 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, const IdMap& current_id_m types_def_update.push_back(ToQuery(current_id_map, type->def)); if (!type->derived.empty()) types_derived.push_back(QueryType::DerivedUpdate(current_id_map.ToQuery(type->id), current_id_map.ToQuery(type->derived))); - if (!type->instantiations.empty()) - types_instantiations.push_back(QueryType::InstantiationsUpdate(current_id_map.ToQuery(type->id), current_id_map.ToQuery(type->instantiations))); + if (!type->instances.empty()) + types_instances.push_back(QueryType::InstancesUpdate(current_id_map.ToQuery(type->id), current_id_map.ToQuery(type->instances))); if (!type->uses.empty()) types_uses.push_back(QueryType::UsesUpdate(current_id_map.ToQuery(type->id), current_id_map.ToQuery(type->uses))); }, @@ -527,7 +527,7 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, const IdMap& current_id_m types_def_update.push_back(*current_remapped_def); PROCESS_UPDATE_DIFF(QueryTypeId, types_derived, derived, QueryTypeId); - PROCESS_UPDATE_DIFF(QueryTypeId, types_instantiations, instantiations, QueryVarId); + PROCESS_UPDATE_DIFF(QueryTypeId, types_instances, instances, QueryVarId); PROCESS_UPDATE_DIFF(QueryTypeId, types_uses, uses, QueryLocation); }); @@ -594,7 +594,7 @@ void IndexUpdate::Merge(const IndexUpdate& update) { INDEX_UPDATE_APPEND(types_removed); INDEX_UPDATE_APPEND(types_def_update); INDEX_UPDATE_MERGE(types_derived); - INDEX_UPDATE_MERGE(types_instantiations); + INDEX_UPDATE_MERGE(types_instances); INDEX_UPDATE_MERGE(types_uses); INDEX_UPDATE_APPEND(funcs_removed); @@ -674,7 +674,7 @@ void QueryDatabase::ApplyIndexUpdate(IndexUpdate* update) { RemoveUsrs(update->types_removed); ImportOrUpdate(update->types_def_update); HANDLE_MERGEABLE(types_derived, derived, types); - HANDLE_MERGEABLE(types_instantiations, instantiations, types); + HANDLE_MERGEABLE(types_instances, instances, types); HANDLE_MERGEABLE(types_uses, uses, types); RemoveUsrs(update->funcs_removed); diff --git a/src/query.h b/src/query.h index 42589918..72e2f3b5 100644 --- a/src/query.h +++ b/src/query.h @@ -163,12 +163,12 @@ struct QueryFile { struct QueryType { using DefUpdate = TypeDefDefinitionData; using DerivedUpdate = MergeableUpdate; - using InstantiationsUpdate = MergeableUpdate; + using InstancesUpdate = MergeableUpdate; using UsesUpdate = MergeableUpdate; DefUpdate def; std::vector derived; - std::vector instantiations; + std::vector instances; std::vector uses; size_t detailed_name_idx = -1; @@ -219,7 +219,7 @@ struct IndexUpdate { std::vector types_removed; std::vector types_def_update; std::vector types_derived; - std::vector types_instantiations; + std::vector types_instances; std::vector types_uses; // Function updates. diff --git a/src/serializer.cc b/src/serializer.cc index 354eb4df..f8389229 100644 --- a/src/serializer.cc +++ b/src/serializer.cc @@ -136,7 +136,7 @@ void Reflect(TVisitor& visitor, IndexedTypeDef& value) { REFLECT_MEMBER2("types", value.def.types); REFLECT_MEMBER2("funcs", value.def.funcs); REFLECT_MEMBER2("vars", value.def.vars); - REFLECT_MEMBER2("instantiations", value.instantiations); + REFLECT_MEMBER2("instantiations", value.instances); REFLECT_MEMBER2("uses", value.uses); REFLECT_MEMBER_END(); }