https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/118324
>From 4142b5bd36a4f7a554196687e191a09dba9e4dcf Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat <zahira.ammarguel...@intel.com> Date: Mon, 2 Dec 2024 09:09:21 -0800 Subject: [PATCH 1/3] [NFC] Fix uninitialized data member in constructor. --- clang-tools-extra/clangd/index/dex/Dex.h | 1 + 1 file changed, 1 insertion(+) diff --git a/clang-tools-extra/clangd/index/dex/Dex.h b/clang-tools-extra/clangd/index/dex/Dex.h index 69e161d51135b6..f907c9a55b935b 100644 --- a/clang-tools-extra/clangd/index/dex/Dex.h +++ b/clang-tools-extra/clangd/index/dex/Dex.h @@ -58,6 +58,7 @@ class Dex : public SymbolIndex { KeepAlive = std::shared_ptr<void>( std::make_shared<Payload>(std::move(BackingData)), nullptr); this->BackingDataSize = BackingDataSize; + this->IdxContents = IndexContents::All; } template <typename SymbolRange, typename RefsRange, typename RelationsRange, >From d93be0f1db9eb4cb4691c7b023bf6bccccc046d7 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat <zahira.ammarguel...@intel.com> Date: Mon, 2 Dec 2024 10:54:41 -0800 Subject: [PATCH 2/3] Fix uninitialized scalar field in constructor. --- clang-tools-extra/clangd/index/MemIndex.h | 1 + 1 file changed, 1 insertion(+) diff --git a/clang-tools-extra/clangd/index/MemIndex.h b/clang-tools-extra/clangd/index/MemIndex.h index fba2c1a7120a2b..879d7750ac0480 100644 --- a/clang-tools-extra/clangd/index/MemIndex.h +++ b/clang-tools-extra/clangd/index/MemIndex.h @@ -43,6 +43,7 @@ class MemIndex : public SymbolIndex { KeepAlive = std::shared_ptr<void>( std::make_shared<Payload>(std::move(BackingData)), nullptr); this->BackingDataSize = BackingDataSize; + this->IdxContents = IndexContents::All; } template <typename SymbolRange, typename RefRange, typename RelationRange, >From 12febcfcb0bbf7d4ec0ee3265076dabfc07f6ba6 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat <zahira.ammarguel...@intel.com> Date: Mon, 2 Dec 2024 14:10:29 -0800 Subject: [PATCH 3/3] Put the initialization in the declaration. --- clang-tools-extra/clangd/index/MemIndex.h | 1 - clang-tools-extra/clangd/index/dex/Dex.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/clang-tools-extra/clangd/index/MemIndex.h b/clang-tools-extra/clangd/index/MemIndex.h index 879d7750ac0480..fba2c1a7120a2b 100644 --- a/clang-tools-extra/clangd/index/MemIndex.h +++ b/clang-tools-extra/clangd/index/MemIndex.h @@ -43,7 +43,6 @@ class MemIndex : public SymbolIndex { KeepAlive = std::shared_ptr<void>( std::make_shared<Payload>(std::move(BackingData)), nullptr); this->BackingDataSize = BackingDataSize; - this->IdxContents = IndexContents::All; } template <typename SymbolRange, typename RefRange, typename RelationRange, diff --git a/clang-tools-extra/clangd/index/dex/Dex.h b/clang-tools-extra/clangd/index/dex/Dex.h index f907c9a55b935b..84397458107de7 100644 --- a/clang-tools-extra/clangd/index/dex/Dex.h +++ b/clang-tools-extra/clangd/index/dex/Dex.h @@ -58,7 +58,6 @@ class Dex : public SymbolIndex { KeepAlive = std::shared_ptr<void>( std::make_shared<Payload>(std::move(BackingData)), nullptr); this->BackingDataSize = BackingDataSize; - this->IdxContents = IndexContents::All; } template <typename SymbolRange, typename RefsRange, typename RelationsRange, @@ -124,7 +123,7 @@ class Dex : public SymbolIndex { // Set of files which were used during this index build. llvm::StringSet<> Files; // Contents of the index (symbols, references, etc.) - IndexContents IdxContents; + IndexContents IdxContents = IndexContents::None; // Size of memory retained by KeepAlive. size_t BackingDataSize = 0; }; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits