diff options
Diffstat (limited to 'clang-tools-extra/clangd/index/Index.h')
-rw-r--r-- | clang-tools-extra/clangd/index/Index.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/clang-tools-extra/clangd/index/Index.h b/clang-tools-extra/clangd/index/Index.h index e416dbfddd8..b406097da85 100644 --- a/clang-tools-extra/clangd/index/Index.h +++ b/clang-tools-extra/clangd/index/Index.h @@ -228,27 +228,27 @@ public: // SymbolSlab::Builder is a mutable container that can 'freeze' to SymbolSlab. // The frozen SymbolSlab will use less memory. class Builder { - public: - // Adds a symbol, overwriting any existing one with the same ID. - // This is a deep copy: underlying strings will be owned by the slab. - void insert(const Symbol& S); - - // Returns the symbol with an ID, if it exists. Valid until next insert(). - const Symbol* find(const SymbolID &ID) { - auto I = SymbolIndex.find(ID); - return I == SymbolIndex.end() ? nullptr : &Symbols[I->second]; - } - - // Consumes the builder to finalize the slab. - SymbolSlab build() &&; - - private: - llvm::BumpPtrAllocator Arena; - // Intern table for strings. Contents are on the arena. - llvm::DenseSet<llvm::StringRef> Strings; - std::vector<Symbol> Symbols; - // Values are indices into Symbols vector. - llvm::DenseMap<SymbolID, size_t> SymbolIndex; + public: + // Adds a symbol, overwriting any existing one with the same ID. + // This is a deep copy: underlying strings will be owned by the slab. + void insert(const Symbol &S); + + // Returns the symbol with an ID, if it exists. Valid until next insert(). + const Symbol *find(const SymbolID &ID) { + auto I = SymbolIndex.find(ID); + return I == SymbolIndex.end() ? nullptr : &Symbols[I->second]; + } + + // Consumes the builder to finalize the slab. + SymbolSlab build() &&; + + private: + llvm::BumpPtrAllocator Arena; + // Intern table for strings. Contents are on the arena. + llvm::DenseSet<llvm::StringRef> Strings; + std::vector<Symbol> Symbols; + // Values are indices into Symbols vector. + llvm::DenseMap<SymbolID, size_t> SymbolIndex; }; private: |