Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, const char** argv) {
driver::add_serve(clice, exit_code, self_path);
driver::add_query(clice, exit_code);
driver::add_worker(clice, exit_code);
driver::add_index(clice, exit_code);
driver::add_index(clice, exit_code, self_path);
driver::add_doc(clice, exit_code);
driver::add_lint(clice, exit_code);
driver::add_format(clice, exit_code);
Expand Down
11 changes: 6 additions & 5 deletions src/command/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ class CompilationDatabase {
/// All compilation entries (sorted by path_id).
llvm::ArrayRef<CompilationEntry> get_entries() const;

/// Map each file's path_id to the sorted canonical command hashes of its
/// entries (a file may own several entries with different flags). The
/// entry identity reload_and_diff() diffs on and the indexer persists to
/// catch command changes across sessions.
llvm::DenseMap<std::uint32_t, llvm::SmallVector<std::string, 1>> command_hash_snapshot() const;

/// A group of files that share the same compilation configuration.
/// CDB internally deduplicates by (directory, canonical flags, user-content flags),
/// so each group corresponds to one unique CompilationInfo — files within a group
Expand Down Expand Up @@ -295,11 +301,6 @@ class CompilationDatabase {
llvm::StringRef directory,
llvm::StringRef command);

/// Map each file's path_id to the sorted canonical command hashes of its
/// entries (a file may own several entries with different flags). Used by
/// reload_and_diff() to compare the database before and after a reload.
llvm::DenseMap<std::uint32_t, llvm::SmallVector<std::string, 1>> command_hash_snapshot() const;

/// The memory pool which holds all elements of compilation database.
/// Heap-allocated so its address is stable across moves.
std::unique_ptr<llvm::BumpPtrAllocator> allocator = std::make_unique<llvm::BumpPtrAllocator>();
Expand Down
2 changes: 1 addition & 1 deletion src/driver/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace clice::driver {
void add_serve(kota::deco::cli::SubCommander& root, int& exit_code, const char* self_path);
void add_query(kota::deco::cli::SubCommander& root, int& exit_code);
void add_worker(kota::deco::cli::SubCommander& root, int& exit_code);
void add_index(kota::deco::cli::SubCommander& root, int& exit_code);
void add_index(kota::deco::cli::SubCommander& root, int& exit_code, const char* self_path);
void add_doc(kota::deco::cli::SubCommander& root, int& exit_code);
void add_lint(kota::deco::cli::SubCommander& root, int& exit_code);
void add_format(kota::deco::cli::SubCommander& root, int& exit_code);
Expand Down
Loading
Loading