kbobyrev created this revision. kbobyrev added reviewers: sammccall, ioeric. kbobyrev added a project: clang-tools-extra. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay.
According to new implementation, `readIndexFile` can also process YAML symbol collections. Also, it might make sense to use Doxygen comments here so that the Doxygen documentation would include short description of each function. https://reviews.llvm.org/D52534 Files: clang-tools-extra/clangd/index/Serialization.h Index: clang-tools-extra/clangd/index/Serialization.h =================================================================== --- clang-tools-extra/clangd/index/Serialization.h +++ clang-tools-extra/clangd/index/Serialization.h @@ -40,14 +40,15 @@ YAML, // Human-readable format, suitable for experiments and debugging. }; -// Holds the contents of an index file that was read. +/// Holds the contents of an index file that was read. struct IndexFileIn { llvm::Optional<SymbolSlab> Symbols; }; -// Parse an index file. The input must be a RIFF container chunk. +/// Parse an index file. The input must be a RIFF container chunk or YAML symbol +/// collection. llvm::Expected<IndexFileIn> readIndexFile(llvm::StringRef); -// Specifies the contents of an index file to be written. +/// Specifies the contents of an index file to be written. struct IndexFileOut { const SymbolSlab *Symbols; // TODO: Support serializing symbol occurrences. @@ -58,16 +59,16 @@ IndexFileOut(const IndexFileIn &I) : Symbols(I.Symbols ? I.Symbols.getPointer() : nullptr) {} }; -// Serializes an index file. +/// Serializes an index file. llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const IndexFileOut &O); std::string toYAML(const Symbol &); -// Returned symbol is backed by the YAML input. +/// Returned symbol is backed by the YAML input. // FIXME: this is only needed for IndexerMain, find a better solution. llvm::Expected<Symbol> symbolFromYAML(llvm::yaml::Input &); -// Build an in-memory static index from an index file. -// The size should be relatively small, so data can be managed in memory. +/// Build an in-memory static index from an index file. +/// The size should be relatively small, so data can be managed in memory. std::unique_ptr<SymbolIndex> loadIndex(llvm::StringRef Filename, llvm::ArrayRef<std::string> URISchemes, bool UseDex = true);
Index: clang-tools-extra/clangd/index/Serialization.h =================================================================== --- clang-tools-extra/clangd/index/Serialization.h +++ clang-tools-extra/clangd/index/Serialization.h @@ -40,14 +40,15 @@ YAML, // Human-readable format, suitable for experiments and debugging. }; -// Holds the contents of an index file that was read. +/// Holds the contents of an index file that was read. struct IndexFileIn { llvm::Optional<SymbolSlab> Symbols; }; -// Parse an index file. The input must be a RIFF container chunk. +/// Parse an index file. The input must be a RIFF container chunk or YAML symbol +/// collection. llvm::Expected<IndexFileIn> readIndexFile(llvm::StringRef); -// Specifies the contents of an index file to be written. +/// Specifies the contents of an index file to be written. struct IndexFileOut { const SymbolSlab *Symbols; // TODO: Support serializing symbol occurrences. @@ -58,16 +59,16 @@ IndexFileOut(const IndexFileIn &I) : Symbols(I.Symbols ? I.Symbols.getPointer() : nullptr) {} }; -// Serializes an index file. +/// Serializes an index file. llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const IndexFileOut &O); std::string toYAML(const Symbol &); -// Returned symbol is backed by the YAML input. +/// Returned symbol is backed by the YAML input. // FIXME: this is only needed for IndexerMain, find a better solution. llvm::Expected<Symbol> symbolFromYAML(llvm::yaml::Input &); -// Build an in-memory static index from an index file. -// The size should be relatively small, so data can be managed in memory. +/// Build an in-memory static index from an index file. +/// The size should be relatively small, so data can be managed in memory. std::unique_ptr<SymbolIndex> loadIndex(llvm::StringRef Filename, llvm::ArrayRef<std::string> URISchemes, bool UseDex = true);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits