[Serialization] Add grouping information of Stdlib to its module documentation file and deserialize it into ModuleFile.

We currently do not support more sophisticated naming mechanisms; group names are stemmed source file names.
This commit is contained in:
Xi Ge
2016-02-05 14:26:43 -08:00
parent 33756a53b2
commit 33b4de7ff6
5 changed files with 143 additions and 9 deletions

View File

@@ -296,6 +296,9 @@ private:
using SerializedDeclCommentTable =
llvm::OnDiskIterableChainedHashTable<DeclCommentTableInfo>;
using GroupNameTable = llvm::DenseMap<unsigned, StringRef>;
std::unique_ptr<GroupNameTable> GroupNamesMap;
std::unique_ptr<SerializedDeclCommentTable> DeclCommentTable;
struct {
@@ -398,6 +401,9 @@ private:
std::unique_ptr<SerializedDeclCommentTable>
readDeclCommentTable(ArrayRef<uint64_t> fields, StringRef blobData);
std::unique_ptr<GroupNameTable>
readGroupTable(ArrayRef<uint64_t> fields, StringRef blobData);
/// Reads the comment block, which contains USR to comment mappings.
///
/// Returns false if there was an error.
@@ -608,6 +614,8 @@ public:
virtual void finishNormalConformance(NormalProtocolConformance *conformance,
uint64_t contextData) override;
Optional<StringRef> getGroupNameById(unsigned Id);
Optional<StringRef> getGroupNameForDecl(const Decl *D);
Optional<BriefAndRawComment> getCommentForDecl(const Decl *D);
Optional<BriefAndRawComment> getCommentForDeclByUSR(StringRef USR);