Skip to content

Conversation

@HighCommander4
Copy link
Collaborator

This is a follow-up to #118324 to document that the Dex fields Files and IdxContents are intentionally only used in some cases, and describe what those cases are.

@llvmbot
Copy link
Member

llvmbot commented Dec 6, 2024

@llvm/pr-subscribers-clang-tools-extra

Author: Nathan Ridge (HighCommander4)

Changes

This is a follow-up to #118324 to document that the Dex fields Files and IdxContents are intentionally only used in some cases, and describe what those cases are.


Full diff: https://github.com/llvm/llvm-project/pull/118906.diff

1 Files Affected:

  • (modified) clang-tools-extra/clangd/index/dex/Dex.h (+2)
diff --git a/clang-tools-extra/clangd/index/dex/Dex.h b/clang-tools-extra/clangd/index/dex/Dex.h
index 69e161d51135b6..8ae4050d004e28 100644
--- a/clang-tools-extra/clangd/index/dex/Dex.h
+++ b/clang-tools-extra/clangd/index/dex/Dex.h
@@ -121,6 +121,8 @@ class Dex : public SymbolIndex {
   llvm::DenseMap<std::pair<SymbolID, uint8_t>, std::vector<SymbolID>> Relations;
   std::shared_ptr<void> KeepAlive; // poor man's move-only std::any
   // Set of files which were used during this index build.
+  // Files and IdxContents are only populated for dynamic and background
+  // indexes, not static indexes.
   llvm::StringSet<> Files;
   // Contents of the index (symbols, references, etc.)
   IndexContents IdxContents;

@llvmbot
Copy link
Member

llvmbot commented Dec 6, 2024

@llvm/pr-subscribers-clangd

Author: Nathan Ridge (HighCommander4)

Changes

This is a follow-up to #118324 to document that the Dex fields Files and IdxContents are intentionally only used in some cases, and describe what those cases are.


Full diff: https://github.com/llvm/llvm-project/pull/118906.diff

1 Files Affected:

  • (modified) clang-tools-extra/clangd/index/dex/Dex.h (+2)
diff --git a/clang-tools-extra/clangd/index/dex/Dex.h b/clang-tools-extra/clangd/index/dex/Dex.h
index 69e161d51135b6..8ae4050d004e28 100644
--- a/clang-tools-extra/clangd/index/dex/Dex.h
+++ b/clang-tools-extra/clangd/index/dex/Dex.h
@@ -121,6 +121,8 @@ class Dex : public SymbolIndex {
   llvm::DenseMap<std::pair<SymbolID, uint8_t>, std::vector<SymbolID>> Relations;
   std::shared_ptr<void> KeepAlive; // poor man's move-only std::any
   // Set of files which were used during this index build.
+  // Files and IdxContents are only populated for dynamic and background
+  // indexes, not static indexes.
   llvm::StringSet<> Files;
   // Contents of the index (symbols, references, etc.)
   IndexContents IdxContents;

@HighCommander4 HighCommander4 changed the title [clangd] Document the cases in which Dex::Files and IdxContents are populated [clangd] Add clarifying comment about when Dex::IdxContents is populated Dec 8, 2024
@HighCommander4 HighCommander4 merged commit 26760c7 into llvm:main Dec 9, 2024
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants