[PATCH] D52534: [clangd] NFC: Update Serialization routine documentation
Kirill Bobyrev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 26 01:08:05 PDT 2018
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52534.167070.patch
Type: text/x-patch
Size: 1965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180926/46f1b670/attachment-0001.bin>
More information about the cfe-commits
mailing list